/* ============================================================
   HUELLITAS CLUB — Panel de administración (interno)
   Estética sobria: gris-verde neutro, tarjetas limpias, tablas
   estilo base de datos. Autocontenido (no usa la paleta de marca).
   ============================================================ */

:root {
  --fondo:   #f2f4f0;
  --tinta:   #26302a;
  --suave:   #6b756c;
  --borde:   #dde2dc;
  --linea:   #e7ebe5;
  --verde:   #14431f;   /* musgo institucional para header/acentos */
  --verde-2: #0f331a;
  --lima:    #cdd21f;
  --blanco:  #ffffff;
  --ok:      #1f7a34;
  --error:   #c0392b;
  --ff: "Nunito Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  --radio: 8px;
  --sombra: 0 4px 16px rgba(20,40,25,.07);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--ff);
  background: var(--fondo); color: var(--tinta);
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }

/* ---------- Login ---------- */
.acceso {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(125% 95% at 50% 38%, #175c2d 0%, #104922 45%, #0b3319 100%);
}
.login-card {
  width: 100%; max-width: 360px; background: var(--blanco);
  border: 1px solid var(--borde); border-radius: 12px;
  box-shadow: var(--sombra); padding: 34px 30px 26px; text-align: center;
}
.login-card__logo { width: 68px; margin: 0 auto 16px; }
.login-card h1 {
  font-size: 1.12rem; font-weight: 800; letter-spacing: -.01em;
  margin: 0 0 2px; color: var(--tinta);
}
.login-card .sub { color: var(--suave); font-size: .88rem; margin: 0 0 22px; }
.gbtn-wrap { display: flex; justify-content: center; min-height: 44px; }
.login-card__foot { margin-top: 20px; font-size: .82rem; }
.login-card__foot a { color: var(--suave); text-decoration: none; }
.login-card__foot a:hover { color: var(--verde); }
/* "Volver a la web" fuera del recuadro, debajo, sobre el fondo verde */
.acceso-foot { margin-top: 20px; text-align: center; font-size: .85rem; }
.acceso-foot a { color: rgba(255,255,255,.82); text-decoration: none; }
.acceso-foot a:hover { color: #fff; text-decoration: underline; }
.aviso {
  font-size: .82rem; color: var(--error); background: #fdece9;
  border: 1px solid #f5c9c1; border-radius: 6px; padding: 9px 11px;
  margin-top: 14px; text-align: left; display: none;
}
.aviso.show { display: block; }

/* ---------- App bar ---------- */
.appbar {
  background: var(--verde); color: #eef3ec;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px;
}
.appbar__brand { display: flex; align-items: center; gap: 14px; }
.appbar__logo { height: 40px; width: auto; }
.appbar__tag {
  font-size: .82rem; font-weight: 600; letter-spacing: .02em; color: #dfe8db;
  padding-left: 14px; border-left: 1px solid rgba(255,255,255,.25);
}
.appbar__user { display: flex; align-items: center; gap: 14px; font-size: .9rem; }
.appbar__user .who { opacity: .85; }
.btn-salir {
  background: transparent; color: #eef3ec; border: 1px solid rgba(255,255,255,.3);
  border-radius: 6px; padding: .34rem .9rem; cursor: pointer; font: inherit; font-size: .85rem;
  transition: background .15s;
}
.btn-salir:hover { background: rgba(255,255,255,.12); }

/* ---------- Layout ---------- */
.wrap { max-width: 1160px; margin: 26px auto; padding: 0 24px 96px; }
.page-head { margin-bottom: 20px; }
.page-head h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.page-head p { color: var(--suave); font-size: .9rem; margin: 3px 0 0; }

/* ---------- Métricas ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.stats.stats-3 { grid-template-columns: repeat(3, 1fr); }

/* Impacto: bloque (título + botón) a la izquierda, totales en rosa a la derecha, centrados entre sí */
.imp-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.imp-head__left h3 { margin: 0; }
.imp-tot { display: flex; gap: 14px; flex-wrap: wrap; }
.imp-tot .it {
  background: #fdf2f7; border: 1px solid #f3d7e4; border-radius: var(--radio);
  padding: 14px 20px; text-align: center; min-width: 120px;
}
.imp-tot .it b { display: block; font-size: 1.6rem; font-weight: 800; color: #c04d84; line-height: 1; letter-spacing: -.01em; }
.imp-tot .it span { display: block; font-size: .74rem; color: var(--suave); margin-top: 5px; }
.stat {
  background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 16px 18px;
}
.stat b { display: block; font-size: 1.7rem; font-weight: 800; color: var(--verde); line-height: 1; letter-spacing: -.02em; }
.stat span { display: block; color: var(--suave); font-size: .82rem; margin-top: 6px; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--borde); margin-bottom: 18px;
}
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 10px 16px; cursor: pointer; font: inherit; font-size: .9rem; font-weight: 700;
  color: var(--suave); margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.tabs button:hover { color: var(--tinta); }
.tabs button.on { color: var(--verde); border-bottom-color: var(--verde); }

/* ---------- Paneles ---------- */
.tab-panel { display: none; }
.tab-panel.on { display: block; }
.tab-panel h3 { font-size: 1rem; font-weight: 800; margin: 0 0 14px; }

/* ---------- Tabla estilo base de datos ---------- */
.tabla { width: 100%; border-collapse: collapse; background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; }
.tabla th, .tabla td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--linea); }
.tabla th {
  background: var(--verde); color: #eef3ec; font-size: .7rem; text-transform: uppercase;
  letter-spacing: .06em; font-weight: 700;
}
.tabla td { font-size: .88rem; color: #333b34; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody tr:nth-child(even) td { background: #fafbf9; }
.tabla tbody tr:hover td { background: #eef3ea; }

/* Chips de estado */
.chip { display: inline-block; padding: .18rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 700; text-transform: capitalize; }
.chip.activo, .chip.nuevo { background: #e3f3e7; color: #1f7a34; }
.chip.contactado, .chip.pausado { background: #fde7d5; color: #b5651d; }
.chip.baja, .chip.descartado { background: #f1e2e0; color: #a23b2e; }

/* Buscador */
.buscador {
  width: 100%; max-width: 380px; padding: 9px 12px; margin-bottom: 14px;
  border: 1px solid var(--borde); border-radius: 6px; font: inherit; font-size: .9rem; background: var(--blanco);
}
.buscador:focus { outline: none; border-color: #9aa79b; }

/* Botones de fila */
.btn-fila {
  border: 1px solid var(--borde); background: var(--blanco); color: var(--tinta);
  border-radius: 5px; padding: .28rem .7rem; font: inherit; font-size: .8rem; cursor: pointer; margin-right: 4px;
  transition: background .15s;
}
.btn-fila:hover { background: #f0f2ee; }
.btn-fila.baja { color: var(--error); border-color: #ecc7c1; }
.btn-fila.baja:hover { background: #fbeeeb; }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 12px; }
.form.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form.grid-2 { grid-template-columns: 1fr 1fr; }
.form label { display: block; font-size: .78rem; font-weight: 700; color: var(--suave); margin-bottom: 4px; }
.form input, .form select, .form textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--borde); border-radius: 6px;
  font: inherit; font-size: .9rem; background: var(--blanco); color: var(--tinta);
}
.form textarea { resize: vertical; min-height: 90px; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: #9aa79b; }
.col-full { grid-column: 1 / -1; }

.btn-primario {
  background: var(--verde); color: #fff; border: 0; border-radius: 6px;
  padding: 10px 18px; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer;
  transition: background .15s;
}
.btn-primario:hover { background: var(--verde-2); }
.btn-danger { background: var(--error); color: #fff; border: 0; border-radius: 6px; padding: 10px 18px; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; transition: filter .15s; }
.btn-danger:hover { filter: brightness(.92); }
.btn-guardar { background: var(--verde); color: #fff; border: 0; border-radius: 5px; padding: .4rem .9rem; font: inherit; font-size: .82rem; cursor: pointer; }

/* Mensajes */
.msg { font-size: .85rem; min-height: 1em; }
.msg.ok { color: var(--ok); }
.msg.error { color: var(--error); }

.tarjeta { background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); padding: 20px; }
.nota { color: var(--suave); font-size: .85rem; margin-top: 12px; }

@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .form.grid-3, .form.grid-2 { grid-template-columns: 1fr; }
  .tabla { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ---------- Botón "+ Agregar" centrado + Modal ---------- */
.add-row { display: flex; justify-content: center; margin-top: 24px; }
.btn-add {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--verde); color: #eef3ec; border: 0; border-radius: 8px;
  padding: .7rem 1.5rem; font: inherit; font-weight: 800; font-size: .92rem;
  cursor: pointer; transition: background .15s, transform .15s; box-shadow: var(--sombra);
}
.btn-add:hover { background: var(--verde-2); transform: translateY(-1px); }
.btn-add .plus { font-size: 1.15rem; line-height: 1; font-weight: 800; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(20,40,25,.5);
  display: none; align-items: center; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal-box {
  position: relative; background: var(--blanco); border: 1px solid var(--borde);
  border-radius: 12px; box-shadow: 0 24px 60px rgba(20,40,25,.28);
  width: 100%; max-width: 640px; padding: 28px; margin: auto;
  animation: modalIn .22s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.modal-title { font-size: 1.05rem; font-weight: 800; margin: 0 0 18px; }
.modal-x {
  position: absolute; top: 12px; right: 14px; background: none; border: 0;
  font-size: 1.5rem; line-height: 1; color: var(--suave); cursor: pointer; padding: 4px;
}
.modal-x:hover { color: var(--tinta); }

/* Encabezado de pestaña: título + buscador alineado a la derecha */
.tab-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.tab-head h3 { margin: 0; }
.tab-head .buscador { margin: 0; max-width: 340px; flex: 0 1 340px; }
@media (max-width: 620px) {
  .tab-head { flex-direction: column; align-items: stretch; }
  .tab-head .buscador { max-width: none; flex: 1; }
}
