/* RetoVenta · by 7soft.app — estilos.
   Un solo CSS para celular y computadora: < 900px pestañas arriba y una
   columna; >= 900px menú lateral y columnas/tablas. */

:root {
  color-scheme: light;
  --azul: #1463ff;
  --azul-osc: #0b4fd6;
  --azul-claro: #eaf1ff;
  --navy: #0d2350;
  --texto: #1f2a44;
  --muted: #6b7a99;
  --bg: #f4f7fc;
  --card: #fff;
  --borde: #e3e9f3;
  --teal: #12a37f;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(13, 35, 80, .05), 0 4px 14px rgba(13, 35, 80, .05);

  --verde: #16a34a;   --verde-bg: #e8f7ee;
  --amarillo: #a16207; --amarillo-bg: #fdf3d4;
  --naranja: #ea580c; --naranja-bg: #fff0e6;
  --rojo: #dc2626;    --rojo-bg: #fdecec;
  --morado: #7c3aed;  --morado-bg: #f1ebff;
  --gris: #475569;    --gris-bg: #eef1f5;
  --azul-t: #1463ff;  --azul-bg: #e6efff;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--texto);
  font: 15px/1.45 "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--azul); text-decoration: none; }
h1, h2, h3 { color: var(--navy); margin: 0; line-height: 1.2; }
p { margin: 0; }
input, select, textarea, button { font: inherit; color: inherit; }
.ic { width: 20px; height: 20px; flex: none; }
.ic.sm { width: 16px; height: 16px; }
.muted { color: var(--muted); }
i { color: var(--rojo); font-style: normal; }

/* ---------- Estructura ---------- */
.shell {
  display: grid; min-height: 100vh;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "logo top" "nav nav" "main main";
  grid-template-rows: auto auto 1fr;
}
/* Logo de RetoVenta: ícono + "Reto" (navy) "Venta" (azul) + "by 7soft.app" pequeño debajo. */
.logo { grid-area: logo; display: flex; align-items: center; gap: 11px; padding: 14px 16px; background: var(--card); min-width: 0; }
.logo-img { width: 38px; height: 38px; border-radius: 10px; flex: none; }
.logo-txt { font-family: "Instrument Sans", "Figtree", system-ui, sans-serif; font-weight: 700; font-size: 22px; line-height: 1.05; letter-spacing: -.02em; color: var(--navy); white-space: nowrap; }
.logo-txt span { color: var(--azul); }
.logo-txt small { display: block; font-family: "Figtree", system-ui, sans-serif; font-weight: 500; font-size: 11.5px; letter-spacing: .01em; color: var(--muted); }
.topbar { grid-area: top; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 16px; background: var(--card); }
.content { grid-area: main; padding: 16px; width: 100%; max-width: 1280px; min-width: 0; }

/* Usuario conectado (informativo). */
.usuario { display: flex; align-items: center; gap: 10px; min-width: 0; }
.usuario-txt { min-width: 0; line-height: 1.2; }
.usuario-txt b { display: block; color: var(--navy); font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.usuario-txt small { display: block; color: var(--muted); font-size: 12.5px; }
.btn-admin-movil.activo { background: var(--azul-claro); color: var(--azul); border-color: #b9cffb; }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--azul-claro); color: var(--azul-osc); display: grid; place-items: center; font-weight: 700; }

/* Menú: pestañas en celular */
.nav { grid-area: nav; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 0 10px 10px; background: var(--card); border-bottom: 1px solid var(--borde); position: sticky; top: 0; z-index: 20; }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px 8px; border: 1px solid var(--borde); border-radius: 12px; color: var(--navy); font-size: 12.5px; text-align: center; background: var(--card); }
.nav-item .ic { width: 26px; height: 26px; }
.nav-item.activo { background: var(--azul-claro); border-color: #b9cffb; color: var(--azul); font-weight: 600; }
.nav-indicador:not(.activo) { color: #9aa6bf; cursor: default; }
.nav-admin { display: none; }

@media (min-width: 900px) {
  /* Computadora: barra lateral fija (logo arriba, menú, usuario + Salir abajo) y
     el contenido usa todo el ancho y alto restante, sin franja superior. */
  .shell { display: block; }
  .logo, .nav, .topbar { position: fixed; left: 0; width: 240px; background: var(--card); border-right: 1px solid var(--borde); z-index: 20; }
  .logo { top: 0; height: 72px; padding: 0 24px; }
  .nav { top: 72px; bottom: 112px; display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 12px; border-bottom: 0; overflow-y: auto; }
  .topbar { bottom: 0; height: 112px; flex-direction: column; align-items: stretch; justify-content: center; gap: 8px; padding: 12px; border-top: 1px solid var(--borde); }
  .topbar .usuario { padding: 0 4px; }
  .topbar .btn-admin-movil { display: none; }
  .topbar .btn-salir { width: 100%; justify-content: flex-start; padding: 9px 12px; }
  .content { margin-left: 240px; width: auto; }
  .nav-item { flex-direction: row; gap: 12px; border: 0; border-radius: 10px; padding: 11px 14px; font-size: 15px; text-align: left; position: relative; }
  .nav-item .ic { width: 20px; height: 20px; }
  .nav-item.activo::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--azul); }
  .nav-admin { display: flex; margin-top: auto; }
  .content { padding: 26px 32px 40px; }
}
@media (max-width: 380px) {
  .nav-item { font-size: 11px; }

}
@media (max-width: 520px) {
  .btn-salir span, .usuario-txt { display: none; }
}

/* ---------- Piezas comunes ---------- */
.card { background: var(--card); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); }
.flash { padding: 11px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 500; }
.flash-ok { background: var(--verde-bg); color: #166534; }
.flash-error { background: var(--rojo-bg); color: #991b1b; }
.vacio { padding: 18px; color: var(--muted); text-align: center; }
.ayuda { color: var(--muted); font-size: 13.5px; margin: 0 0 12px; }
.link { font-weight: 500; font-size: 14px; }
.link:hover { text-decoration: underline; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; cursor: pointer; background: none; white-space: nowrap; }
.btn-primario { background: var(--azul); color: #fff; }
.btn-primario:hover { background: var(--azul-osc); }
.btn-secundario { background: var(--azul-claro); color: var(--azul-osc); border-color: #c6d8fb; }
.btn-ghost { border-color: var(--borde); color: var(--navy); background: var(--card); }
.btn-verde { background: var(--verde); color: #fff; }
.btn-peligro { background: #fff5f5; color: var(--rojo); border-color: #f5c2c2; }
.btn-sm { padding: 7px 12px; font-size: 14px; }
.btn-grande { width: 100%; padding: 14px; font-size: 16px; }
.deshabilitado { opacity: .45; pointer-events: none; }
.btn-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--borde); background: var(--card); color: var(--navy); flex: none; }

.chip { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip-verde, .tinte-verde { background: var(--verde-bg); color: var(--verde); --t: var(--verde); }
.chip-amarillo, .tinte-amarillo { background: var(--amarillo-bg); color: var(--amarillo); --t: var(--amarillo); }
.chip-naranja, .tinte-naranja { background: var(--naranja-bg); color: var(--naranja); --t: var(--naranja); }
.chip-rojo, .tinte-rojo { background: var(--rojo-bg); color: var(--rojo); --t: var(--rojo); }
.chip-morado, .tinte-morado { background: var(--morado-bg); color: var(--morado); --t: var(--morado); }
.chip-gris, .tinte-gris { background: var(--gris-bg); color: var(--gris); }
.chip-azul, .tinte-azul { background: var(--azul-bg); color: var(--azul-t); --t: var(--azul-t); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.page-head-titulo { display: flex; align-items: center; gap: 14px; }
.page-head-ic { color: var(--azul); }
.page-head-ic .ic { width: 36px; height: 36px; }
.page-head h1 { font-size: 28px; color: var(--azul); }
.page-head p { color: var(--muted); margin-top: 2px; }
@media (min-width: 900px) {
  .page-head-ic { display: none; }
  .page-head h1 { color: var(--navy); }
}
.volver { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); padding: 6px 0; margin-bottom: 8px; }
.volver .ic { width: 34px; height: 34px; padding: 7px; border-radius: 50%; background: var(--card); border: 1px solid var(--borde); }

.barra { position: relative; height: 26px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.barra > span { display: flex; align-items: center; justify-content: center; height: 100%; min-width: 0; border-radius: 999px; color: #fff; font-size: 13px; font-weight: 700; transition: width .4s; }
.barra-fina { height: 10px; }
.barra-azul > span { background: var(--azul); }
.barra-naranja > span { background: #f97316; }
.barra-verde > span { background: var(--verde); }
.barra-amarillo > span { background: #f5b301; }
.barra-rojo > span { background: #ef4444; }

/* ---------- Inicio ---------- */
.saludo { display: none; margin-bottom: 16px; }
.saludo h1 { font-size: 28px; }
.saludo p { color: var(--muted); }
@media (min-width: 900px) { .saludo { display: block; } }

.reto-card { display: flex; gap: 16px; align-items: center; padding: 16px 18px; background: linear-gradient(135deg, #f5f9ff, #eaf2ff); margin-bottom: 14px; }
.reto-ic { color: var(--azul); }
.reto-ic .ic { width: 48px; height: 48px; }
.reto-body { flex: 1; min-width: 0; }
.reto-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.reto-top h2 { color: var(--azul); font-size: 22px; }
.reto-dia { font-weight: 600; color: var(--navy); white-space: nowrap; }
.reto-fechas { display: block; margin-top: 6px; color: var(--muted); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.stat { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; padding: 14px; align-items: start; }
.stat .barra { grid-column: 1 / -1; margin-top: 4px; }
.stat-ic .ic { width: 38px; height: 38px; }
.stat h3 { font-size: 17px; }
.stat-num { font-size: 34px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.stat-num small { font-size: 17px; font-weight: 600; color: var(--navy); }
.stat-nota { font-size: 12.5px; color: var(--muted); }
.stat-naranja { background: #fff8f2; border-color: #fde2cc; } .stat-naranja .stat-ic, .stat-naranja h3 { color: #f97316; }
.stat-verde { background: #f3fbf6; border-color: #cdeedb; } .stat-verde .stat-ic, .stat-verde h3 { color: var(--verde); }
.stat-azul { background: #f5f9ff; } .stat-azul .stat-ic, .stat-azul h3 { color: var(--azul); }
.stat-morado { background: #f9f6ff; } .stat-morado .stat-ic, .stat-morado h3 { color: var(--morado); }
@media (max-width: 420px) {
  .stat { grid-template-columns: 1fr; }
  .stat-ic .ic { width: 28px; height: 28px; }
  .stat-num { font-size: 28px; }
}
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }

.racha { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--borde); color: var(--muted); margin-bottom: 14px; font-size: 14px; }
.racha-on { background: var(--verde-bg); border-color: #c9ebd6; color: #166534; }
.racha-on .ic { color: var(--verde); }

.inicio-cols { display: grid; gap: 14px; }
@media (min-width: 1100px) { .inicio-cols { grid-template-columns: 1.2fr 1fr 1fr; align-items: start; } }

.lista-card { overflow: hidden; }
.lista-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 16px; background: #f5f9ff; border-bottom: 1px solid var(--borde); }
.lista-head h2 { font-size: 19px; }

.act-row { display: grid; grid-template-columns: 58px 44px 1fr auto; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--borde); color: var(--texto); }
.act-row:last-child { border-bottom: 0; }
.act-row:hover { background: #fafcff; }
.act-hora { font-size: 18px; color: var(--navy); border-right: 1px solid var(--borde); padding-right: 8px; }
.act-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.act-txt { min-width: 0; }
.act-txt strong { display: block; color: var(--navy); }
.act-txt span { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-lugar { display: none; color: var(--muted); }
.act-cancelada { opacity: .55; }
.act-cancelada .act-txt strong { text-decoration: line-through; }
@media (min-width: 900px) {
  .agenda-dia .act-row { grid-template-columns: 64px 44px 1.6fr 1fr 130px; }
  .agenda-dia .act-lugar { display: block; }
  .act-row .chip { justify-self: end; }
}
@media (max-width: 420px) {
  .act-row { grid-template-columns: 48px 36px 1fr auto; gap: 8px; padding: 10px 12px; }
  .act-ic { width: 36px; height: 36px; }
  .act-hora { font-size: 15px; }
  .act-row .chip { padding: 4px 8px; font-size: 12px; }
}

.plegable summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; border-radius: var(--radio); }
.plegable summary::-webkit-details-marker { display: none; }
.plegable-titulo { display: flex; align-items: center; gap: 10px; flex: 1; font-size: 19px; font-weight: 700; }
.plegable-num { font-size: 22px; font-weight: 800; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; }
.plegable-flecha { transition: transform .2s; }
.plegable[open] .plegable-flecha { transform: rotate(180deg); }
.plegable[open] summary { border-radius: var(--radio) var(--radio) 0 0; }
.plegable-rojo summary { background: #fdf1f1; color: #b91c1c; }
.plegable-rojo .plegable-num { background: var(--rojo-bg); color: var(--rojo); }
.plegable-amarillo summary { background: #fdf8e8; color: #92400e; }
.plegable-amarillo .plegable-num { background: var(--amarillo-bg); color: var(--amarillo); }
.mini-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px 16px; border-top: 1px solid var(--borde); color: var(--texto); }
.mini-row:hover { background: #fafcff; }
.mini-dia { padding: 10px 16px 4px; font-weight: 700; color: var(--navy); font-size: 14px; border-top: 1px solid var(--borde); }

/* ---------- Prospectos ---------- */
.filtros { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.buscar { flex: 1 1 260px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--card); border: 1px solid var(--borde); border-radius: 12px; color: var(--muted); }
.buscar input { border: 0; outline: 0; background: none; padding: 12px 0; width: 100%; color: var(--texto); }
.filtros select, .closer-filtro select { padding: 11px 12px; border: 1px solid var(--borde); border-radius: 12px; background: var(--card); flex: 1 1 150px; }

.estado-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: thin; }
.estado-chip { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 14px; border-radius: 10px; font-size: 13.5px; border: 1px solid transparent; color: var(--texto) !important; }
.estado-chip b { font-weight: 600; }
.estado-chip.activo { border-color: currentColor; box-shadow: inset 0 0 0 1px rgba(20, 99, 255, .5); }

.tp-head { display: none; }
.tp-row { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 16px; border-bottom: 1px solid var(--borde); cursor: pointer; }
.tp-row:last-child { border-bottom: 0; }
.tp-row:hover { background: #fafcff; }
.tp-nombre { font-size: 18px; font-weight: 600; color: var(--navy); }
.tp-nombre small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.tp-tipo { display: none; }
.tp-tel { grid-column: 1; }
.tp-tel a { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; position: relative; z-index: 2; }
.tp-estado { grid-column: 2; grid-row: 1; justify-self: end; }
.tp-ultimo, .tp-prox { grid-column: 1 / -1; font-size: 14px; color: var(--texto); }
.tp-ultimo em, .tp-prox em { font-style: normal; color: var(--muted); }
@media (min-width: 900px) {
  .tp-head, .tp-row { grid-template-columns: 2fr .8fr 1.3fr 1.3fr 1fr 1.3fr; align-items: center; }
  .tp-head { display: grid; gap: 12px; padding: 12px 16px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--borde); background: #fafcff; border-radius: var(--radio) var(--radio) 0 0; }
  .tp-row { padding: 10px 16px; }
  .tp-nombre { font-size: 15.5px; }
  .tp-tipo { display: block; color: var(--muted); }
  .tp-tel, .tp-estado, .tp-ultimo, .tp-prox { grid-column: auto; grid-row: auto; justify-self: start; }
  .tp-tel a { font-size: 15px; }
  .tp-ultimo em, .tp-prox em { display: none; }
}

.paginacion { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; }
.paginacion small { color: var(--muted); }

/* ---------- Formularios ---------- */
.form-bloques { display: grid; gap: 12px; }
.bloque { background: #f5f9ff; border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px; }
.bloque-verde { background: #f3fbf5; border-color: #d3eedc; }
.bloque-titulo { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 10px; }
.bloque-titulo .ic { color: var(--navy); }
.bloque-titulo small { font-weight: 400; color: var(--muted); font-size: 15px; }
.bloque-titulo-fila { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bloque-sub { color: var(--muted); font-size: 13.5px; margin: -6px 0 10px; }
.bloque > input, .bloque > textarea, .campo input, .campo select, .campo textarea, .fila-valor input, .fila-valor select, .fila-valor textarea, .nota-form textarea, .fila-admin input, .fila-admin select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--borde); border-radius: 10px; background: var(--card); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--azul) !important; box-shadow: 0 0 0 3px rgba(20, 99, 255, .12); }
textarea { resize: vertical; }
.campos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.campo { display: grid; gap: 6px; min-width: 0; }
.campo > span, .campo-label { font-weight: 600; color: var(--navy); font-size: 14.5px; }
.campo-ancho { grid-column: 1 / -1; }
@media (max-width: 480px) { .campos { grid-template-columns: 1fr; } }

.opciones-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opcion-grande, .pick, .resultado, .tipo-act { position: relative; }
.opcion-grande input, .pick input, .resultado input, .tipo-act input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.opcion-grande span { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--borde); border-radius: 12px; background: var(--card); cursor: pointer; }
.opcion-grande .ic { grid-row: 1 / 3; width: 30px; height: 30px; color: var(--azul); }
.opcion-grande small { color: var(--muted); }
.opcion-grande input:checked + span { border-color: var(--azul); background: var(--azul-claro); box-shadow: inset 0 0 0 1px var(--azul); }
.opcion-grande input:focus-visible + span, .pick input:focus-visible + span, .resultado input:focus-visible + span, .tipo-act input:focus-visible + span { outline: 2px solid var(--azul); outline-offset: 2px; }
.form-bloques[data-tipo="persona"] .solo-empresa, .form-bloques[data-tipo="empresa"] .solo-persona { display: none; }

.productos-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick span { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--borde); background: var(--card); cursor: pointer; font-size: 14px; user-select: none; }
.pick input:checked + span { background: var(--azul-bg); border-color: #b9cffb; color: var(--azul-osc); font-weight: 600; }
.pick input:checked + span::after { content: " ✓"; }
.acciones-form { display: grid; gap: 10px; }

/* ---------- Ficha ---------- */
.barra-volver { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.prev-next { display: flex; gap: 8px; }
.ficha-head { display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center; margin: 8px 0 14px; }
.ficha-avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--azul-claro); color: var(--azul); display: grid; place-items: center; }
.ficha-avatar .ic { width: 30px; height: 30px; }
.ficha-nombre h1 { font-size: 26px; }
.ficha-sub { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; font-size: 13px; }
.ficha-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.ficha-meta dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: 14px; }
.ficha-meta dt { color: var(--muted); }
.ficha-meta dd { margin: 0; }
.estado-select { position: relative; display: inline-flex; align-items: center; border-radius: 999px; padding: 0 12px 0 0; }
.estado-select select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: inherit; font-weight: 700; padding: 8px 6px 8px 16px; cursor: pointer; outline: none; }
.estado-select select option { color: var(--texto); }
@media (min-width: 900px) {
  .ficha-head { grid-template-columns: auto 1fr auto; }
  .ficha-meta { grid-column: auto; flex-direction: column; align-items: flex-end; }
}

.tabs { display: flex; border-bottom: 1px solid var(--borde); margin-bottom: 14px; overflow-x: auto; }
.tab { flex: 1; text-align: center; padding: 11px 14px; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tab.activo { color: var(--azul); border-bottom-color: var(--azul); font-weight: 600; }
@media (min-width: 900px) { .tab { flex: none; } }
@media (max-width: 480px) { .tab { padding: 10px 4px; font-size: 14px; } .fila-dato { grid-template-columns: 34% 1fr; gap: 6px; } .fila-label { font-size: 13.5px; } }

.ficha-cols { display: grid; gap: 12px; }
.ficha-lateral { display: grid; gap: 12px; align-content: start; }
@media (min-width: 1000px) { .ficha-cols { grid-template-columns: 1.15fr 1fr; align-items: start; } }

.tabla-datos { background: var(--card); border: 1px solid var(--borde); border-radius: 12px; padding: 4px 14px; }
.fila-dato { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid #eef2f8; }
.fila-dato:last-of-type { border-bottom: 0; }
.fila-label { color: var(--muted); font-size: 14.5px; }
.fila-valor { display: flex; align-items: center; gap: 6px; min-width: 0; }
.fila-valor .editable { border-color: transparent; background: transparent; padding: 7px 8px; }
.fila-valor .editable:hover { border-color: var(--borde); background: #fbfdff; }
.fila-valor select.editable { cursor: pointer; }
.fila-valor .editable.guardando { background: #fffbea; }
.fila-valor .editable.guardado { background: var(--verde-bg); transition: background .8s; }
.fila-valor .editable.error { border-color: var(--rojo); background: var(--rojo-bg); }
.accion-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--azul-bg); color: var(--azul); flex: none; }
.fila-productos { align-items: start; padding: 10px 0; }
.productos-inline { flex-wrap: wrap; }
.form-proxima { padding-bottom: 14px; }
.form-proxima .btn-grande { margin-top: 10px; }

.nota { background: var(--card); border: 1px solid var(--borde); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.nota small { display: block; color: var(--muted); margin-top: 6px; font-size: 12.5px; }
.nota-form { display: grid; gap: 8px; justify-items: end; margin-bottom: 10px; }
.historial { list-style: none; margin: 0; padding: 0; }
.historial li { padding: 10px 0 10px 18px; border-left: 2px solid #cbd8ef; position: relative; font-size: 14.5px; }
.historial li::before { content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--azul); }
.historial small { display: block; color: var(--muted); }

/* ---------- Agenda ---------- */
.agenda-controles { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.segmentado { display: inline-flex; background: var(--card); border: 1px solid var(--borde); border-radius: 10px; padding: 3px; }
.segmentado a { padding: 7px 16px; border-radius: 8px; color: var(--navy); }
.segmentado a.activo { background: var(--azul); color: #fff; }
.closer-filtro { display: flex; }
.fecha-nav { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; margin-bottom: 14px; }
.fecha-nav .btn-ic { width: 52px; height: 48px; }
.fecha-nav-hoy { display: flex; justify-content: center; align-items: center; gap: 10px; background: var(--azul-claro); border-radius: 10px; color: var(--navy); font-weight: 700; font-size: 17px; }
.agenda-dia { margin-bottom: 12px; }

/* ---------- Actividad ---------- */
.act-head { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; margin: 6px 0 14px; }
.act-head-ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; }
.act-head-ic .ic { width: 32px; height: 32px; }
.act-head-txt h1 { font-size: 26px; }
.act-head-txt p { font-size: 20px; color: var(--muted); }
@media (max-width: 480px) {
  .act-head { grid-template-columns: auto 1fr auto; }
  .act-head .chip { grid-column: 2; grid-row: 2; justify-self: start; }
  .act-head .btn-ic { grid-column: 3; grid-row: 1; }
  .act-head-ic { width: 52px; height: 52px; }
}
.act-datos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.dato-card { display: flex; gap: 10px; align-items: center; padding: 12px; background: var(--card); border: 1px solid var(--borde); border-radius: 12px; min-width: 0; }
.dato-card .ic { width: 26px; height: 26px; color: var(--navy); }
.dato-card small { display: block; color: var(--muted); }
.dato-card b { font-weight: 500; font-size: 16px; display: block; overflow-wrap: anywhere; }
@media (max-width: 480px) { .act-datos { grid-template-columns: 1fr 1fr; } .act-datos .dato-card:last-child { grid-column: 1 / -1; } }
.texto-caja { background: var(--card); border: 1px solid var(--borde); border-radius: 12px; padding: 12px 14px; }
.form-bloques + .bloque, .bloque + .bloque, .bloque + .form-bloques { margin-top: 12px; }

.resultados { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.resultado span { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; min-height: 60px; color: var(--texto); line-height: 1.2; }
.resultado span .ic { width: 26px; height: 26px; flex: none; }
.resultado.tinte-verde span .ic { color: var(--verde); } .resultado.tinte-azul span .ic { color: var(--azul); }
.resultado.tinte-morado span .ic { color: var(--morado); } .resultado.tinte-naranja span .ic { color: var(--naranja); }
.resultado.tinte-rojo span .ic { color: var(--rojo); }
.resultado { border-radius: 10px; }
.resultado input:checked + span { border-color: var(--t); box-shadow: inset 0 0 0 2px var(--t); font-weight: 700; }
@media (max-width: 560px) { .resultados { grid-template-columns: 1fr 1fr; } }

.venta-campos { display: none; gap: 10px; margin-top: 12px; padding: 12px; background: var(--card); border-radius: 12px; border: 1px dashed #9fd9b4; }
.venta-campos.visible, #form-realizada:has(input[value="Venta"]:checked) .venta-campos { display: grid; }
.venta-campos .ayuda { margin: 0; }

.reprogramar { display: none; margin-top: 12px; }
.reprogramar.abierto { display: block; }
.acciones-fila { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.acciones-act { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 8px; margin-top: 14px; }
.acciones-act .btn { padding: 14px 8px; min-width: 0; white-space: normal; text-align: center; }
@media (max-width: 420px) { .acciones-act .btn { font-size: 14px; gap: 4px; } }
.resultado-final { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.venta-resumen { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: var(--card); border-radius: 12px; border: 1px solid var(--borde); margin-bottom: 10px; }

/* Nueva actividad */
.buscador-prospecto { position: relative; }
.buscador-prospecto .buscar { border-radius: 10px; }
.buscador-resultados { position: absolute; left: 0; right: 0; top: 50px; z-index: 15; list-style: none; margin: 0; padding: 4px; background: var(--card); border: 1px solid var(--borde); border-radius: 12px; box-shadow: var(--sombra); max-height: 300px; overflow: auto; }
.buscador-resultados li { padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.buscador-resultados li:hover, .buscador-resultados li.activo { background: var(--azul-claro); }
.buscador-resultados small { display: block; color: var(--muted); }
.prospecto-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 12px; margin: 8px 0 0; padding: 10px 12px; background: #eef3fa; border-radius: 10px; font-size: 13.5px; }
.prospecto-info div { display: flex; gap: 6px; min-width: 0; }
.prospecto-info .ancho { grid-column: 1 / -1; }
.prospecto-info dt { color: var(--muted); }
.prospecto-info dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .prospecto-info { grid-template-columns: 1fr 1fr; } }
.tipos-act { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.tipo-act span { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; background: var(--card); border: 1px solid var(--borde); border-radius: 12px; cursor: pointer; text-align: center; font-size: 14px; }
.tipo-act span .ic { width: 26px; height: 26px; color: var(--navy); }
.tipo-act input:checked + span { background: var(--azul-claro); border-color: var(--azul); color: var(--azul); font-weight: 600; }
.tipo-act input:checked + span .ic { color: var(--azul); }

/* ---------- Mi Equipo ---------- */
.reto-pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px; background: var(--azul-claro); border: 1px solid #c6d8fb; color: var(--azul-osc); }
.reto-pill b { display: block; }
.reto-pill small { display: block; font-size: 12px; }
.ranking { overflow: hidden; margin-bottom: 14px; }
.rk-head { display: none; }
.rk-row { display: grid; grid-template-columns: 44px 1fr auto; grid-template-areas: "pos nombre valor" "pos avance avance" "pos visitas ventas"; gap: 6px 12px; padding: 12px 14px; border-bottom: 1px solid var(--borde); align-items: center; }
.rk-row:last-child { border-bottom: 0; }
.rk-yo { background: #f5f9ff; }
.rk-ganador { background: #fffbea; }
.rk-pos { grid-area: pos; align-self: center; }
.rk-nombre { grid-area: nombre; font-weight: 600; color: var(--navy); font-size: 16px; }
.rk-nombre small { font-weight: 400; color: var(--azul); }
.rk-meta-ok { display: flex !important; align-items: center; gap: 4px; color: var(--amarillo) !important; font-size: 12px; }
.rk-meta-ok .ic { width: 14px; height: 14px; }
.rk-avance { grid-area: avance; }
.barra-rk { display: block; height: 14px; }
.barra-rk > span { display: block; min-width: 0; }
.rk-dato { font-size: 14.5px; }
.rk-dato:nth-of-type(4) { grid-area: visitas; }
.rk-dato:nth-of-type(5) { grid-area: ventas; justify-self: end; }
.rk-dato em { font-style: normal; color: var(--muted); margin-right: 6px; font-size: 12.5px; }
.rk-valor { grid-area: valor; font-weight: 800; font-size: 19px; color: var(--navy); }
.rk-num { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--gris-bg); font-weight: 700; color: var(--navy); }
.medalla { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; font-weight: 800; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15); }
.medalla::after { content: ""; position: absolute; bottom: -9px; left: 50%; width: 18px; height: 12px; transform: translateX(-50%); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 65%, 0 100%); z-index: -1; }
.medalla-1 { background: linear-gradient(#fcd34d, #f59e0b); } .medalla-1::after { background: #dc2626; }
.medalla-2 { background: linear-gradient(#e5e7eb, #9ca3af); } .medalla-2::after { background: #6d28d9; }
.medalla-3 { background: linear-gradient(#fdba74, #c2410c); } .medalla-3::after { background: #15803d; }
@media (min-width: 900px) {
  .rk-head, .rk-row { grid-template-columns: 56px 1.3fr 1.6fr 1fr 1fr 1fr; grid-template-areas: none; }
  .rk-head { display: grid; gap: 12px; padding: 12px 14px; font-size: 12.5px; font-weight: 600; text-transform: uppercase; color: var(--muted); background: #fafcff; border-bottom: 1px solid var(--borde); }
  .rk-row > * { grid-area: auto !important; }
  .rk-dato { justify-self: start !important; }
  .rk-dato em { display: none; }
  .rk-valor { justify-self: end; }
}

.resumen-equipo { padding: 14px 16px; margin-bottom: 14px; }
.resumen-equipo h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 12px; }
.resumen-equipo h2 .ic { color: var(--azul); }
.resumen-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.resumen-grid > div { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.resumen-grid .ic { grid-row: 1 / 3; width: 28px; height: 28px; color: var(--azul); }
.resumen-grid b { font-size: 24px; color: var(--navy); }
.resumen-grid span { font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .resumen-grid { grid-template-columns: 1fr 1fr; } }

.banner-premio { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; min-height: 170px; padding: 18px; border-radius: var(--radio); overflow: hidden; background: linear-gradient(100deg, #f3f8ff 0%, #e3efff 55%, #cfe6ff 100%); border: 1px solid #cfe0f7; }
.banner-trofeo .ic { width: 52px; height: 52px; color: #f5b301; }
.banner-txt { position: relative; z-index: 1; }
.con-foto .banner-txt { max-width: 62%; }
.banner-txt h2 { color: var(--azul-osc); font-size: 24px; margin-bottom: 6px; }
.banner-txt mark { background: #fde047; color: var(--navy); padding: 0 4px; border-radius: 4px; }
.banner-txt p { color: var(--navy); font-size: 15px; }
/* Foto del premio (si el admin subió una) a la derecha, fundida con el fondo hacia el texto. */
.banner-foto { position: absolute; top: 0; right: 0; height: 100%; width: 46%; object-fit: cover; object-position: 30% center; -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28%); mask-image: linear-gradient(to right, transparent 0, #000 28%); }
@media (max-width: 560px) {
  .con-foto .banner-txt { max-width: 70%; }
  .banner-txt h2 { font-size: 19px; }
  .banner-txt p { font-size: 13.5px; }
  .banner-trofeo .ic { width: 36px; height: 36px; }
}

/* ---------- Administración ---------- */
.ventas-lista { display: grid; gap: 10px; }
.venta { padding: 14px; }
.venta header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.venta header small { display: block; }
.venta-por_confirmar { border-left: 4px solid #f5b301; }
.venta-anulada { opacity: .7; }
.venta-form { display: grid; grid-template-columns: 1fr 2fr auto; gap: 10px; align-items: end; }
.venta-form .acciones-fila { margin: 0; }
@media (max-width: 700px) { .venta-form { grid-template-columns: 1fr; } }
.form-admin .btn { margin-top: 12px; }
.lista-admin { padding: 6px 14px; }
.fila-admin { display: grid; grid-template-columns: 70px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--borde); }
.fila-admin:last-child { border-bottom: 0; }
.fila-miembro { grid-template-columns: 1.6fr 1fr auto auto auto auto; }
.fila-miembro.sin-equipo { grid-template-columns: 1.6fr auto auto auto auto; }
.fila-miembro.inactivo .fila-miembro-nombre { opacity: .55; }
/* "Editar datos" de cada usuario: nombre, email, rol y contraseña nueva, plegados. */
.editar-datos { margin-top: 6px; }
.editar-datos summary { cursor: pointer; color: var(--azul); font-size: 13px; font-weight: 600; width: max-content; }
.editar-datos[open] { display: grid; gap: 6px; max-width: 280px; }
.fila-admin .editar-datos input, .fila-admin .editar-datos select { padding: 6px 10px; font-size: 13px; }
.nuevo-usuario, .equipos-admin { margin-top: 14px; }
.nuevo-usuario > .btn { margin-top: 12px; }
.equipos-admin summary { cursor: pointer; margin-bottom: 0; }
.equipos-admin[open] summary { margin-bottom: 10px; }
.equipos-admin summary small { font-size: 13px; }
.fila-equipo { grid-template-columns: 1fr auto; }
.fila-miembro-nombre small { display: block; color: var(--muted); font-size: 12.5px; }
.check { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.check input { width: auto; }
.nuevo-equipo { grid-template-columns: 1fr auto; border: 0; margin-top: 10px; }
@media (max-width: 700px) {
  .fila-miembro { grid-template-columns: 1fr 1fr; }
  .fila-miembro-nombre { grid-column: 1 / -1; }
  .fila-admin { grid-template-columns: 60px 1fr; }
  .fila-admin .check, .fila-admin .btn { justify-self: start; }
}

/* "Otro producto": se escribe a mano cuando no está en la lista. */
.otro-producto { margin-top: 10px; }
.otro-producto small { font-weight: 400; color: var(--muted); }
.fila-valor.productos-col { flex-direction: column; align-items: stretch; gap: 8px; }
.fila-valor .otro-producto-input { border: 1px dashed #b9cffb; background: #fbfdff; }

/* ---------- Login ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 400px; padding: 28px 24px; }
.login-logo { position: static; width: auto; height: auto; padding: 0; margin-bottom: 18px; background: none; border: 0; }
.login-card h1 { font-size: 24px; margin-bottom: 4px; }
.login-card > .muted { margin-bottom: 18px; }
.login-form { display: grid; gap: 14px; margin-top: 4px; }

.venta-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ================= Mejoras del diagnóstico (25 sep 2026) ================= */

/* Números en el menú (actividades de hoy / ventas por confirmar) */
.nav-item, .btn-admin-movil { position: relative; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--rojo); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1; }
.nav .badge { position: absolute; top: 4px; right: 6px; }
.btn-admin-movil .badge { position: absolute; top: -6px; right: -6px; }
@media (min-width: 900px) { .nav .badge { position: static; margin-left: auto; } }

/* Usuario → Mi cuenta */
a.usuario { color: inherit; border-radius: 10px; }
a.usuario:hover .usuario-txt small, a.usuario.activo .usuario-txt small { color: var(--azul); }
@media (min-width: 900px) { a.usuario { padding: 6px 4px; } a.usuario:hover, a.usuario.activo { background: var(--bg); } }
.form-cuenta { max-width: 640px; }
.form-cuenta > .btn { margin-top: 12px; }
.login-form .check { font-size: 14px; color: var(--muted); }

/* Actividad abierta: datos editables al tocarlos */
.dato-card > div { min-width: 0; flex: 1; }
.dato-editable { width: 100%; border: 1px dashed transparent; border-radius: 8px; padding: 2px 6px; margin-left: -6px; font-size: 16px; background: transparent; }
.dato-editable:hover, .texto-editable:hover { border-color: #b9cffb; background: #fbfdff; }
.texto-editable { width: 100%; border: 1px dashed #d6e2f5; border-radius: 12px; padding: 12px 14px; background: var(--card); resize: none; overflow: hidden; }
.editable.guardando { background: #fffbea; }
.editable.guardado { background: var(--verde-bg); transition: background .8s; }
.editable.error { border-color: var(--rojo) !important; background: var(--rojo-bg); }
.bloque-titulo-2 { margin-top: 14px; }

/* Siguiente acción después de cerrar una actividad */
.siguiente { margin-top: 12px; border-color: #b9cffb; background: #f0f6ff; scroll-margin-top: 120px; }
.siguiente summary { cursor: pointer; list-style: none; }
.siguiente summary::-webkit-details-marker { display: none; }
.siguiente[open] summary { margin-bottom: 12px; }
.siguiente-lista { display: flex; align-items: center; gap: 10px; padding: 14px 16px; margin-top: 12px; color: var(--texto); }
.siguiente-lista > .ic:first-child { color: var(--verde); }
.siguiente-lista span { flex: 1; }
.reabrir { margin-top: 10px; }

/* Notas: corregir / quitar */
.nota { position: relative; }
.nota-acciones { margin-top: 6px; }
.nota-acciones summary { list-style: none; cursor: pointer; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--muted); position: absolute; top: 8px; right: 8px; }
.nota-acciones summary::-webkit-details-marker { display: none; }
.nota-acciones summary:hover { background: var(--bg); color: var(--azul); }
.nota-acciones textarea { width: 100%; margin-top: 8px; padding: 10px; border: 1px solid var(--borde); border-radius: 10px; }
.nota > p { padding-right: 28px; }

/* Archivar prospecto */
.archivar { margin-top: 16px; color: var(--muted); font-size: 14px; }
.archivar summary { cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.archivar form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.archivar input { flex: 1 1 240px; padding: 9px 12px; border: 1px solid var(--borde); border-radius: 10px; }
.aviso form { margin-left: auto; }

/* WhatsApp en la ficha */
.accion-wa { background: #e7f8ee; color: #128c4a; }

/* Filtros / avisos / primer uso */
.filtros select.filtro-activo { border-color: var(--azul); color: var(--azul-osc); font-weight: 600; }
.aviso { display: flex; gap: 10px; align-items: center; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; background: #fff8e6; border: 1px solid #f6dd9c; color: #7a4d00; font-size: 14px; }
.aviso > .ic { color: #b7791f; flex: none; }
.aviso-link span { flex: 1; }
.aviso-link:hover { background: #fff2cc; }
.vacio-guia { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 24px 18px; }
.vacio-guia p { color: var(--muted); max-width: 52ch; }
.guia { padding: 18px 20px; margin-bottom: 14px; background: linear-gradient(135deg, #f5f9ff, #eefbf3); }
.guia h2 { font-size: 20px; margin-bottom: 8px; }
.guia ol { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 6px; }

/* Inicio del admin */
.saludo-siempre { display: block; }
.saludo .link { margin-left: 8px; }
a.stat { color: inherit; }
.stat-alerta { border-color: #f5b301; box-shadow: 0 0 0 2px rgba(245, 179, 1, .25); }
.tablero { overflow: hidden; margin-bottom: 14px; }
.tb-head { display: none; }
.tb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid var(--borde); font-size: 14.5px; }
.tb-row:last-child { border-bottom: 0; }
.tb-nombre { grid-column: 1 / -1; font-weight: 700; color: var(--navy); }
.tb-dato em { font-style: normal; color: var(--muted); margin-right: 6px; font-size: 12.5px; }
.tb-alerta { background: #fff5f5; box-shadow: inset 3px 0 0 var(--rojo); }
.tb-rojo { color: var(--rojo); font-weight: 700; }
.tb-amarillo { color: var(--amarillo); font-weight: 700; }
@media (min-width: 900px) {
  .tb-head, .tb-row { grid-template-columns: 1.4fr 1fr .8fr 1.1fr 1fr .9fr 1.1fr; align-items: center; }
  .tb-head { display: grid; gap: 12px; padding: 10px 16px; font-size: 12.5px; font-weight: 600; text-transform: uppercase; color: var(--muted); background: #fafcff; border-bottom: 1px solid var(--borde); }
  .tb-nombre { grid-column: auto; }
  .tb-dato em { display: none; }
}

/* Informes */
.informe { overflow: hidden; margin-bottom: 14px; }
.inf-head { display: none; }
.inf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid var(--borde); font-size: 14.5px; }
.inf-row em { font-style: normal; color: var(--muted); margin-right: 6px; font-size: 12.5px; }
.inf-nombre { grid-column: 1 / -1; font-weight: 700; color: var(--navy); }
.inf-total { background: #f5f9ff; font-weight: 700; border-bottom: 0; }
@media (min-width: 900px) {
  .inf-head, .inf-row { grid-template-columns: 1.5fr repeat(6, 1fr); align-items: center; }
  .inf-head { display: grid; gap: 12px; padding: 10px 16px; font-size: 12.5px; font-weight: 600; text-transform: uppercase; color: var(--muted); background: #fafcff; border-bottom: 1px solid var(--borde); }
  .inf-nombre { grid-column: auto; }
  .inf-row em { display: none; }
}
.exportar .acciones-fila { margin-top: 0; }

/* Respaldos */
.respaldos { margin-top: 14px; }
.fila-respaldo { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--borde); }
.fila-respaldo:last-child { border-bottom: 0; }
.fila-respaldo small { display: block; }

/* Agenda: calendario del mes (computadora) */
.cal { display: none; }
@media (min-width: 900px) {
  .cal { display: grid; grid-template-columns: repeat(7, 1fr); overflow: hidden; margin-bottom: 14px; }
  .cal-dn { padding: 8px; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; background: #fafcff; border-bottom: 1px solid var(--borde); }
  .cal-dia { min-height: 108px; padding: 6px; border-right: 1px solid var(--borde); border-bottom: 1px solid var(--borde); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .cal-dia:nth-child(7n) { border-right: 0; }
  .cal-fuera { background: #fafbfd; }
  .cal-fuera .cal-num { color: #b4bfd3; }
  .cal-num { align-self: flex-start; font-weight: 700; color: var(--navy); font-size: 13px; padding: 2px 7px; border-radius: 999px; }
  .cal-num:hover { background: var(--azul-claro); }
  .cal-hoy .cal-num { background: var(--azul); color: #fff; }
  .cal-act { display: block; font-size: 12px; padding: 3px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--texto) !important; }
  .cal-act b { font-weight: 700; }
  .cal-mas { font-size: 12px; color: var(--muted); padding-left: 6px; }
  .agenda-dia-mes { display: none; }
}
summary.bloque-titulo { font-weight: 700; color: var(--navy); }
@media (max-width: 480px) { .accion-ic { width: 32px; height: 32px; } .accion-ic .ic { width: 17px; height: 17px; } .fila-valor { gap: 4px; } .fila-valor .editable[type="tel"] { padding-left: 4px; padding-right: 2px; } }

/* ================= Ayuda, app instalable y recordatorios ================= */

/* Botón Ayuda: al pie del menú lateral (computadora) o "?" arriba (celular) */
.nav-ayuda { display: none; }
.btn-ayuda-movil.activo { background: var(--azul-claro); color: var(--azul); border-color: #b9cffb; }
@media (min-width: 900px) {
  .nav-ayuda { display: flex; margin-top: auto; }
  .nav-ayuda ~ .nav-admin { margin-top: 0; }
  .topbar .btn-ayuda-movil { display: none; }
}
.ayuda-link { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: 6px; border-radius: 50%; background: var(--azul-claro); color: var(--azul); font-size: 14px; font-weight: 800; vertical-align: middle; }
.ayuda-link:hover { background: var(--azul); color: #fff; }

/* Página de ayuda */
.ayuda-indice { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ayuda-indice a { padding: 8px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--borde); color: var(--navy); font-size: 14px; }
.ayuda-indice a:hover { border-color: var(--azul); color: var(--azul); }
.ayuda-pagina { display: grid; gap: 10px; max-width: 860px; }
.ayuda-sec { background: var(--card); scroll-margin-top: 130px; }
.ayuda-sec summary { cursor: pointer; list-style: none; margin-bottom: 0; }
.ayuda-sec summary::-webkit-details-marker { display: none; }
.ayuda-sec summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .2s; }
.ayuda-sec[open] summary { margin-bottom: 10px; }
.ayuda-sec[open] summary::after { transform: rotate(180deg); }
.ayuda-sec h3 { font-size: 16px; margin: 14px 0 6px; }
.ayuda-sec p, .ayuda-sec li, .ayuda-sec dd { line-height: 1.55; }
.ayuda-sec ul, .ayuda-sec ol { margin: 6px 0 10px; padding-left: 22px; display: grid; gap: 6px; }
.ayuda-sec .estados-ayuda { list-style: none; padding-left: 0; }
.ayuda-sec .tip { background: #f0f6ff; border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.ayuda-sec .btn { margin-top: 4px; }
.faq dt { font-weight: 700; color: var(--navy); margin-top: 12px; }
.faq dd { margin: 4px 0 0; color: var(--texto); }

/* Inicio: acceso corto a la guía */
.guia-corta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; }
.guia-corta > span { flex: 1 1 240px; }

/* Aviso flotante (agregar a la pantalla de inicio / activar recordatorios) */
.flotante { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); display: grid; gap: 10px; padding: 14px 16px; background: var(--card); border: 1px solid #c6d8fb; border-radius: 16px; box-shadow: 0 12px 40px rgba(13, 35, 80, .22); animation: flotante-in .35s ease-out; }
.flotante-txt b { display: block; color: var(--navy); font-size: 15.5px; margin-bottom: 2px; }
.flotante-txt span { color: var(--texto); font-size: 14px; }
.flotante-txt span span, .flotante-txt span b { display: inline; font-size: inherit; margin: 0; }
.flotante-btns { display: flex; gap: 8px; justify-content: flex-end; }
@keyframes flotante-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 900px) { .flotante { left: auto; right: 24px; bottom: 24px; max-width: 400px; } }

/* Recordatorios: Mi cuenta y Administración */
.push-estado { margin: 8px 0 4px; }
.cron-caja { margin-top: 18px; padding: 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--borde); }
.cron-caja h3 { font-size: 16px; margin-bottom: 6px; }
.cron-caja ol { padding-left: 20px; display: grid; gap: 4px; margin: 8px 0; }
.cron-cmd { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cron-cmd code { flex: 1 1 300px; padding: 10px 12px; border-radius: 8px; background: #0d2350; color: #e6efff; font-size: 12.5px; overflow-wrap: anywhere; }
.cron-detalle summary { cursor: pointer; color: var(--azul); font-size: 14px; margin-top: 4px; }

/* ================= Meta viva: buenos días y ritmo ================= */

/* Marca de ritmo: cuántas ventas debería llevar hoy para llegar a tiempo */
.barra { position: relative; }
.marca-ritmo { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1px; border-radius: 2px; background: var(--navy); box-shadow: 0 0 0 2px #fff; }
.stat .barra { overflow: visible; }
.stat .barra > span { border-radius: 999px; }
.ritmo-nota { grid-column: 1 / -1; font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.ritmo-bien { color: var(--verde); }
.ritmo-atras { color: var(--naranja); }
.ritmo-justo { color: var(--azul); }

/* Pantalla de buenos días (una vez al día) */
.splash { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(13, 35, 80, .45); backdrop-filter: blur(3px); animation: splash-in .3s ease-out; }
.splash.saliendo { opacity: 0; transition: opacity .25s; }
.splash-card { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 24px 22px 20px; border-radius: 20px; background: linear-gradient(160deg, #ffffff 55%, #eaf3ff 100%); box-shadow: 0 24px 60px rgba(13, 35, 80, .35); display: grid; gap: 12px; animation: splash-card-in .35s cubic-bezier(.2, .9, .3, 1.2); }
.splash-hola { color: var(--muted); font-weight: 600; }
.splash-card h2 { font-size: 22px; color: var(--azul-osc); }
.splash-meta { display: flex; align-items: baseline; gap: 8px; }
.splash-meta b { font-size: 44px; font-weight: 800; color: var(--navy); line-height: 1; }
.splash-meta span { color: var(--muted); font-weight: 600; }
.barra-ritmo { height: 16px; overflow: visible; }
.barra-ritmo > span { display: block; background: linear-gradient(90deg, #22c55e, #16a34a); border-radius: 999px; }
.splash-frase { font-size: 15.5px; font-weight: 600; color: var(--navy); }
.splash-datos { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14.5px; }
.splash-datos li { padding-left: 14px; position: relative; }
.splash-datos li::before { content: "•"; position: absolute; left: 0; color: var(--azul); }
.splash-hoy { padding: 10px 12px; border-radius: 12px; background: #f0f6ff; font-size: 14.5px; }
@keyframes splash-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes splash-card-in { from { transform: translateY(20px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .splash, .splash-card { animation: none; } }

/* Zona de reinicio, estado de recordatorios, foto del premio en celular */
.zona-peligro { border-color: #f5c2c2; background: #fff8f8; margin: 14px 0; }
.zona-peligro .acciones-fila { align-items: center; margin: 0 0 10px; }
.zona-peligro input[type=date] { padding: 7px 10px; border: 1px solid var(--borde); border-radius: 8px; }
.zona-peligro .campo { max-width: 320px; margin-bottom: 12px; }
.quien-avisos { display: grid; gap: 4px; margin: 4px 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--borde); font-size: 14px; }
.avisos-si { color: var(--verde) !important; }
.avisos-no { color: var(--naranja) !important; }
@media (max-width: 560px) { .banner-foto { width: 42%; } .con-foto .banner-txt { max-width: 60%; } }
.titulo-seccion { font-size: 20px; margin: 22px 0 10px; }
.venta-propia { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); color: var(--muted); font-size: 14px; }
.login-pie { margin-top: 16px; font-size: 13px; text-align: center; }
.premio-preview { display: block; width: 100%; max-width: 360px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; border: 1px solid var(--borde); margin: 4px 0 12px; }
/* Celular angosto: "RetoVenta" es más largo que el logo anterior; se achica un poco para que no se corte. */
@media (max-width: 420px) {
  .logo:not(.login-logo) { gap: 8px; padding: 12px 10px 12px 14px; }
  .logo:not(.login-logo) .logo-img { width: 32px; height: 32px; border-radius: 8px; }
  .logo:not(.login-logo) .logo-txt { font-size: 18px; }
  .logo:not(.login-logo) .logo-txt small { font-size: 10.5px; }
  .topbar { gap: 6px; padding-left: 0; }
}
/* Administración → Empresa */
.input-color { height: 44px; padding: 4px 6px; cursor: pointer; }
.logo-preview { display: block; width: 88px; height: 88px; object-fit: contain; border-radius: 14px; border: 1px solid var(--borde); background: #fff; margin: 4px 0 12px; }
/* Logo de la empresa en el menú: su logo + su nombre, y "con RetoVenta" pequeño. */
.logo-img.logo-empresa { object-fit: contain; background: #fff; }
.logo-txt-empresa { font-size: 18px; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
@media (max-width: 420px) { .logo:not(.login-logo) .logo-txt-empresa { font-size: 16px; max-width: 120px; } }
/* Panel 7soft (dueno.php) */
.dueno-resumen { padding: 16px; margin-bottom: 14px; }
.dueno-lista { display: grid; gap: 12px; margin-bottom: 14px; }
.dueno-empresa { padding: 16px; }
.dueno-empresa h2 { font-size: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dueno-empresa header p { font-size: 13.5px; margin-top: 2px; }
.dueno-datos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 12px 0 8px; }
.dueno-datos span { font-size: 14.5px; color: var(--navy); font-weight: 600; }
.dueno-datos em { display: block; font-style: normal; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.dueno-admins { font-size: 13.5px; color: var(--texto); }
.dueno-editar { margin-top: 10px; }
.dueno-editar summary { cursor: pointer; color: var(--azul); font-weight: 600; font-size: 14px; }
.dueno-editar[open] summary { margin-bottom: 10px; }
.txt-rojo { color: var(--rojo); }
@media (max-width: 700px) { .dueno-datos, .dueno-resumen.resumen-grid { grid-template-columns: 1fr 1fr; } }
