/* ==========================================
   POSTULANTES (postulantes.css)
   Estilo corporativo: fondo oscuro, acento cian Hidran, animaciones suaves
   ========================================== */
.postulantes { --c: var(--accent-cyan, #00d2ff); --ok: #2ee88a; --malo: #ff4d4d;
    --sup: #0a0c10; --sup2: #0f1218; --linea: rgba(255, 255, 255, .08); max-width: 1100px; margin: 0 auto; }
.postulantes input { text-transform: none; }

/* ---------- Cabecera ---------- */
.pos-hero { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 14px 28px; align-items: center; padding: 18px 48px 18px 20px; margin-bottom: 16px; border-radius: 12px;
    border: 1px solid var(--linea); box-shadow: inset 0 2px 0 var(--c); background: var(--sup); }   /* línea cian arriba que sigue el borde redondeado */
/* X de cerrar dentro del recuadro de la cabecera */
#pantalla-postulantes .pos-cerrar { top: 10px; right: max(12px, calc((100% - 1100px) / 2 + 12px)); z-index: 5; }
.pos-hero h2 { margin: 0; padding: 0; border: 0; text-align: left; font-size: 22px; font-weight: 700; letter-spacing: .3px; color: #fff; }
.pos-hero-txt p { margin: 4px 0 0; font-size: 12px; color: #8a93a0; }
.pos-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pos-kpi { padding: 9px 12px; border-radius: 8px; background: var(--sup2); border: 1px solid var(--linea); border-left: 2px solid var(--c); min-width: 0;
    opacity: 0; animation: pos-entrar .35s ease-out forwards; animation-delay: calc(var(--i) * 60ms); }
.pos-kpi div { min-width: 0; }
.pos-kpi small { display: block; font-size: 10px; color: #8a93a0; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.pos-kpi b { display: block; margin-top: 2px; font-size: 16px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes pos-entrar { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Cuerpo: formulario + lista (y la postulación debajo de la lista) ---------- */
.pos-cuerpo { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pos-der { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pos-form, .pos-lista { position: relative; background: var(--sup); border: 1px solid var(--linea); border-radius: 12px; padding: 16px 18px 18px; }
.pos-form.pos-brillo { animation: pos-brillo .8s ease-out; }
@keyframes pos-brillo { 0% { border-color: var(--c); } 100% { border-color: var(--linea); } }
.pos-form-cab, .pos-lista-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pos-form-cab h3, .pos-lista-cab h3 { margin: 0; font-size: 15px; font-weight: 600; color: #fff; letter-spacing: .2px; }
.postulantes .pos-btn-sec { width: auto; margin: 0; height: 30px; padding: 0 14px; font-size: 12px; font-weight: 600; border-radius: 6px; color: var(--c); background: transparent; border: 1px solid var(--c); box-shadow: none; }

/* Barra de avance del formulario: línea delgada con el % a la derecha */
.pos-progreso { position: relative; height: 4px; margin: 22px 0 14px; border-radius: 2px; background: rgba(255, 255, 255, .08); }
.pos-progreso i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 2px; background: var(--c); transition: width .35s ease; }
.pos-progreso span { position: absolute; right: 0; bottom: 8px; font-size: 11px; font-weight: 600; color: #8a93a0; }

/* Grupos de campos */
.pos-grupo { margin: 0 0 12px; padding: 10px 14px 4px; border: 1px solid var(--linea); border-radius: 10px; background: var(--sup2); min-width: 0;
    opacity: 0; animation: pos-entrar .35s ease-out forwards; animation-delay: calc(var(--i) * 70ms); transition: border-color .2s; }
.pos-grupo:focus-within { border-color: rgba(0, 210, 255, .45); }
.pos-grupo legend { padding: 0 6px; font-size: 11px; font-weight: 600; color: var(--c); letter-spacing: .8px; text-transform: uppercase; }
.pos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.pos-ancho { grid-column: 1 / -1; }
.pos-campo { display: block; margin-bottom: 10px; min-width: 0; }
.pos-campo > span:first-child { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 5px; font-size: 11px; font-weight: 600; color: #8a93a0; letter-spacing: .3px; transition: color .2s; }
.pos-campo:focus-within > span:first-child { color: #fff; }
.pos-campo input { margin: 0; height: 38px; border-radius: 6px; font-size: 14px; background: #000; border: 1px solid rgba(255, 255, 255, .12); caret-color: var(--cursor-color); }
.pos-campo input:focus { border-color: var(--c); background: #050505; box-shadow: none; }
.pos-campo input[readonly] { color: #aaa; border-style: dashed; }
/* RUT corto con el logo de Hidran a la derecha */
.pos-rut-fila { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pos-campo.pos-rut { flex: 0 1 230px; }
.pos-logo { flex: none; width: 92px; height: auto; margin: 0 4px 6px 0; opacity: .9; filter: drop-shadow(0 0 6px rgba(0, 210, 255, .25)); }
.pos-rut .pos-rut-wrap input { padding-right: 40px; }
.pos-rut-wrap { position: relative; display: block; }
.pos-rut-wrap input { padding-right: 90px; }
.pos-rut-ok, .pos-edad { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); opacity: 0; transition: opacity .2s; }
.pos-rut-ok { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; color: #000; }
.pos-rut-ok.ok { background: var(--ok); opacity: 1; }
.pos-rut-ok.malo { background: var(--malo); color: #fff; opacity: 1; }
.pos-edad { padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; color: var(--c); border: 1px solid rgba(0, 210, 255, .4); }
.pos-edad.visible { opacity: 1; }
.postulantes .pos-mismo { width: auto; margin: 0; padding: 2px 8px; height: auto; font-size: 10px; font-weight: 600; border-radius: 4px; color: #8a93a0; background: transparent; border: 1px solid rgba(255, 255, 255, .18); box-shadow: none; }

/* Botones rápidos (puesto y base de extracción) */
.pos-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 12px; }
.postulantes .pos-chips button { width: auto; margin: 0; padding: 5px 11px; font-size: 12px; font-weight: 500; border-radius: 6px; color: #b8c0cc; background: #000; border: 1px solid rgba(255, 255, 255, .14); box-shadow: none; transition: background .2s, color .2s, border-color .2s; }
.postulantes .pos-chips button.activo { color: #000; background: var(--c); border-color: var(--c); font-weight: 600; }
/* Preguntas para chofer (Sí / No) */
.pos-chofer { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: var(--sup2); border: 1px solid var(--linea); border-left: 2px solid var(--c); animation: pos-aparecer .25s ease-out; }
.pos-chofer[hidden] { display: none; }
@keyframes pos-aparecer { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pos-chofer-tit { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 600; color: var(--c); letter-spacing: .6px; text-transform: uppercase; }
.pos-preg { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--linea); }
.pos-preg:first-of-type { border-top: 0; }
.pos-preg > span { font-size: 13px; color: #dfe6ee; }
.pos-sino { display: flex; flex: none; }
.postulantes .pos-sino button { width: 52px; height: 28px; margin: 0; padding: 0; font-size: 12px; font-weight: 600; color: #b8c0cc; background: #000; border: 1px solid rgba(255, 255, 255, .16); box-shadow: none; border-radius: 0; }
.postulantes .pos-sino button:first-child { border-radius: 6px 0 0 6px; }
.postulantes .pos-sino button:last-child { border-radius: 0 6px 6px 0; border-left: 0; }
.postulantes .pos-sino button[data-v="si"].activo { color: #000; background: var(--ok); border-color: var(--ok); }
.postulantes .pos-sino button[data-v="no"].activo { color: #fff; background: var(--malo); border-color: var(--malo); }
.postulantes .pos-sino button:focus-visible { outline: 1px solid var(--c); outline-offset: 1px; }
.pos-resp { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.pos-resp span { padding: 1px 6px; border-radius: 4px; font-size: 10px; border: 1px solid; }
.pos-resp .si { color: var(--ok); border-color: rgba(46, 232, 138, .4); }
.pos-resp .no { color: var(--malo); border-color: rgba(255, 77, 77, .4); }

/* Botón guardar: discreto, a la derecha */
.postulantes .pos-btn { display: block; width: auto; min-width: 150px; margin: 4px 0 0 auto; height: 38px; padding: 0 22px; border-radius: 6px; font-size: 14px; font-weight: 600; letter-spacing: .2px; text-transform: none;
    color: #000; background: var(--c); border: 1px solid var(--c); box-shadow: none; transition: filter .2s; }
.postulantes .pos-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- Lista de postulantes ---------- */
.pos-lista-cab input { width: 230px; max-width: 100%; margin: 0; height: 34px; border-radius: 6px; font-size: 13px; background: #000; border: 1px solid rgba(255, 255, 255, .12); }
.pos-lista-cab input:focus { border-color: var(--c); box-shadow: none; }
.pos-filtros { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; scrollbar-width: none; }
.pos-filtros:empty { display: none; }
.postulantes .pos-filtros button { flex: none; width: auto; margin: 0; padding: 4px 11px; font-size: 11px; font-weight: 600; border-radius: 6px; color: #9aa3b0; background: var(--sup2); border: 1px solid var(--linea); box-shadow: none; }
.postulantes .pos-filtros button.activo { color: var(--c); background: rgba(0, 210, 255, .08); border-color: var(--c); }
.pos-tarjetas { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.pos-tarjeta { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 11px 13px; cursor: pointer;
    border-radius: 8px; background: var(--sup2); border: 1px solid var(--linea);
    opacity: 0; animation: pos-entrar .3s ease-out forwards; animation-delay: calc(var(--i) * 40ms); transition: border-color .2s, background .2s; }
.pos-tarjeta:focus { outline: none; border-color: var(--c); }
@media (hover: hover) { .pos-tarjeta:hover { border-color: rgba(0, 210, 255, .45); } }
.pos-tarjeta.elegido { border-color: var(--c); background: rgba(0, 210, 255, .05); }
.pos-tarjeta.recien { animation: pos-entrar .3s ease-out forwards, pos-brillo 1.2s ease-out .3s; }
.pos-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-size: 14px; font-weight: 600; color: var(--c); text-transform: uppercase;
    background: rgba(0, 210, 255, .08); border: 1px solid rgba(0, 210, 255, .35); }
.pos-tarjeta-info { min-width: 0; }
.pos-tarjeta-info b { display: block; font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-tarjeta-info small { display: block; margin-top: 2px; font-size: 11px; color: #8a93a0; }
.pos-tarjeta-info .pos-dir { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-etiquetas { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.pos-etiquetas span { padding: 1px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.pos-et-puesto { color: var(--c); border: 1px solid rgba(0, 210, 255, .45); }
.pos-et-base { color: #b8c0cc; border: 1px solid rgba(255, 255, 255, .18); }
.pos-acciones { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; align-items: flex-end; gap: 6px; max-width: 80px; }
.pos-fecha { flex-basis: 100%; text-align: right; font-size: 10px; color: #667; white-space: nowrap; }
.pos-accion { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; font-size: 14px; text-decoration: none; transition: border-color .2s; }
.pos-accion.wsp { border: 1px solid rgba(37, 211, 102, .45); }
.pos-accion.llamar { border: 1px solid rgba(0, 210, 255, .4); }
@media (hover: hover) { .pos-accion:hover { border-color: #fff; } }
.pos-vacio { padding: 28px 16px; text-align: center; color: #778; font-size: 13px; border: 1px dashed rgba(255, 255, 255, .12); border-radius: 8px; }

/* ---------- Celular y tablet ---------- */
@media (max-width: 900px) {
    .pos-cuerpo { grid-template-columns: 1fr; }
    /* En celular la postulación va justo después del formulario y la lista al final */
    .pos-der { display: contents; }
    .pos-postulacion { order: 1; }
    .pos-lista { order: 2; }
    .pos-hero { grid-template-columns: 1fr; }
    .pos-tarjetas { max-height: none; }
}
@media (max-width: 560px) {
    .pos-hero { padding: 16px 14px; }
    .pos-hero-txt { padding-right: 30px; }
    .pos-hero h2 { font-size: 20px; }
    .pos-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
    .pos-form, .pos-lista { padding: 14px 12px; }
    .pos-grupo { padding: 10px 10px 2px; }
    .pos-grid { grid-template-columns: 1fr; }
    .pos-lista-cab input { width: 100%; }
    .postulantes .pos-btn { width: 100%; margin-left: 0; }
    .pos-tarjeta { grid-template-columns: 38px minmax(0, 1fr); padding: 11px; }
    .pos-avatar { width: 38px; height: 38px; font-size: 13px; }
    .pos-acciones { grid-column: 1 / -1; justify-content: flex-start; align-items: center; max-width: none; }
    .pos-fecha { flex-basis: auto; order: 9; margin-left: auto; }
    .pos-accion { width: auto; padding: 0 14px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
    .pos-kpi, .pos-grupo, .pos-tarjeta { animation-duration: .01s !important; animation-delay: 0s !important; }
}
/* El hover general de los botones (fondo cian) no aplica en esta pantalla */
@media (hover: hover) {
    .postulantes .pos-chips button:hover { background: #0d1015; color: #fff; border-color: rgba(0, 210, 255, .5); box-shadow: none; }
    .postulantes .pos-chips button.activo:hover { background: var(--c); color: #000; }
    .postulantes .pos-sino button:not(.activo):hover { background: #0d1015; color: #fff; border-color: rgba(0, 210, 255, .5); box-shadow: none; }
    .postulantes .pos-sino button[data-v="si"].activo:hover { background: var(--ok); color: #000; }
    .postulantes .pos-sino button[data-v="no"].activo:hover { background: var(--malo); color: #fff; }
    .postulantes .pos-btn:hover { background: var(--c); color: #000; border-color: var(--c); box-shadow: none; filter: brightness(1.12); }
    .postulantes .pos-btn-sec:hover { background: var(--c); color: #000; border-color: var(--c); box-shadow: none; }
    .postulantes .pos-filtros button:hover { background: #151922; color: #fff; border-color: rgba(0, 210, 255, .5); box-shadow: none; }
    .postulantes .pos-filtros button.activo:hover { background: rgba(0, 210, 255, .08); color: var(--c); }
    .postulantes .pos-mismo:hover { background: transparent; color: #fff; border-color: #fff; box-shadow: none; }
}
