/* Estilos de Prospector. Parten de la interfaz de Harvey (MIT, Ethan Rogers, 2026; ver NOTICE) con el sistema visual
   del rediseño: tarjetas redondeadas, acento índigo, botones y etiquetas en píldora y color solo para el estado.
   Los valores (colores, radios, sombras) viven en tokens.css; la estructura de la app, en menu.css. */

* { margin: 0; padding: 0; box-sizing: border-box; }
::selection { background: var(--brand-soft); color: var(--brand-soft-ink); }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans); background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.55; min-height: 100dvh; overflow-wrap: break-word; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

main { padding: 44px var(--gut) 72px; }
main:focus { outline: none; }
.section { display: none; max-width: var(--ancho); margin: 0 auto; }
#v-prospectos { max-width: var(--ancho-lista); }
.section.active { display: block; animation: rise .22s cubic-bezier(.16,1,.3,1); }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ── Títulos ─────────────────────────────────────────────────── */

.section-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; align-items: end; margin-bottom: 28px; }
.section-head > * { grid-column: 1; }
.section-head > .btn-group { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
.section-head h2 { font-size: 32px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.section-head p { font-size: 15px; color: var(--muted); margin-top: 8px; max-width: 560px; text-wrap: pretty; }
.subhead { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 32px 0 12px; }

/* ── Hoy ─────────────────────────────────────────────────────── */

.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.today-rail { position: sticky; top: 22px; }
.rail-block, .figures { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px 18px; box-shadow: var(--shadow-sm); }
.rail-block .figures { background: none; border: 0; border-radius: 0; padding: 0; box-shadow: none; }
.figures { padding: 6px 22px; }
.rail-block > .subhead { margin-top: 0; }
@media (max-width: 900px) { .today-grid { grid-template-columns: 1fr; gap: 26px; } .today-rail { position: static; order: -1; } }

.subhead + .queue { margin-top: 0; }
.queue-item {
  display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm);
}
.queue-item::before { content: ''; width: 9px; height: 9px; flex: none; margin-top: 7px; border-radius: 50%; background: var(--muted); }
.queue-item.warn::before { background: var(--am); }
.queue-item.good::before { background: var(--em); }
.queue-item .qtext { flex: 1; min-width: 0; }
.queue-item .qtitle { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.queue-item .qdetail { font-size: 13px; color: var(--muted); margin-top: 4px; max-width: 68ch; text-wrap: pretty;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.queue-clear { display: flex; align-items: flex-start; gap: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 22px; }
.queue-clear .glyph { color: var(--em); font-size: 17px; line-height: 1.4; }
.queue-clear .qtitle { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.queue-clear .qdetail { font-size: 13px; color: var(--muted); margin-top: 3px; max-width: 60ch; }

/* Bloques de Hoy (respuestas, oportunidades, prospectos): filas compactas de una línea de título, con el detalle en gris */
.today-main > .hoy-bloque:first-child > .subhead { margin-top: 0; }
.filas-hoy { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.fila-hoy {
  --nivel-bg: var(--soft); --nivel-txt: var(--muted);
  display: flex; align-items: center; gap: 12px; min-height: 56px; max-height: 72px; padding: 8px 14px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm);
}
.fila-hoy.fila-buena { border-left: 3px solid var(--em); }
.fila-hoy .p-puntaje { width: 44px; height: 44px; border-radius: 14px; }
.fila-hoy .pt-num { font-size: 17px; }
.fila-hoy .pt-niv { font-size: 8px; }
.fila-texto { flex: 1; min-width: 0; }
.fila-titulo { font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila-detalle { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 2px; font-size: 13px; color: var(--muted); }
.fila-detalle .fd-texto { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila-detalle .tag { flex: none; min-height: 22px; padding: 1px 9px; font-size: 11.5px; white-space: nowrap; }
.fila-hoy > .btn { flex: none; }
.enlace-hoy {
  display: inline-flex; align-items: center; min-height: 36px; margin-top: 4px; padding: 0 2px; background: none; border: 0;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; color: var(--brand); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
@media (pointer: coarse) { .enlace-hoy { min-height: 44px; } }
.aviso-perfil {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-bottom: 16px; padding: 10px 16px;
  background: var(--am-bg); color: var(--am); border-radius: var(--r-md); font-size: 13.5px; font-weight: 550;
}
.aviso-perfil .enlace-hoy { margin-top: 0; color: inherit; }
@media (max-width: 480px) {
  .fila-hoy { gap: 10px; padding: 8px 10px; }
  .fila-detalle .tag + .tag { display: none; }  /* en celular, una sola etiqueta por fila: nada se sale del ancho */
}

.figure { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.figure:last-child { border-bottom: none; }
.figure .k { font-size: 13px; color: var(--muted); }
.figure .v { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.figure .v.zero { color: var(--muted); font-weight: 500; }
.figure-note { font-size: 12px; color: var(--muted); margin-top: 10px; }
progress.progreso { display: block; width: 100%; height: 6px; margin-bottom: 14px; appearance: none; border: none; background: var(--soft); border-radius: var(--r-pill); overflow: hidden; }
progress.progreso::-webkit-progress-bar { background: var(--soft); }
progress.progreso::-webkit-progress-value { background: var(--brand); border-radius: var(--r-pill); }
progress.progreso::-moz-progress-bar { background: var(--brand); border-radius: var(--r-pill); }

/* ── Paneles, formularios y botones ──────────────────────────── */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 24px; margin-bottom: 20px; }
.card h2 { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 14px; }
.card .lede { font-size: 14px; color: var(--muted); margin: -4px 0 18px; max-width: 66ch; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 18px;
  font-family: var(--sans); font-size: 14px; font-weight: 600; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; text-align: center; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn:hover:not(:disabled) { background: var(--soft); }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand); opacity: .9; }
.btn-secondary { background: var(--surface); }
.btn-danger { background: transparent; border-color: transparent; color: var(--ro); }
.btn-danger:hover:not(:disabled) { background: var(--ro-bg); }
.btn-confirm { background: var(--em-bg); border-color: transparent; color: var(--em); }
.btn-confirm:hover:not(:disabled) { background: var(--em-bg); opacity: .85; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-ancho { width: 100%; }
.btn-group { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
@media (pointer: coarse) { .btn, .btn-sm { height: 44px; } }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.form-input {
  width: 100%; min-height: 46px; padding: 11px 14px; font-family: var(--sans); font-size: 16px; line-height: 1.5;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  transition: border-color .15s, box-shadow .15s;
}
textarea.form-input { resize: vertical; }
.form-input:hover { border-color: var(--muted); }
.form-input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px var(--ring); }
.form-input::placeholder { color: var(--muted); }
.form-input.corto { max-width: 140px; }
.form-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 150px; }
fieldset.form-group { border: 0; padding: 0; min-width: 0; }
.paises { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; }
.pais { display: flex; align-items: center; gap: 9px; min-height: 38px; font-size: 14px; cursor: pointer; }
.pais input { width: 18px; height: 18px; accent-color: var(--brand); }
@media (pointer: coarse), (max-width: 720px) { .pais { min-height: 44px; } }
.nota { font-size: 12.5px; color: var(--muted); margin-top: 7px; max-width: 66ch; }
.test-result { font-size: 14px; margin-top: 14px; padding: 11px 16px; border-radius: var(--r-md); border: 1px solid transparent; }
#c-gmail-estado { margin: 0 0 16px; }
.test-result.success { background: var(--em-bg); color: var(--em); }
.test-result.error { background: var(--ro-bg); color: var(--ro); }
.test-result.pending { background: var(--soft); color: var(--muted); border-color: var(--line); }

/* ── Filtros y mensajes editables (Prospectos, Emails) ─────────── */

.filtros { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; }
.filtro {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-pill); color: var(--muted); font-family: var(--sans); font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: color .15s, background .15s;
}
.filtro:hover { color: var(--ink); background: var(--soft); }
.filtro[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
@media (pointer: coarse) { .filtro { height: 44px; } }
.filtros + .filtros-etapa { margin-top: -12px; }  /* segunda fila de filtros (Prospectos): pegada a la primera */
.filtro-n { font-variant-numeric: tabular-nums; font-weight: 500; opacity: .75; }

textarea.mensaje { min-height: 84px; line-height: 1.55; font-size: 14px; overflow: hidden; resize: none; }
textarea.mensaje.alto { min-height: 170px; }

/* ── Etiquetas y estados: lo único con color ─────────────────── */

.badge, .tag {
  display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500; line-height: 1.2; white-space: nowrap; flex: none;
}
.tag { height: auto; min-height: 26px; padding-top: 3px; padding-bottom: 3px; white-space: normal; overflow-wrap: anywhere; }
.badge.t-waiting, .tg-wait { background: var(--am-bg); color: var(--am); }
.badge.t-active, .tg-active { background: var(--sky-bg); color: var(--sky); }
.badge.t-good, .tg-good { background: var(--em-bg); color: var(--em); }
.badge.t-bad, .tg-hot { background: var(--ro-bg); color: var(--ro); }
.badge.t-idle, .tg-idle { background: var(--soft); color: var(--muted); }
.badge.t-note, .tg-note { background: var(--vi-bg); color: var(--vi); }
.tg-hot { font-weight: 600; }

/* ── Vacíos (Emails, Ayuda y Admin viven en vistas.css) ─────── */

.empty { text-align: center; padding: 44px 24px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
.empty .glyph { font-size: 20px; color: var(--muted); margin-bottom: 12px; }
.empty .title { font-size: 18px; font-weight: 650; letter-spacing: -0.02em; margin-bottom: 6px; }
.empty .copy { font-size: 14px; color: var(--muted); line-height: 1.65; max-width: 46ch; margin: 0 auto; text-wrap: pretty; }
.empty .copy b { color: var(--ink); font-weight: 650; }

/* ── Ingreso ─────────────────────────────────────────────────── */

.ingreso { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.ingreso-card { width: 100%; max-width: 440px; padding: 32px; margin: 0; box-shadow: var(--shadow-md); }
.ingreso-card .brand { margin-bottom: 28px; }
.ingreso-paso h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.025em; margin-bottom: 8px; }
.ingreso-paso .btn + .btn { margin-top: 10px; }
.ingreso-paso .ingreso-nota { margin: 14px 0 6px; }
.btn-enlace { display: block; margin: 6px auto 0; padding: 6px 4px; background: none; border: 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn-enlace:hover { color: var(--muted); }
.btn-enlace:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.codigo-input { font-family: var(--mono); font-size: 26px; letter-spacing: 0.35em; text-align: center; min-height: 58px; }

/* ── Avisos ──────────────────────────────────────────────────── */

.avisos { position: fixed; bottom: 22px; right: 22px; z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { padding: 13px 20px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; box-shadow: var(--shadow); animation: toast-in .25s cubic-bezier(.16,1,.3,1); max-width: 380px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.success { background: var(--ink); color: var(--bg); }
.toast.error { background: var(--ro); color: var(--on-ro); }

details summary { cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: '+ '; font-family: var(--mono); color: var(--muted); margin-right: 6px; }
details[open] summary::before { content: '– '; }

/* ── Tablet y celular (tarjetas en tarjetas.css; Emails, Ayuda y Admin en vistas.css) ────────── */

@media (max-width: 720px) {
  :root { --gut: 16px; }
  main { padding-top: 24px; padding-bottom: 48px; }
  .section-head { grid-template-columns: minmax(0, 1fr); margin-bottom: 20px; row-gap: 16px; }
  .section-head > .btn-group { grid-column: 1; grid-row: auto; }
  .section-head > .btn-group .btn { width: 100%; }
  .section-head h2 { font-size: 26px; }
  .btn, .btn-sm { height: 44px; }
  .filtros .filtro { flex: 1 1 auto; justify-content: center; height: 44px; padding: 0 12px; }
  .card { padding: 18px; border-radius: 18px; }
  .rail-block { padding: 18px; }
  .queue-item { flex-wrap: wrap; }
  .queue-item .btn { width: 100%; margin-left: 23px; }
  .avisos { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
  .toast { max-width: none; border-radius: var(--r-md); }
  .form-input.corto { max-width: none; }
  .ingreso-card { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
