/* ============================================================
   Limpieza Quilmes — Estilos globales
   Mobile-first · Confianza · Claridad
   ============================================================ */

:root {
  --verde:        #1a7f5a;
  --verde-oscuro: #135f43;
  --verde-claro:  #e8f5ee;
  --verde-wa:     #25d366;
  --verde-wa-h:   #128c3e;
  --gris-bg:      #f4f6f4;
  --gris-card:    #ffffff;
  --gris-borde:   #e2e8e4;
  --texto:        #111827;
  --texto-suave:  #4b5563;
  --texto-leve:   #9ca3af;
  --badge-bg:     #d1fae5;
  --badge-color:  #065f46;
  --sombra:       0 2px 12px rgba(0,0,0,.07);
  --sombra-hover: 0 6px 24px rgba(0,0,0,.12);
  --radio:        14px;
  --radio-badge:  20px;
  --transicion:   .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gris-bg);
  color: var(--texto);
  line-height: 1.6;
  min-height: 100vh;
}

/* ──────────────── HEADER ──────────────── */
.header {
  background: var(--verde);
  color: #fff;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.header-logo {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.3px;
  display: flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
  color: #fff;
}
.header-logo span { font-size: 1.25rem; }
.header-admin {
  font-size: .8rem;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  padding: .3rem .7rem;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px;
  transition: var(--transicion);
}
.header-admin:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ──────────────── HERO ──────────────── */
.hero {
  background: linear-gradient(135deg, var(--verde) 0%, #0f5e40 100%);
  color: #fff;
  text-align: center;
  padding: 3rem 1.25rem 2.5rem;
}
.hero h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: .75rem;
}
.hero p {
  font-size: 1.05rem;
  opacity: .88;
  max-width: 520px;
  margin: 0 auto 1.5rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 30px;
  padding: .35rem .9rem;
  font-size: .85rem;
  font-weight: 500;
}

/* ──────────────── CONTENIDO PRINCIPAL ──────────────── */
.main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--texto);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-title .count {
  font-size: .85rem;
  font-weight: 500;
  color: var(--texto-suave);
  background: var(--verde-claro);
  padding: .15rem .5rem;
  border-radius: 10px;
}

/* ──────────────── GRILLA DE TARJETAS ──────────────── */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}
@media (min-width: 560px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 820px) { .grid { grid-template-columns: 1fr 1fr 1fr; } }

/* ──────────────── TARJETA DE PERFIL ──────────────── */
.card {
  background: var(--gris-card);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transicion), transform var(--transicion);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.card:hover, .card:focus-visible {
  box-shadow: var(--sombra-hover);
  transform: translateY(-2px);
}
.card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--verde-claro);
  display: block;
}
.card-img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--verde-claro);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: .5rem; }
.card-nombre { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.badge-verificada {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: var(--badge-bg);
  color: var(--badge-color);
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: var(--radio-badge);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: .5rem;
}
.badge-verificada svg { width: 12px; height: 12px; }

.card-zona {
  font-size: .83rem;
  color: var(--texto-suave);
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-bottom: .5rem;
}
.card-tareas {
  font-size: .83rem;
  color: var(--texto-suave);
  margin-bottom: .5rem;
  line-height: 1.5;
}
.card-disponibilidad {
  font-size: .78rem;
  color: var(--verde-oscuro);
  font-weight: 600;
  background: var(--verde-claro);
  padding: .2rem .55rem;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: .75rem;
}
.card-testimonio {
  font-size: .82rem;
  color: var(--texto-suave);
  font-style: italic;
  border-left: 3px solid var(--verde-claro);
  padding-left: .6rem;
  margin-bottom: 1rem;
  flex: 1;
  line-height: 1.55;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.btn-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  background: var(--verde-wa);
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  padding: .65rem 1rem;
  border-radius: 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background var(--transicion), transform var(--transicion);
  width: 100%;
}
.btn-wa:hover { background: var(--verde-wa-h); transform: scale(1.01); }
.btn-wa svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ──────────────── ESTADO VACÍO ──────────────── */
.estado-vacio {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--texto-suave);
  grid-column: 1 / -1;
}
.estado-vacio .icono { font-size: 3rem; margin-bottom: 1rem; }
.estado-vacio h3 { font-size: 1.1rem; color: var(--texto); margin-bottom: .5rem; }

/* ──────────────── SKELETON LOADER ──────────────── */
.skeleton {
  background: linear-gradient(90deg, #e8eee9 25%, #f2f6f2 50%, #e8eee9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.card-skeleton .card-img { height: 180px; }
.card-skeleton .sk-line { height: 14px; margin-bottom: 8px; }
.card-skeleton .sk-line.short { width: 60%; }

/* ──────────────── PÁGINA DE PERFIL ──────────────── */
.perfil-wrapper {
  max-width: 620px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: var(--verde);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.perfil-card {
  background: #fff;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  overflow: hidden;
}
.perfil-foto {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
  background: var(--verde-claro);
}
.perfil-foto-placeholder {
  width: 100%;
  height: 200px;
  background: var(--verde-claro);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}
.perfil-body { padding: 1.5rem; }
.perfil-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}
.perfil-nombre { font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.perfil-info { margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.info-row {
  display: flex;
  gap: .5rem;
  font-size: .9rem;
  align-items: flex-start;
}
.info-label { font-weight: 700; min-width: 120px; color: var(--texto-suave); flex-shrink: 0; }
.info-valor { color: var(--texto); }
.perfil-testimonio {
  background: var(--verde-claro);
  border-left: 4px solid var(--verde);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.1rem;
  font-style: italic;
  color: var(--texto-suave);
  font-size: .9rem;
  line-height: 1.6;
  margin: 1.25rem 0;
}
.perfil-accion { margin-top: 1.5rem; }
.btn-wa-perfil {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  background: var(--verde-wa);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: .85rem 1.5rem;
  border-radius: 12px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  width: 100%;
  transition: background var(--transicion);
}
.btn-wa-perfil:hover { background: var(--verde-wa-h); }
.aviso-contacto {
  font-size: .78rem;
  color: var(--texto-leve);
  text-align: center;
  margin-top: .6rem;
}

/* ──────────────── ADMIN PANEL ──────────────── */
.admin-wrapper {
  max-width: 820px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}
.admin-login {
  max-width: 380px;
  margin: 4rem auto;
  background: #fff;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 2rem;
  text-align: center;
}
.admin-login h2 { font-size: 1.25rem; margin-bottom: 1.25rem; }
.form-group { margin-bottom: 1rem; text-align: left; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: .65rem .8rem;
  border: 1.5px solid var(--gris-borde);
  border-radius: 8px;
  font-size: .9rem;
  font-family: inherit;
  color: var(--texto);
  transition: border-color var(--transicion);
  background: #fff;
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(26,127,90,.12);
}
.btn-primary {
  background: var(--verde);
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  padding: .7rem 1.5rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
  transition: background var(--transicion);
}
.btn-primary:hover { background: var(--verde-oscuro); }
.btn-danger {
  background: #fee2e2;
  color: #991b1b;
  font-size: .8rem;
  font-weight: 600;
  padding: .4rem .75rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transicion);
}
.btn-danger:hover { background: #fca5a5; }
.btn-edit {
  background: var(--verde-claro);
  color: var(--verde-oscuro);
  font-size: .8rem;
  font-weight: 600;
  padding: .4rem .75rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transicion);
}
.btn-edit:hover { background: #b7e4ce; }

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.admin-header h2 { font-size: 1.2rem; font-weight: 800; }
.btn-logout {
  font-size: .8rem;
  color: var(--texto-suave);
  background: none;
  border: 1px solid var(--gris-borde);
  border-radius: 20px;
  padding: .3rem .8rem;
  cursor: pointer;
}
.panel-nuevo {
  background: #fff;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 1.25rem;
  margin-bottom: 2rem;
}
.panel-nuevo h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
@media (min-width: 540px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-grid .span2 { grid-column: 1 / -1; }

.tabla-perfiles { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tabla-perfiles th {
  background: var(--verde-claro);
  color: var(--verde-oscuro);
  font-weight: 700;
  padding: .6rem .75rem;
  text-align: left;
  font-size: .8rem;
}
.tabla-perfiles td { padding: .6rem .75rem; border-bottom: 1px solid var(--gris-borde); vertical-align: middle; }
.tabla-perfiles tr:last-child td { border-bottom: none; }
.tabla-perfiles tr:hover td { background: #fafcfa; }
.tabla-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--verde-claro); }

/* ──────────────── TOAST / NOTIFICACIÓN ──────────────── */
.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--texto);
  color: #fff;
  padding: .7rem 1.25rem;
  border-radius: 30px;
  font-size: .88rem;
  font-weight: 500;
  z-index: 999;
  transition: transform .3s ease, opacity .3s ease;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  max-width: 90vw;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.success { background: var(--verde); }
.toast.error { background: #dc2626; }

/* ──────────────── FOOTER ──────────────── */
.footer {
  text-align: center;
  padding: 1.5rem;
  font-size: .78rem;
  color: var(--texto-leve);
  border-top: 1px solid var(--gris-borde);
  margin-top: 2rem;
}

/* ──────────────── MODAL ──────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radio);
  padding: 1.5rem;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; }
.modal-footer { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.25rem; }
.btn-cancel {
  background: #f3f4f6;
  color: var(--texto);
  font-size: .88rem;
  font-weight: 600;
  padding: .6rem 1.1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.btn-save {
  background: var(--verde);
  color: #fff;
  font-size: .88rem;
  font-weight: 600;
  padding: .6rem 1.1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.btn-save:hover { background: var(--verde-oscuro); }

/* ──────────────── CHAT WIDGET ──────────────── */
.chat-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--verde);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(26,127,90,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  transition: transform .2s, box-shadow .2s;
}
.chat-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(26,127,90,.5); }
.chat-fab svg { width: 26px; height: 26px; }
.chat-fab .chat-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: #ef4444;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
}

.chat-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: min(380px, calc(100vw - 2rem));
  height: min(520px, calc(100vh - 8rem));
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  z-index: 299;
  overflow: hidden;
  transform: scale(.92) translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .2s;
}
.chat-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.chat-header {
  background: var(--verde);
  color: #fff;
  padding: .9rem 1.1rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-shrink: 0;
}
.chat-avatar {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-name { font-size: .95rem; font-weight: 700; line-height: 1.2; }
.chat-header-status { font-size: .72rem; opacity: .8; display: flex; align-items: center; gap: .3rem; }
.chat-status-dot {
  width: 7px; height: 7px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
}
.chat-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  padding: .25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
}
.chat-close:hover { color: #fff; background: rgba(255,255,255,.15); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--gris-borde); border-radius: 4px; }

.msg {
  max-width: 85%;
  line-height: 1.5;
  font-size: .875rem;
  animation: msgIn .2s ease;
}
@keyframes msgIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

.msg-bot {
  align-self: flex-start;
  background: var(--gris-bg);
  color: var(--texto);
  padding: .6rem .85rem;
  border-radius: 4px 16px 16px 16px;
}
.msg-user {
  align-self: flex-end;
  background: var(--verde);
  color: #fff;
  padding: .6rem .85rem;
  border-radius: 16px 4px 16px 16px;
}
.msg-typing {
  align-self: flex-start;
  background: var(--gris-bg);
  padding: .6rem .85rem;
  border-radius: 4px 16px 16px 16px;
  display: flex;
  gap: 4px;
  align-items: center;
}
.typing-dot {
  width: 7px; height: 7px;
  background: var(--texto-suave);
  border-radius: 50%;
  animation: typingBounce 1.2s ease infinite;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

.chat-input-area {
  padding: .75rem;
  border-top: 1px solid var(--gris-borde);
  display: flex;
  gap: .5rem;
  align-items: flex-end;
  flex-shrink: 0;
  background: #fff;
}
.chat-input {
  flex: 1;
  border: 1.5px solid var(--gris-borde);
  border-radius: 22px;
  padding: .55rem .9rem;
  font-size: .875rem;
  font-family: inherit;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  line-height: 1.4;
  color: var(--texto);
  transition: border-color .2s;
  outline: none;
}
.chat-input:focus { border-color: var(--verde); }
.chat-input::placeholder { color: var(--texto-leve); }
.chat-send {
  width: 38px; height: 38px;
  background: var(--verde);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s, transform .15s;
}
.chat-send:hover { background: var(--verde-oscuro); }
.chat-send:active { transform: scale(.92); }
.chat-send:disabled { background: var(--texto-leve); cursor: not-allowed; }
.chat-send svg { width: 17px; height: 17px; }
