/* gestionTRAK · Planillas (usa también los estilos base de cxc.css) */
.planilla .pl-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; }
.planilla .pl-tabla td { vertical-align: middle; }
.planilla .pl-tabla td.mono { white-space: nowrap; }
.planilla .pl-tabla td.m, .planilla .pl-tabla th.m { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.planilla .pl-tabla tr.pl-total td { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--line); }
.planilla .pl-tabla tr.pl-sep td { background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; }
.planilla tr.pl-inactivo td { color: var(--muted); }
.planilla .pl-alerta { color: var(--bad, #b42318); font-weight: 600; }
p.pl-alerta { margin: 8px 0; }
.planilla .pl-neg { color: var(--bad, #b42318); }

/* Formularios */
.planilla .pl-form, .planilla .pl-carga, .planilla .pl-paso1, .planilla .pl-config { margin-bottom: 14px; }
.planilla .pl-form-cab { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-bottom: 10px; }
.planilla .pl-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; }
.planilla .pl-total-form { padding: 8px 0; font-family: var(--f-mono); font-weight: 600; }
.planilla .pl-carga-res { margin: 6px 0 8px; }
.planilla .pl-errores { margin: 6px 0; padding-left: 18px; color: var(--bad, #b42318); font-size: 13px; }
.planilla .pl-det { margin: 8px 0; font-size: 13px; }
.planilla .pl-det ul { margin: 6px 0; padding-left: 18px; max-height: 240px; overflow: auto; }
.planilla .pl-progreso { height: 8px; margin: 10px 0 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.planilla .pl-progreso div { height: 100%; background: var(--accent); transition: width .2s; }

/* Planilla del mes */
.planilla .pl-periodo { margin-bottom: 8px; }
.planilla .pl-cabmes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 4px 0 10px; }
.planilla .pl-cabmes h2 { margin: 0 6px 0 0; font-size: 20px; }
.planilla .pl-pasos { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.planilla .pl-pasos button { padding: 8px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--fg); font-weight: 600; cursor: pointer; }
.planilla .pl-pasos button[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.planilla .pl-pasoinfo { margin-bottom: 10px; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 6px 6px 0; font-size: 14px; }
.planilla .pl-acc { margin-bottom: 10px; align-items: center; flex-wrap: wrap; }
.planilla .pl-aviso { margin-bottom: 12px; border-left: 3px solid var(--warn, #b54708); }
.planilla .pl-aviso ul { margin: 6px 0 10px; padding-left: 18px; }
.planilla .pl-resumen { margin: 10px 0; }
.planilla .pl-confirma { display: block; margin: 8px 0 12px; font-weight: 600; }
.planilla .pl-num { width: 96px; padding: 5px 6px; text-align: right; font-family: var(--f-mono); font-size: 13px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--fg); }
.planilla .pl-num.pl-mod { border-color: var(--accent); background: var(--accent-soft); }
.planilla .pl-guardar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--accent); border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.planilla .pl-guardar span { font-weight: 600; margin-right: auto; }
.planilla .pl-mensual th { white-space: normal; min-width: 84px; }
.planilla .pl-col-tot { background: var(--accent-soft); }

/* Boletas */
.planilla .pl-tipos { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 10px; }
.planilla .pl-tipos button { padding: 8px 16px; border: 0; background: var(--surface); color: var(--fg); font-weight: 600; cursor: pointer; }
.planilla .pl-tipos button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); }
.planilla .pl-vista { margin: 10px 0 14px; }
.pl-boleta { position: relative; max-width: 760px; padding: 22px 26px; background: #ffffff; color: #222; border: 1px solid #d6d4d8; border-top: 5px solid #7b1e34; border-radius: 4px; overflow: hidden; }
.pl-boleta .pl-borrador { position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); font-size: 64px; font-weight: 800; color: rgba(0,0,0,.07); pointer-events: none; }
.pl-b-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pl-b-cab img { width: 84px; height: 84px; object-fit: contain; }
.pl-b-tit { font-size: 20px; font-weight: 800; color: #7b1e34; letter-spacing: .02em; }
.pl-b-emp { font-weight: 700; margin-top: 2px; }
.pl-b-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; margin: 14px 0; font-size: 13px; }
.pl-b-datos span { display: inline-block; min-width: 130px; color: #666; }
.pl-b-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pl-b-cols table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pl-b-cols th { text-align: left; padding: 5px 8px; background: #7b1e34; color: #fff; font-size: 12px; letter-spacing: .04em; }
.pl-b-cols table + table th { background: #45444b; }
.pl-b-cols td { padding: 4px 8px; border-bottom: 1px solid #eee; color: #222; }
.pl-b-cols td.m { text-align: right; font-family: var(--f-mono); white-space: nowrap; }
.pl-b-cols tr.t td { font-weight: 700; border-top: 2px solid #7b1e34; border-bottom: 0; }
.pl-b-liq { display: flex; justify-content: space-between; margin-top: 14px; padding: 10px 12px; background: #f6eaed; color: #7b1e34; font-size: 17px; font-weight: 700; }
.pl-b-liq b { font-family: var(--f-mono); }
.pl-b-firma { margin-top: 26px; text-align: right; font-size: 12px; color: #555; }

/* Bitácora y configuración */
.planilla .pl-diff { font-size: 13px; min-width: 260px; }
.planilla .pl-config { max-width: 640px; display: grid; gap: 12px; }
.planilla .pl-config h2 { margin: 0; font-size: 18px; }
.planilla .pl-logo { display: flex; align-items: center; justify-content: center; width: 120px; height: 120px; margin: 6px 0; border: 1px dashed var(--line); border-radius: 6px; background: #fff; }
.planilla .pl-logo img { max-width: 110px; max-height: 110px; }

@media (max-width: 900px) { .planilla .pl-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .planilla .pl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .planilla .pl-form-grid, .pl-b-datos, .pl-b-cols { grid-template-columns: minmax(0, 1fr); }
  .planilla .pl-kpis { grid-template-columns: minmax(0, 1fr); }
  .pl-boleta { padding: 16px; }
}
