/* Vistas Emails, Ayuda y Admin, y los ajustes de formularios de Buscar y Configuración. Mismo sistema que el resto
   (tokens.css): superficies blancas con borde y radio de tarjeta, rótulos en mayúsculas y color solo para el estado.
   Lo compartido (botones, campos, etiquetas, vacíos) vive en app.css. */

/* ── Buscar y Configuración: casillas ────────────────────────── */

.paises > .pais:only-child { grid-column: 1 / -1; }          /* una casilla sola (Avisos por email) no se parte en dos líneas */

/* ── Emails ──────────────────────────────────────────────────── */

.interruptor { display: flex; align-items: center; gap: 14px; min-height: 46px; margin-bottom: 20px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); background: var(--surface); cursor: pointer; font-size: 14px; }
.interruptor input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.interruptor .pista { flex: none; width: 46px; height: 26px; border-radius: var(--r-pill); background: var(--line-strong); position: relative; transition: background .15s; }
.interruptor .pista::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--on-brand); box-shadow: var(--shadow-sm); transition: transform .15s, background .15s; }
.interruptor input:checked + .pista { background: var(--ro); }
.interruptor input:checked + .pista::after { background: var(--on-ro); transform: translateX(20px); }   /* sobre el rojo: legible en los dos temas */
.interruptor input:focus-visible + .pista { outline: 2px solid var(--focus); outline-offset: 2px; }
.interruptor .texto { font-size: 14px; line-height: 1.4; }
.interruptor .texto .muted { font-size: 12.5px; }

.mail-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 20px 24px; margin-bottom: 14px; }
.mail-cabeza { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mail-para { font-size: 13px; font-family: var(--mono); color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.mail-negocio { min-width: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; overflow-wrap: anywhere; }   /* el negocio que respondió */
.mail-asunto { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; margin: 8px 0 4px; overflow-wrap: anywhere; }
.mail-cuerpo { font-size: 14px; color: var(--muted); white-space: pre-wrap; line-height: 1.65; overflow-wrap: anywhere; }
.mail-fecha { font-size: 12px; margin-top: 8px; }
.mail-item > .form-label { margin: 16px 0 7px; }              /* edición: asunto y mensaje */
.mail-item .test-result { margin-top: 12px; }
.burbuja { margin-top: 10px; padding: 12px 16px; border-radius: 18px; font-size: 14px; line-height: 1.65; white-space: pre-wrap; max-width: 92%; overflow-wrap: anywhere; }
.burbuja.recibido { background: var(--soft); border-bottom-left-radius: 6px; }
.burbuja.enviado { background: var(--brand-soft); color: var(--brand-soft-ink); margin-left: auto; border-bottom-right-radius: 6px; }
.burbuja.aparte { background: var(--am-bg); color: var(--am); }
.quien-habla { font-family: var(--mono); font-size: 11px; font-weight: 500; margin-bottom: 4px; }   /* sin opacidad: bajaba el contraste */

/* ── Ayuda ───────────────────────────────────────────────────── */

.help-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 24px 28px; margin-bottom: 16px; }
.help-section h2 { font-size: 18px; font-weight: 650; letter-spacing: -0.015em; margin-bottom: 10px; }
.help-section p { font-size: 15px; color: var(--muted); line-height: 1.7; margin-bottom: 9px; max-width: 70ch; }
.help-section > :last-child { margin-bottom: 0; }
ol.pasos { list-style: none; counter-reset: paso; margin: 12px 0; max-width: 70ch; }
ol.pasos li { counter-increment: paso; position: relative; padding: 14px 0 14px 44px; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--muted); line-height: 1.6; }
ol.pasos li:last-child { border-bottom: none; }
ol.pasos li::before { content: counter(paso); position: absolute; left: 0; top: 13px; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--brand-soft-ink); }
ol.pasos b { color: var(--ink); font-weight: 650; }

/* ── Admin: tablas ───────────────────────────────────────────── */

.table-card { border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow-x: auto;
  /* Sombras en los bordes que indican que hay más para deslizar: las de `local` tapan a las fijas cuando ya no hay más. */
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) 0 0 / 40px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) 100% 0 / 40px 100% no-repeat local,
    linear-gradient(to right, var(--line-strong), transparent) 0 0 / 12px 100% no-repeat scroll,
    linear-gradient(to left, var(--line-strong), transparent) 100% 0 / 12px 100% no-repeat scroll,
    var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tabla-ancha { min-width: 520px; }                       /* siete columnas: en celular se desliza dentro de la tarjeta */
th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--soft); }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: none; }
th.num, td.num { text-align: right; white-space: nowrap; }
.ef-controles { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.ef-controles .form-input { width: auto; min-width: 180px; }
.ef-controles .form-label { margin: 0; }
.ef-pocos { color: var(--muted); }
.table-card + p { margin-top: 12px; font-size: 13px; }

/* ── Celular ─────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .form-row .form-group:has(> .btn-ancho) { flex: 1 1 100%; }   /* «Buscar» ocupa la fila y no queda justo */
  .help-section { padding: 18px; border-radius: 18px; }
  .mail-item { padding: 16px 18px; }
  .burbuja { max-width: 100%; }
  th, td { padding: 10px 12px; }
}
