/* Estilos de la app de sueldos. Sin dependencias externas. */
:root {
  --fondo: #f6f7f9;
  --superficie: #ffffff;
  --texto: #1d2330;
  --suave: #5b6475;
  --borde: #d9dde5;
  --acento: #2457a6;
  --acento-texto: #ffffff;
  --error: #b42318;
  --error-fondo: #fdecea;
  --ok: #1d7a3a;
  --ok-fondo: #e8f5ec;
  --cerrado: #8a5a00;
  --cerrado-fondo: #fff4dc;
  --foco: #f5b400;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fondo);
  color: var(--texto);
}
main { padding: 16px 24px 48px; max-width: 1400px; margin: 0 auto; }
h1 { font-size: 1.5rem; margin: 8px 0 16px; }
h2 { font-size: 1.15rem; margin: 24px 0 8px; }
a { color: var(--acento); }

.barra {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 10px 24px; background: var(--superficie); border-bottom: 1px solid var(--borde);
}
.barra .marca { font-weight: 700; text-decoration: none; color: var(--texto); }
.barra nav { display: flex; gap: 16px; flex-wrap: wrap; flex: 1; }
.barra nav a { text-decoration: none; }
.barra nav a.activo { font-weight: 600; text-decoration: underline; }
.salir { display: flex; align-items: center; gap: 8px; color: var(--suave); }

.tarjeta {
  background: var(--superficie); border: 1px solid var(--borde); border-radius: 8px;
  padding: 20px 24px; max-width: 720px;
}
.login { max-width: 360px; margin: 64px auto; }
.login form { display: grid; gap: 12px; }

label { display: grid; gap: 4px; font-weight: 500; }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  padding: 6px 8px; border: 1px solid var(--borde); border-radius: 6px; background: var(--superficie); color: var(--texto);
}
button, .boton {
  display: inline-block; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--acento);
  background: var(--acento); color: var(--acento-texto); cursor: pointer; text-decoration: none;
}
button.secundario, .boton.secundario { background: var(--superficie); color: var(--acento); }
button.peligro { background: var(--error); border-color: var(--error); }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 1px; }

.aviso { padding: 10px 14px; border-radius: 6px; margin: 0 0 12px; }
.aviso-error { background: var(--error-fondo); color: var(--error); }
.aviso-ok { background: var(--ok-fondo); color: var(--ok); }
.aviso-info { background: var(--cerrado-fondo); color: var(--cerrado); }

.filtros { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 16px; }

.tabla { border-collapse: collapse; width: 100%; background: var(--superficie); }
.tabla th, .tabla td { border: 1px solid var(--borde); padding: 6px 8px; text-align: left; vertical-align: top; }
.tabla th { background: #eef1f6; font-weight: 600; }
.tabla td.num, .tabla th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla tfoot td { font-weight: 700; background: #eef1f6; }
.tabla code { font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.nowrap { white-space: nowrap; }
.inactivo { color: var(--suave); }
.negativo { color: var(--error); }

@media print {
  .no-imprimir { display: none !important; }
  body { background: #fff; font-size: 12px; }
  main { padding: 0; max-width: none; }
  .tabla th { background: #eee; }
}

/* --- Pantallas (etapa 3) --- */
small, .suave { color: var(--suave); }
.ayuda { color: var(--suave); margin: 4px 0 12px; }
.encabezado { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.encabezado h1 { margin: 8px 0; }
.periodo { display: flex; gap: 6px; align-items: center; }
.periodo .anio { width: 6em; }
.etiqueta { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; vertical-align: middle; background: #eef1f6; color: var(--suave); }
.etiqueta.cerrado { background: var(--cerrado-fondo); color: var(--cerrado); }
.etiqueta.borrador { background: var(--ok-fondo); color: var(--ok); }
.columnas { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.tarjeta.ancha { max-width: none; margin-bottom: 16px; }
.grilla-form { display: grid; gap: 12px; }
.fila-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.fila-form .ancho { flex: 1 1 220px; }
fieldset { border: 1px solid var(--borde); border-radius: 6px; display: grid; gap: 12px; padding: 12px; }
.acciones { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 16px 0; }
.corto { width: 6em; }
.medio { width: 9em; }
.mini { width: 3.5em; }
.cuotas { display: flex; gap: 6px; align-items: center; font-weight: 400; }
.centro { text-align: center; }
.en-linea { display: inline; }
button.enlace { background: none; border: none; padding: 0; color: var(--acento); text-decoration: underline; }
button.enlace.peligro-texto { color: var(--error); margin-left: 8px; }
.accesos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.acceso { display: grid; gap: 4px; text-decoration: none; color: var(--texto); }
.acceso:hover { border-color: var(--acento); }
.acceso span { color: var(--suave); }
ul.aviso { padding-left: 32px; }

/* Grilla de horas */
.grilla-horas { width: auto; }
.grilla-horas td.celda { padding: 0; }
.grilla-horas td.celda input { width: 6.5em; border: 0; border-radius: 0; text-align: right; padding: 6px 8px; background: transparent; font-variant-numeric: tabular-nums; }
.grilla-horas td.celda input:focus { background: #fff8db; }
.grilla-horas td.con-error { background: var(--error-fondo); }
.grilla-horas tr.finde th, .grilla-horas tr.finde td { background: #f1f3f7; }
.grilla-horas tr.tipo-vacaciones th { box-shadow: inset 4px 0 0 #2e90fa; }
.grilla-horas tr.tipo-feriado th { box-shadow: inset 4px 0 0 #f79009; }
.grilla-horas select { padding: 3px 4px; }
.grilla-horas input.obs { width: 16em; }
.grilla-horas input[readonly] { color: var(--suave); }
.grilla-horas thead th { position: sticky; top: 0; z-index: 1; }

/* Liquidación y vista imprimible */
.tabla.resumen { max-width: 520px; }
.tabla.resumen th { width: 60%; background: none; font-weight: 500; }
.tabla.resumen tr.destacado th, .tabla.resumen tr.destacado td { font-weight: 700; background: #eef1f6; }
.tabla.compacta { width: auto; min-width: 360px; }
.hoja { background: #fff; max-width: 820px; margin: 0 auto; padding: 24px; }
.barra-impresion { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cabecera-hoja h1 { margin-bottom: 4px; }
.pie-hoja { display: flex; gap: 48px; margin-top: 72px; }
.firma { flex: 1; border-top: 1px solid var(--texto); padding-top: 6px; text-align: center; color: var(--suave); }
@media print {
  .hoja { padding: 0; max-width: none; }
  .tabla.resumen, .tabla.compacta { max-width: none; }
  a { color: inherit; text-decoration: none; }
}
.boton.chico { padding: 3px 10px; font-size: 13px; }

/* Fichadas de reloj */
.subidas { display: flex; flex-wrap: wrap; gap: 16px; }
.subida { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--borde); border-radius: 6px; min-width: 260px; }
.tarjeta.alerta { border-color: var(--error); }
details.tarjeta { margin-bottom: 16px; }
details.tarjeta summary { cursor: pointer; font-weight: 600; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 4px; }
.chip { padding: 3px 10px; border-radius: 999px; background: #eef1f6; color: var(--suave); font-size: 13px; font-weight: 600; }
.chip-rojo { background: var(--error-fondo); color: var(--error); }
.chip-verde { background: var(--ok-fondo); color: var(--ok); }
label.check { display: flex; align-items: center; gap: 6px; flex-direction: row; }
input.hora { width: 5em; text-align: center; font-variant-numeric: tabular-nums; }
input.motivo { width: 9em; }
.tabla.fichadas td { vertical-align: middle; }
.tabla.fichadas tr.dudoso td { background: var(--error-fondo); }
.tabla.fichadas tr.dudoso td:first-child { box-shadow: inset 4px 0 0 var(--error); }
.tabla.fichadas tr.anulado td { color: var(--suave); text-decoration: line-through; }
.tabla.fichadas tr.anulado td.acciones-fila, .tabla.fichadas tr.anulado td.obs-reloj { text-decoration: none; }
.tabla.fichadas tr.confirmado td:first-child { box-shadow: inset 4px 0 0 var(--ok); }
.acciones-fila form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.obs-reloj { font-size: 13px; max-width: 320px; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* Celdas de la grilla que vienen del reloj (solo lectura) */
.grilla-horas td.celda.reloj { background: #eef1f6; text-align: right; padding: 6px 8px; color: var(--texto); font-variant-numeric: tabular-nums; cursor: help; }
.grilla-horas td.celda.reloj::after { content: " ⏱"; font-size: 11px; color: var(--suave); }
