/* ════════════════════════════════════════════════════
   BUZÓN DIGITAL — Estilos globales
   Paleta del flyer: negro #1C1C1A, crema #DDD8C4, verde #79C32A
════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;600;700&family=Caveat:wght@700&family=Inter:wght@400;500;600&display=swap');

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #DDD8C4;
  color: #1C1C1A;
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Inputs ──────────────────────────────────────── */
input, textarea, select {
  width: 100%;
  padding: 10px 13px;
  border: 2px solid rgba(0,0,0,.25);
  border-radius: 8px;
  background: #E8E3D5;
  color: #1C1C1A;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
input:focus, textarea:focus, select:focus {
  border-color: #79C32A;
  box-shadow: 0 0 0 3px rgba(121,195,42,.2);
}
textarea { resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #9a9a8e; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235c5c54' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; cursor: pointer; }

/* ── Botones ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 22px;
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .1s, box-shadow .1s, background .15s;
  white-space: nowrap;
}
.btn:hover  { transform: translate(-1px,-1px); }
.btn:active { transform: translate(1px,1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; }

/* Verde — acción principal */
.btn-green {
  background: #79C32A;
  color: #1C1C1A;
  border: 2.5px solid #1C1C1A;
  box-shadow: 3px 3px 0 rgba(0,0,0,.2);
}
.btn-green:hover { background: #5A9B1C; color: #fff; box-shadow: 4px 4px 0 rgba(0,0,0,.25); }

/* Negro */
.btn-black {
  background: #1C1C1A;
  color: #fff;
  border: 2.5px solid #1C1C1A;
  box-shadow: 3px 3px 0 rgba(0,0,0,.2);
}
.btn-black:hover { background: #333; box-shadow: 4px 4px 0 rgba(0,0,0,.25); }

/* Contorno */
.btn-outline {
  background: #E8E3D5;
  color: #1C1C1A;
  border: 2px solid #1C1C1A;
}
.btn-outline:hover { background: #DDD8C4; }

/* Peligro */
.btn-danger {
  background: #E8E3D5;
  color: #c0392b;
  border: 2px solid #c0392b;
}
.btn-danger:hover { background: rgba(192,57,43,.1); }

/* Tamaños */
.btn-sm   { padding: 5px 13px; font-size: 12px; letter-spacing: .5px; border-radius: 6px; }
.btn-full { width: 100%; }

/* ── Cards ───────────────────────────────────────── */
.card {
  background: #F0EDE2;
  border: 1.5px solid rgba(0,0,0,.2);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.12);
}
.card-title {
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #1C1C1A;
  margin-bottom: 16px;
}

/* ── Formulario ──────────────────────────────────── */
.fg   { margin-bottom: 14px; }
.flbl {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #5c5c54;
  letter-spacing: .4px;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.char-c { font-size: 11px; color: #9a9a8e; text-align: right; margin-top: 4px; }

/* ── Alertas ─────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 10px;
  display: none;
}
.alert.show    { display: block; }
.alert-error   { background: rgba(192,57,43,.1); border: 1.5px solid rgba(192,57,43,.3); color: #c0392b; }
.alert-success { background: #E8F5D8; border: 1.5px solid #79C32A; color: #2A5A08; }

/* ── Topbar ──────────────────────────────────────── */
.topbar {
  width: 100%;
  background: #1C1C1A;
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-align: center;
  padding: 10px 16px;
}

/* ── Panel bar ───────────────────────────────────── */
.panel-bar {
  background: #1C1C1A;
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.panel-brand {
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  flex: 1;
}
.panel-brand span {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,.5);
  text-transform: none;
  letter-spacing: 0;
}
.panel-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,.8);
}
.rol-badge {
  background: #79C32A;
  color: #1C1C1A;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: 'Oswald', sans-serif;
  letter-spacing: .5px;
  border: 1px solid rgba(0,0,0,.2);
}
.btn-logout {
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: 12px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}
.btn-logout:hover { color: #fff; }

/* ── Stats bar ───────────────────────────────────── */
.stats-bar {
  background: #E8E3D5;
  border-bottom: 2px solid #1C1C1A;
  padding: 10px 20px;
  display: flex;
  gap: 28px;
  align-items: center;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; }
.stat-n { font-family: 'Oswald', sans-serif; font-size: 24px; font-weight: 700; color: #1C1C1A; line-height: 1; }
.stat-l { font-size: 11px; color: #5c5c54; font-weight: 500; }
.stat.green .stat-n { color: #5A9B1C; }
.stat.red   .stat-n { color: #c0392b; }
.last-ref { font-size: 11px; color: #9a9a8e; margin-left: auto; }

/* ── Tabs ────────────────────────────────────────── */
.tabs {
  display: flex;
  background: #E8E3D5;
  border-bottom: 2.5px solid #1C1C1A;
  overflow-x: auto;
  position: sticky;
  top: 53px;
  z-index: 99;
}
.tab-btn {
  padding: 11px 18px;
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #5c5c54;
  cursor: pointer;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: -2.5px;
  transition: color .15s;
}
.tab-btn:hover  { color: #1C1C1A; }
.tab-btn.active { color: #1C1C1A; border-bottom-color: #79C32A; }

/* ── Tab content ─────────────────────────────────── */
.tab-content { padding: 20px; max-width: 980px; margin: 0 auto; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Filtros ─────────────────────────────────────── */
.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Oswald', sans-serif;
  letter-spacing: .5px;
  text-transform: uppercase;
  cursor: pointer;
  border: 2px solid #1C1C1A;
  background: #E8E3D5;
  color: #1C1C1A;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.filter-btn.active { background: #1C1C1A; color: #fff; }
.filter-btn:hover:not(.active) { background: #DDD8C4; }

/* ── Cards de preguntas ──────────────────────────── */
.q-card {
  background: #F0EDE2;
  border: 1.5px solid rgba(0,0,0,.18);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: 2px 2px 0 rgba(0,0,0,.08);
  transition: border-color .2s;
}
.q-card.destacada {
  border: 2px solid #79C32A;
  box-shadow: 3px 3px 0 rgba(121,195,42,.22);
}
.q-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.q-time { font-size: 11px; color: #9a9a8e; margin-left: auto; }
.q-text { font-size: 15px; color: #1C1C1A; line-height: 1.7; margin-bottom: 12px; }
.q-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.badge-dest {
  display: inline-flex; align-items: center; gap: 3px;
  background: #79C32A; color: #1C1C1A;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px;
  font-family: 'Oswald', sans-serif; letter-spacing: .5px;
  border: 1px solid #1C1C1A;
}
.badge-cens {
  display: inline-flex; align-items: center; gap: 3px;
  background: rgba(200,114,104,.15); color: #c0392b;
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 10px;
  font-family: 'Inter', sans-serif;
}
.q-empty {
  text-align: center;
  padding: 60px 20px;
  color: #9a9a8e;
}
.q-empty i { font-size: 40px; display: block; margin-bottom: 12px; opacity: .4; }
.q-empty-t {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #5c5c54;
}

/* ── En vivo ─────────────────────────────────────── */
.envivo-card {
  background: #F0EDE2;
  border: 2.5px solid #79C32A;
  border-radius: 14px;
  padding: 26px;
  margin-bottom: 14px;
  box-shadow: 4px 4px 0 rgba(121,195,42,.2);
}
.envivo-n {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #5A9B1C;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.envivo-text {
  font-family: 'Oswald', sans-serif;
  font-size: 26px;
  font-weight: 600;
  color: #1C1C1A;
  line-height: 1.5;
}

/* ── Word cloud canvas ───────────────────────────── */
.wc-box {
  background: #F0EDE2;
  border: 1.5px solid rgba(0,0,0,.2);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 2px 2px 0 rgba(0,0,0,.08);
}
#wc-canvas { display: block; width: 100%; border-radius: 8px; }
.wc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 12px;
  padding: 0 4px;
}
.wc-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #5c5c54;
}
.wc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── Tabla de usuarios ───────────────────────────── */
.u-table {
  width: 100%;
  border-collapse: collapse;
  background: #F0EDE2;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 2px 2px 0 rgba(0,0,0,.08);
}
.u-table th {
  background: #1C1C1A;
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 10px 14px;
  text-align: left;
}
.u-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0,0,0,.1);
  font-size: 14px;
  vertical-align: middle;
}
.u-table tr:last-child td { border-bottom: none; }
.u-table tr:hover td { background: rgba(0,0,0,.03); }
.rol-chip {
  display: inline-flex;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Oswald', sans-serif;
  letter-spacing: .5px;
  border: 1.5px solid;
}
.chip-admin  { background: #1C1C1A; color: #fff; border-color: #1C1C1A; }
.chip-doctor { background: #E8F5D8; color: #2A5A08; border-color: #79C32A; }

/* ── Malas palabras chips ────────────────────────── */
.mp-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  border: 1.5px solid rgba(0,0,0,.22);
  background: #F0EDE2;
  color: #1C1C1A;
  transition: all .15s;
}
.mp-chip.off { opacity: .4; text-decoration: line-through; }
.mp-chip button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  font-size: 14px;
}
.mp-chip .mp-toggle { color: #5c5c54; }
.mp-chip .mp-del    { color: #c0392b; }

/* ── Modal ───────────────────────────────────────── */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-bg.open { opacity: 1; pointer-events: all; }
.modal {
  background: #F0EDE2;
  border: 2px solid #1C1C1A;
  border-radius: 14px;
  padding: 28px;
  width: 100%;
  max-width: 440px;
  box-shadow: 6px 6px 0 rgba(0,0,0,.2);
  transform: translateY(12px);
  transition: transform .2s;
}
.modal-bg.open .modal { transform: translateY(0); }
.modal-title {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── Vista pública ───────────────────────────────── */
.public-wrap { display: flex; flex-direction: column; align-items: center; }
.hero { width: 100%; max-width: 520px; padding: 22px 22px 10px; position: relative; overflow: hidden; }
.hero-arcs { position: absolute; top: 0; right: 0; width: 110px; height: 110px; pointer-events: none; }
.city    { font-family: 'Oswald', sans-serif; font-size: 64px; font-weight: 700; color: #1C1C1A; line-height: .92; letter-spacing: -1px; }
.doctor  { font-family: 'Oswald', sans-serif; font-size: 21px; font-weight: 700; color: #79C32A; letter-spacing: 2px; margin: 8px 0 16px; }
.hablemos{ font-family: 'Oswald', sans-serif; font-size: 27px; font-weight: 600; color: #1C1C1A; line-height: 1; }
.salud   { font-family: 'Oswald', sans-serif; font-size: 52px; font-weight: 700; color: #79C32A; line-height: .9; letter-spacing: -1px; }
.hw-note { font-family: 'Caveat', cursive; font-size: 18px; color: #5c5c54; margin: 13px 0 0; display: flex; align-items: flex-start; gap: 8px; line-height: 1.3; }
.xmark   { color: #C87268; font-size: 20px; font-weight: 700; line-height: 1.2; }
.anon-pill { display: inline-flex; align-items: center; gap: 5px; background: rgba(0,0,0,.09); font-size: 11px; font-weight: 600; color: #5c5c54; letter-spacing: .5px; padding: 4px 12px; border-radius: 20px; margin-top: 14px; }
.form-sec { width: 100%; max-width: 520px; padding: 12px 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.suc-icon { width: 62px; height: 62px; background: #79C32A; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; color: #1C1C1A; font-size: 28px; box-shadow: 3px 3px 0 rgba(0,0,0,.14); }
.suc-t { font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.suc-s { font-size: 14px; color: #5c5c54; text-align: center; line-height: 1.7; }
.sponsors { width: 100%; max-width: 520px; padding: 10px 16px 28px; display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap; }
.sponsor-item { display: flex; align-items: center; gap: 8px; }
.sponsor-logo { width: 32px; height: 32px; border: 1.5px solid rgba(0,0,0,.22); border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #F0EDE2; color: #5c5c54; font-size: 14px; }
.sponsor-text { font-size: 10px; color: #5c5c54; line-height: 1.3; max-width: 120px; }
.sponsor-text strong { font-size: 11px; font-family: 'Oswald', sans-serif; font-weight: 600; display: block; color: #1C1C1A; }
.sponsor-div { width: 1px; height: 28px; background: rgba(0,0,0,.15); }
.panel-footer { font-size: 11px; color: #9a9a8e; text-align: center; padding-bottom: 24px; }
.panel-footer a { color: #9a9a8e; text-underline-offset: 2px; }

/* ── Login ───────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.login-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: #F0EDE2; border: 2px solid #1C1C1A; border-radius: 14px; padding: 32px 28px; width: 100%; max-width: 360px; box-shadow: 5px 5px 0 rgba(0,0,0,.16); }
.login-icon { width: 50px; height: 50px; background: #1C1C1A; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; color: #fff; font-size: 22px; }
.login-t { font-family: 'Oswald', sans-serif; font-size: 26px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.login-s { font-size: 13px; color: #5c5c54; margin-bottom: 24px; }
.login-back { text-align: center; margin-top: 18px; font-size: 12px; }
.login-back a { color: #5A9B1C; text-decoration: none; font-weight: 500; }
.login-back a:hover { text-decoration: underline; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 520px) {
  .city    { font-size: 48px; }
  .salud   { font-size: 40px; }
  .panel-bar { padding: 10px 14px; }
  .stats-bar { gap: 16px; }
  .tab-content { padding: 14px; }
  .envivo-text { font-size: 20px; }
  .u-table th, .u-table td { padding: 8px 10px; }
}
