/* Tipografía Outfit (Google Fonts, licencia OFL), servida desde el propio portal */
@font-face { font-family: "Outfit"; font-weight: 400; font-style: normal; font-display: swap; src: url("Outfit-400.ttf") format("truetype"); }
@font-face { font-family: "Outfit"; font-weight: 500; font-style: normal; font-display: swap; src: url("Outfit-500.ttf") format("truetype"); }
@font-face { font-family: "Outfit"; font-weight: 600; font-style: normal; font-display: swap; src: url("Outfit-600.ttf") format("truetype"); }
/* Misma estética que el panel interno (app/web/styles.css): verde, tarjetas claras, píldoras.
   Pensado primero para celular. */
:root {
  --bg: #ffffff; --panel: #ffffff; --card: #ffffff; --line: #e1e8e3; --line2: #eef2ef;
  --text: #10221a; --dim: #5c7066; --accent: #0e7a45; --accent2: #0b5f36; --accent-soft: #e4f3ea;
  --danger: #b3261e; --danger-soft: #fdecea; --radius: 16px; --shadow: 0 1px 2px rgba(16, 34, 26, .05);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
  background: #ffffff;
  color: var(--text); min-height: 100vh; padding: 14px 14px 60px;
  -webkit-font-smoothing: antialiased; letter-spacing: -.005em; font-size: 16px;
}
.contenedor { max-width: 760px; margin: 0 auto; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; min-height: 44px; }
header.top img { height: 32px; max-width: 62%; }
header.top form { margin: 0; }
.quien { color: var(--dim); font-size: 13px; display: flex; align-items: center; gap: 10px; }
.quien a { color: var(--dim); }
nav.tabs { margin-bottom: 18px; }
nav.tabs .seg { display: flex; gap: 2px; padding: 3px; background: #edf1ee; border-radius: 999px; width: 100%; }
nav.tabs a { flex: 1 1 0; text-align: center; color: var(--dim); text-decoration: none; font-size: 15px; font-weight: 500; padding: 10px 8px; border-radius: 999px; white-space: nowrap; }
nav.tabs a.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(16, 34, 26, .12); }
h2 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 12px; }
button, input, select, .btn {
  font-family: inherit; font-size: 16px; color: var(--text); background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 0 20px; min-height: 46px; transition: .15s;
}
button, .btn { cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; text-align: center; line-height: 1.1; }
button:hover, .btn:hover { border-color: #c9d8ce; background: #fcfdfc; }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 122, 69, .13); }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
.primary:hover { background: var(--accent2); border-color: var(--accent2); }
.danger { background: var(--danger-soft); border-color: #f4d3d0; color: var(--danger); }
.chico { padding: 0 14px; min-height: 38px; font-size: 14px; }
.barra { display: flex; align-items: stretch; gap: 8px; margin-bottom: 16px; }
.barra input { flex: 1; min-width: 0; }
.card, .res { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.res-h { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; font-size: 13px; color: var(--dim); }
.chip { background: var(--accent-soft); color: var(--accent); padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip.gris { background: #eef2ef; color: var(--dim); }
.res p { line-height: 1.55; margin-bottom: 10px; font-size: 15px; }
.fila { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--dim); } .small { font-size: 13px; }
.error { background: var(--danger-soft); color: var(--danger); border: 1px solid #f4d3d0; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.ok { background: var(--accent-soft); color: var(--accent2); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.nuevas { background: var(--accent); color: #fff; border-radius: 999px; padding: 3px 11px; font-size: 13px; font-weight: 600; }
.nuevas.cero { background: #eef2ef; color: var(--dim); }
form.campos { display: flex; flex-direction: column; gap: 10px; }
form.campos label { font-size: 13px; color: var(--dim); display: flex; flex-direction: column; gap: 4px; }
video { width: 100%; border-radius: 12px; background: #000; max-height: 60vh; }
.tramo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.tramo .valor { font-variant-numeric: tabular-nums; font-weight: 600; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.login { max-width: 380px; margin: 8vh auto 0; }
.login img { height: 38px; display: block; margin: 0 auto 22px; }
details summary { cursor: pointer; color: var(--accent); font-weight: 500; padding: 6px 0; }
details video { margin-top: 8px; }
.pager { display: flex; justify-content: space-between; margin-top: 8px; }
@media (min-width: 700px) { body { padding: 26px 24px 70px; } }

/* alineación de filas de botones */
.acciones, .pager { align-items: center; }
.acciones form { margin: 0; display: flex; }
input { width: 100%; }
.barra input { width: auto; }

/* todos los botones y campos: misma redondez (píldora), igual que las pestañas */
.error, .ok { border-radius: 14px; }
.card .fila { margin-bottom: 12px; }
.acciones.trio { display: flex; gap: 8px; }
.acciones.trio > a, .acciones.trio > form { flex: 1 1 0; display: flex; margin: 0; }
.acciones.trio .btn, .acciones.trio button { width: 100%; }
@media (max-width: 420px) { .acciones.trio { flex-wrap: wrap; } .acciones.trio > * { flex: 1 1 100%; } }

/* con 5 pestañas: en pantallas angostas se desliza en horizontal */
nav.tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs .seg { min-width: max-content; }
nav.tabs a { flex: 1 0 auto; padding-left: 16px; padding-right: 16px; }

/* Mis palabras / Mis personas: el nombre manda, los botones de acción son chicos y parejos */
.card .fila strong { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.acciones.trio { flex-wrap: wrap; gap: 8px; }
.acciones.trio > a, .acciones.trio > form { flex: 0 0 auto; }
.acciones.trio .btn, .acciones.trio button { width: auto; min-height: 34px; padding: 0 14px; font-size: 13px; }
@media (max-width: 420px) { .acciones.trio > * { flex: 0 0 auto; } }

/* Mis personas: propias arriba, del sistema abajo */
h2.sec { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.filtro { width: 100%; margin: 4px 0 14px; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.persona-card { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.persona-card:hover { border-color: #c9d8ce; background: #fcfdfc; }
.persona-card[hidden] { display: none; }
.persona-card img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: #eef4f0; flex: 0 0 auto; }
.persona-card .nombre { font-weight: 500; line-height: 1.2; overflow-wrap: anywhere; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* personas propias: avatar, fotos y carga */
.quien-p { display: flex; align-items: center; gap: 12px; min-width: 0; }
.quien-p strong { overflow-wrap: anywhere; line-height: 1.2; }
.avatar { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; display: flex; align-items: center;
  justify-content: center; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 20px; text-decoration: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fotos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -2px 0 12px; }
.foto-x { position: relative; width: 40px; height: 40px; margin: 0; }
.foto-x img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: block; }
.foto-x .x { position: absolute; top: -5px; right: -5px; width: 18px; height: 18px; min-height: 0; padding: 0; border-radius: 50%;
  font-size: 12px; line-height: 1; background: #fff; color: var(--danger); border: 1px solid var(--line); }
.fotos .subir { margin: 0; }

/* separación entre el texto de ayuda y la barra de agregar */
h2 + p.muted.small { margin-bottom: 14px; line-height: 1.45; }
.barra + .muted, .barra + .card { margin-top: 4px; }

/* Estadísticas */
.periodos, .opciones { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.chip-p { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--dim); font-size: 14px; text-decoration: none; }
.chip-p.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
.tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tarjeta { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.t-num { font-size: 28px; font-weight: 600; letter-spacing: -.02em; color: var(--accent); line-height: 1.1; }
.t-num.t-txt { font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.t-et { font-size: 13px; color: var(--dim); }
.seccion h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.seccion svg { width: 100%; height: auto; display: block; }
.g-et { font-size: 13px; fill: var(--text); font-family: inherit; }
.g-val { font-size: 12px; fill: var(--dim); font-family: inherit; }
.g-eje { font-size: 11px; fill: var(--dim); font-family: inherit; }
.g-fondo { fill: #eef2ef; }
.g-barra { fill: var(--accent); }
.g-grilla { stroke: var(--line); stroke-width: 1; }
.g-area { fill: rgba(14, 122, 69, .12); }
.g-trazo { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.g-punto { fill: #fff; stroke: var(--accent); stroke-width: 2; }

/* gráficos: texto legible en celular y no gigantes en pantalla ancha */
.seccion svg { max-width: 560px; margin: 0 auto; }
.g-et { font-size: 13.5px; } .g-val { font-size: 13px; } .g-eje { font-size: 11.5px; }
/* el nombre de la empresa no rompe el encabezado */
.quien a { max-width: 42vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; }

#evolucion { scroll-margin-top: 12px; }

/* Estadísticas: números del ranking, búsqueda y botón de lista ampliada */
.g-num { font-size: 12px; fill: var(--dim); font-family: inherit; font-weight: 600; }
.seccion .mas { margin-top: 12px; display: flex; justify-content: center; }
.buscador { margin: 4px 0 10px; }
#personas, #palabras { scroll-margin-top: 12px; }

/* comparación de hasta 3 series: verde, azul y naranja */
.g-t0 { stroke: #0e7a45; } .g-t1 { stroke: #2563eb; } .g-t2 { stroke: #e08a00; }
.g-p0 { stroke: #0e7a45; } .g-p1 { stroke: #2563eb; } .g-p2 { stroke: #e08a00; }
.g-trazo.g-t1, .g-trazo.g-t2 { stroke-dasharray: none; }
.leyendas { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0 10px; font-size: 14px; }
.leyenda::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; background: #0e7a45; }
.leyenda.l1::before { background: #2563eb; } .leyenda.l2::before { background: #e08a00; }

/* toque sobre un punto del gráfico: zona táctil amplia y cartel con la cantidad */
.g-hit { fill: transparent; cursor: pointer; }
.g-punto { cursor: pointer; } .g-punto.sel { fill: currentColor; r: 5.5; }
.g-p0.sel { fill: #0e7a45; } .g-p1.sel { fill: #2563eb; } .g-p2.sel { fill: #e08a00; }
.g-info { margin: 8px 0 0; padding: 8px 14px; border-radius: 999px; background: #f3f6f3; color: var(--dim); font-size: 14px; text-align: center; }
.g-info.s0 { background: #e4f3ea; color: #0b5f36; } .g-info.s1 { background: #e6eefd; color: #1d4fbf; } .g-info.s2 { background: #fdf0dc; color: #a35f00; }

/* período propio de la caja de Evolución */
.periodo-ev { margin-bottom: 8px; }
.rango { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.rango label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--dim); }
.rango input[type=date] { width: auto; min-height: 38px; padding: 0 12px; font-size: 14px; }
