/* Chinflip · estilos del módulo de RH (altas, bajas, contratos, expediente) */
.danger { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border: 0; border-radius: 12px; background: #c2384b; color: #fff; font-weight: 700; }
.danger:hover { background: #a32c3d; }
.danger-soft { border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 700; background: #fde8eb; color: #b02a3e; }
.danger-soft:hover { background: #fbd3d9; }
.initials.big { width: 46px; height: 46px; border-radius: 50%; font-size: .85rem; }
.rh-dialog { width: min(560px, calc(100% - 24px)); padding: 22px; border: 0; border-radius: 20px; box-shadow: 0 30px 70px #07142e55; }
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 600 !important; }
.check input { width: 18px; height: 18px; accent-color: var(--purple); }
/* Movimientos */
.mov-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 220px; padding: 0 20px 18px; }
.mc-col { display: grid; grid-template-rows: 1fr auto; gap: 6px; text-align: center; }
.mc-col small { color: var(--muted); font-size: .72rem; text-transform: capitalize; }
.mc-bars { display: flex; align-items: end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--line); }
.mc-bars span { width: 40%; min-height: 0; border-radius: 5px 5px 0 0; color: #fff; font-size: .7rem; font-weight: 700; line-height: 1.6; }
.mc-in { background: #2fa36b; } .mc-out { background: #e2687a; }
.reasons { display: grid; gap: 14px; padding: 0 20px 20px; }
.reason { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font-size: .9rem; }
.reason .bar { grid-column: 1 / -1; }
.saldo-bar.wide { width: 100%; }
/* Contratos */
.doc-layout { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.doc-form { display: grid; gap: 12px; padding: 18px; margin: 0; }
.doc-form label { display: grid; gap: 5px; font-size: .85rem; font-weight: 650; }
.doc-form label[hidden] { display: none !important; }
.doc-form .control, .rh-dialog .control { width: 100%; min-width: 0; }
.doc-form .form-row > label { min-width: 0; }
.doc-form .form-actions { flex-wrap: wrap; }
.doc-form .form-summary { margin: 0; }
.empresa { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.empresa summary { cursor: pointer; font-weight: 700; font-size: .88rem; }
.empresa[open] { display: grid; gap: 10px; }
.pdf-panel { position: sticky; top: 16px; margin: 0; height: calc(100vh - 140px); min-height: 520px; background: #525659; }
.pdf-panel iframe { width: 100%; height: 100%; border: 0; }
/* Baja */
.calc { display: grid; gap: 2px; padding: 14px; border-radius: 14px; background: #f8fafd; border: 1px solid var(--line); }
.calc h3 { margin: 0 0 6px; font-size: 1rem; }
.calc-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.calc-row b, .calc-row small { display: block; }
.calc-row small { color: var(--muted); font-size: .76rem; }
.calc-row > span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-row.total { border: 0; padding-top: 10px; font-size: 1.05rem; color: var(--purple-dark); }
.calc p { margin-top: 6px; font-size: .76rem; }
/* Expediente */
.file-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.doc-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
.doc { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 1px dashed #e2a0aa; border-radius: 10px; background: #fff7f8; color: #9a2a3a; font-size: .8rem; font-weight: 600; text-align: left; }
.doc::before { content: "✕"; display: grid; place-items: center; width: 18px; height: 18px; flex: none; border-radius: 50%; background: #fde8eb; font-size: .65rem; }
.doc.ok { border: 1px solid #cfe9db; background: #f2faf5; color: #1f6b45; }
.doc.ok::before { content: "✓"; background: #2fa36b; color: #fff; }
.timeline-list { position: relative; margin: 0; padding: 0 0 0 4px; list-style: none; }
.timeline-list::before { content: ""; position: absolute; left: 17px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-year { position: relative; margin: 12px 0 6px 40px; color: var(--purple-dark); font-size: .78rem; font-weight: 800; letter-spacing: .06em; }
.tl-item { position: relative; display: flex; gap: 12px; align-items: start; padding: 5px 0; }
.tl-ico { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--purple-wash); color: var(--purple-dark); font-size: .78rem; font-weight: 800; box-shadow: 0 0 0 3px #fff; }
.tl-item b, .tl-item small { display: block; }
.tl-item b { font-size: .88rem; }
.tl-item small { color: var(--muted); font-size: .78rem; }
.tl-item[data-kind="alta"] .tl-ico { background: var(--lime); color: #3d2a00; }
.tl-item[data-kind="up"] .tl-ico, .tl-item[data-kind="money"] .tl-ico { background: #e3f4ea; color: #1f6b45; }
.tl-item[data-kind="warn"] .tl-ico { background: #fde8eb; color: #b02a3e; }
.tl-item[data-kind="vac"] .tl-ico { background: #efe8fd; color: #6a3cc2; }
.tl-item[data-kind="learn"] .tl-ico { background: #e3f1fb; color: #1f5f8b; }
@media (max-width: 900px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .pdf-panel { position: static; height: 70vh; }
  .doc-list { grid-template-columns: 1fr; }
}
/* ---- Alta por pasos con gafete ---- */
.alta-dialog { width: min(940px, calc(100% - 24px)); padding: 0; overflow: hidden; }
.alta { display: grid; grid-template-columns: 330px minmax(0, 1fr); min-height: 600px; }
.alta-side { display: grid; align-content: start; gap: 18px; padding: 26px 24px; color: #fff; background: linear-gradient(180deg, #0b1a36 0%, #0f2650 60%, #0b1a36ee 100%), url("../planta-demo.png") center / cover; }
.alta-logo { width: 86px; }
.alta-side h2 { font-size: 1.5rem; letter-spacing: -.03em; }
.steps { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; counter-reset: paso; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 7px 0; color: #9fb0cf; font-size: .9rem; font-weight: 600; counter-increment: paso; }
.steps li::before { content: counter(paso); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #3b5285; font-size: .78rem; }
.steps li[data-state="now"] { color: #fff; }
.steps li[data-state="now"]::before { border-color: var(--lime); background: var(--lime); color: #3d2a00; }
.steps li[data-state="done"] { color: #d6e2ff; }
.steps li[data-state="done"]::before { content: "✓"; border-color: #2fa36b; background: #2fa36b; color: #fff; }
.badge-card { display: grid; justify-items: center; gap: 4px; margin-top: 6px; padding: 0 0 14px; border-radius: 18px; background: #fff; color: var(--ink); text-align: center; box-shadow: 0 18px 40px #0005; overflow: hidden; }
.bc-top { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px 14px 44px; background: linear-gradient(135deg, #0b1a36, #1d4fd8); }
.bc-top img { width: 46px; }
.bc-top span { color: #d6e2ff; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.bc-photo { display: grid; place-items: center; width: 92px; height: 92px; margin-top: -40px; border-radius: 50%; border: 4px solid #fff; background: var(--purple-wash) center / cover; color: var(--purple-dark); font-size: 1.6rem; font-weight: 800; box-shadow: 0 0 0 3px var(--lime); }
.badge-card > b { padding: 6px 14px 0; font-size: 1rem; line-height: 1.2; }
.badge-card > span { color: var(--muted); font-size: .8rem; }
.bc-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; font-size: .72rem; font-weight: 650; }
.bc-meta > span { padding: 3px 8px; border-radius: 99px; background: var(--purple-wash); color: var(--purple-dark); }
.bc-meta .bc-shift { background: color-mix(in srgb, var(--tone) 22%, #fff); color: var(--ink); }
.bc-foot { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 10px; padding: 10px 16px 0; border-top: 1px dashed var(--line); text-align: left; }
.bc-foot small { display: block; color: var(--muted); font-size: .66rem; }
.bc-foot b { font-size: 1.05rem; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.bc-foot svg { width: 54px; height: 54px; fill: var(--ink); }
.alta-main { position: relative; display: grid; grid-template-rows: 1fr auto auto; gap: 14px; padding: 30px 30px 24px; }
.alta-close { position: absolute; top: 14px; right: 14px; }
.alta-step { display: grid; align-content: start; gap: 12px; }
.alta-step[hidden] { display: none; }
.alta-step h3 { margin: -4px 0 6px; font-size: 1.45rem; letter-spacing: -.03em; }
.alta-step > label { display: grid; gap: 5px; font-size: .85rem; font-weight: 650; }
.alta .form-row label { display: grid; gap: 5px; font-size: .85rem; font-weight: 650; min-width: 0; }
.photo-pick { display: flex; align-items: center; gap: 16px; }
.photo-drop { cursor: pointer; }
.photo-drop span { display: grid; place-items: center; align-content: center; width: 96px; height: 96px; border: 2px dashed #b9c6dd; border-radius: 50%; background: #f6f8fb center / cover; color: var(--purple); font-size: 1.6rem; font-weight: 300; line-height: 1; }
.photo-drop span small { font-size: .75rem; font-weight: 700; margin-top: 2px; }
.photo-drop:hover span { border-color: var(--purple); }
.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pick-list { display: grid; gap: 8px; }
.pick { position: relative; display: grid; gap: 2px; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; text-align: left; }
.pick b { font-size: .9rem; }
.pick small { color: var(--muted); font-size: .76rem; }
.pick:hover { border-color: #9db4e8; }
.pick[aria-pressed="true"] { border-color: var(--purple); background: var(--purple-wash); box-shadow: 0 0 0 3px #1d4fd81f; }
.pick[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 9px; right: 10px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--purple); color: #fff; font-size: .7rem; font-weight: 800; }
.pick-grid.three .pick { border-top: 5px solid var(--tone); }
.money-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.money-strip div { display: grid; padding: 10px 12px; border-radius: 12px; background: var(--purple-wash); }
.money-strip small { color: var(--muted); font-size: .74rem; }
.money-strip b { font-size: 1.05rem; color: var(--purple-dark); }
#a-docs { grid-template-columns: repeat(2, 1fr); display: grid; gap: 6px; }
.alta-nav { display: flex; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 800px) {
  .alta { grid-template-columns: 1fr; }
  .alta-side { grid-template-columns: 1fr; }
  .badge-card { display: none; }
  .pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.alta .form-summary[hidden] { display: none; }
.alta-nav .control { width: auto; }
/* ---- Expediente con portada y pestañas ---- */
dialog#detalle.expediente { width: min(1040px, calc(100% - 24px)); max-height: 92vh; padding: 0; overflow: auto; }
.expediente .file-head { margin: 0; padding: 30px 64px 26px 28px; gap: 20px; background: linear-gradient(90deg, #0b1a36f5 0%, #0b1a36d0 45%, #0b1a3660 100%), url("../planta-demo.png") center 35% / cover; }
.expediente .file-head .portrait { width: 104px; box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--lime); }
.expediente .file-head .eyebrow { color: var(--lime); margin-bottom: 2px; }
.expediente .file-head h2 { font-size: 1.7rem; letter-spacing: -.03em; }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fchip { padding: 4px 10px; border-radius: 99px; background: #ffffff1f; color: #fff; font-size: .76rem; font-weight: 650; backdrop-filter: blur(6px); }
.fchip[data-k="dept"] { background: var(--dept); }
.fchip[data-k="warn"] { background: #f5b324; color: #3d2a00; }
.fchip[data-k="ok"] { background: #2fa36b; }
.profile-body { display: grid; grid-template-columns: 290px minmax(0, 1fr); }
.profile-side { padding: 4px 22px 24px; background: #f6f8fb; border-right: 1px solid var(--line); }
.profile-side .file-actions { flex-direction: column; margin-top: 0; }
.profile-side .file-actions button { width: 100%; text-align: left; }
.profile-side .details { grid-template-columns: 1fr; gap: 10px; }
.profile-side .details dd { font-size: 1.05rem; }
.profile-main { padding: 18px 26px 26px; min-width: 0; }
.profile-main > .tabs { width: fit-content; margin-bottom: 4px; }
.profile-main [data-dpane][hidden] { display: none; }
#hist-detalle > p { margin: 16px 0 6px; }
.doc-progress { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 12px; margin: 16px 0 14px; padding: 14px 16px; border-radius: 14px; background: var(--purple-wash); }
.doc-progress b { grid-row: span 2; font-size: 1.8rem; letter-spacing: -.04em; color: var(--purple-dark); }
.doc-progress span { font-size: .86rem; font-weight: 600; }
.expediente .day-card { margin-top: 14px; }
@media (max-width: 800px) {
  .profile-body { grid-template-columns: 1fr; }
  .profile-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .expediente .file-head { flex-wrap: wrap; }
}
/* ---- Contratos: plantillas e historial ---- */
.tpl-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tpl { display: grid; gap: 12px; padding: 14px; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); text-align: left; transition: transform .15s, border-color .15s; }
.tpl:hover { transform: translateY(-2px); border-color: #9db4e8; }
.tpl[aria-checked="true"] { border-color: var(--tone); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 25%, transparent), var(--shadow); }
.tpl-page { display: grid; align-content: start; gap: 5px; height: 92px; padding: 0 12px 10px; border-radius: 8px; background: #f6f8fb; border: 1px solid var(--line); overflow: hidden; }
.tpl-band { display: block; height: 16px; margin: 0 -12px 6px; background: linear-gradient(90deg, #0b1a36, var(--tone)); }
.tpl-line { display: block; height: 4px; border-radius: 3px; background: #d5dceb; }
.tpl-text b, .tpl-text small, .tpl-text em { display: block; }
.tpl-text b { font-size: .92rem; }
.tpl-text small { margin-top: 2px; color: var(--muted); font-size: .76rem; line-height: 1.3; }
.tpl-text em { margin-top: 6px; color: color-mix(in srgb, var(--tone) 80%, #000); font-size: .72rem; font-style: normal; font-weight: 700; }
.gen-panel { margin-top: 16px; }
.gen-list { display: grid; gap: 0; margin: 0; padding: 0 20px 12px; list-style: none; }
.gen { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 10px 0 10px 14px; border-top: 1px solid var(--line); border-left: 4px solid var(--tone); }
.gen-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gen-who .portrait { width: 36px; }
.gen-who b, .gen-who small { display: block; }
.gen-who small { color: var(--muted); font-size: .78rem; }
.gen-when { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .tpl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gen { grid-template-columns: 1fr; gap: 4px; } }
/* Botones del formulario de contratos: mismo tamaño, lado a lado */
.doc-form .form-actions > button { flex: 1 1 140px; width: auto; justify-content: center; text-align: center; }
/* Plantillas en celular: tira deslizable para no empujar el formulario hasta abajo */
@media (max-width: 720px) {
  .tpl-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 58%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .tpl-grid > * { scroll-snap-align: start; }
}
