/* NomiClock — componentes base en CSS puro, para las apps sin Tailwind (nómina y trabajador).
   Reproduce las clases del panel (panel/src/tailwind-input.css) con las mismas medidas.
   Requiere marca-tokens.css (se carga antes). COPIA IDÉNTICA en nomina/ y trabajador/: editar una, copiar a la otra y verificar con cmp.
   Sin estilos en línea: la CSP de estos targets no los permite. */

/* ---------- foco único (igual que panel y kiosco): doble anillo, blanco pegado y navy por fuera ---------- */
:is(a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 2px solid var(--color-primary-container) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 2px var(--blanco) !important;
}

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: var(--radio-md); border: 1px solid transparent; font-family: var(--fuente-titulos); font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: .04em; white-space: nowrap; user-select: none; cursor: pointer; text-decoration: none; transition: background-color .15s ease-out, box-shadow .15s ease-out, filter .15s ease-out, transform .15s ease-out; }
.btn:active { transform: scale(.95); }
.btn .material-symbols-outlined, .btn .msym, .btn .icon { font-size: 18px; line-height: 1; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 12px; line-height: 16px; letter-spacing: .06em; }
.btn-sm .material-symbols-outlined, .btn-sm .msym, .btn-sm .icon { font-size: 16px; }
.btn-lg { height: 48px; padding: 0 20px; }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--color-primary-container); color: var(--color-on-primary); box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.btn-primary:hover { background: var(--color-primary); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1); }
.btn-secondary { background: var(--color-surface-container-lowest); border-color: var(--color-outline); color: var(--color-primary); }
.btn-secondary:hover { background: var(--color-surface-container-low); }
.btn-danger { background: var(--color-error); color: var(--color-on-error); box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.btn-danger:hover { filter: brightness(.9); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1); }
.btn-danger-outline { background: var(--color-surface-container-lowest); border-color: var(--color-error); color: var(--color-error); }
.btn-danger-outline:hover { background: var(--color-error-container); }
.btn-accent { background: var(--color-secondary-container); color: var(--color-on-secondary-container); box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.btn-accent:hover { filter: brightness(.95); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1); }
.btn-success { background: var(--color-tertiary-container); color: var(--color-on-primary); box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.btn-success:hover { background: var(--color-tertiary); }
.btn-ghost { background: transparent; color: var(--color-primary); }
.btn-ghost:hover { background: var(--color-surface-container-low); }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 9999px; background: var(--color-surface-container); color: var(--color-on-surface-variant); }
.btn-icon:hover { background: var(--color-surface-container-high); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn:disabled:active { transform: none; }
.btn[aria-busy="true"] { cursor: progress; pointer-events: none; }
.btn[aria-busy="true"]:disabled { opacity: .8; }
.btn .spinner { width: 18px; height: 18px; border-color: currentColor; border-top-color: transparent; opacity: .85; }
@media (pointer: coarse) { .btn { min-height: 44px; } .btn-icon { min-width: 44px; } }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:active { transform: none; } }

/* ---------- campos ---------- */
.campo label { display: block; margin-bottom: 5px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--color-on-surface-variant); }
.campo input, .campo select { width: 100%; height: 46px; padding: 0 12px; border: 1px solid var(--color-outline-variant); border-radius: var(--radio-md); background: var(--color-surface-container-lowest); color: var(--color-on-surface); font: inherit; }

/* ---------- tarjeta ---------- */
.card { background: var(--color-surface-container-lowest); border: 1px solid var(--color-outline-variant); border-radius: var(--radio-md); padding: var(--card-pad, 16px); box-shadow: 0 1px 3px rgba(22, 50, 91, .08); }

/* ---------- chips de estado (siempre con texto) ---------- */
.chip-ok, .chip-aviso, .chip-error, .chip-info, .chip-neutro { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 9999px; font-family: var(--fuente-titulos); font-size: 11px; font-weight: 700; white-space: nowrap; }
.chip-ok { background: var(--color-tertiary-fixed); color: var(--color-ok-texto); }
.chip-aviso { background: var(--color-secondary-fixed); color: var(--color-ambar-texto); }
.chip-error { background: var(--color-error-container); color: var(--color-on-error-container); }
.chip-info { background: var(--color-primary-fixed); color: var(--color-on-primary-fixed-variant); }
.chip-neutro { background: var(--color-surface-container); color: var(--color-on-surface-variant); }

/* ---------- toast (zona #toasts; JS: toast(msg, 'info'|'ok'|'error'|'warning')) ---------- */
#toasts { position: fixed; bottom: calc(5rem + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; width: calc(100% - 2rem); max-width: 420px; }
.toast { padding: .75rem 1rem; border-radius: var(--radio-md); font-family: var(--fuente-texto); font-size: 14px; font-weight: 500; color: var(--blanco); background: var(--color-primary-container); box-shadow: 0 4px 20px rgba(0, 0, 0, .18); opacity: 0; transform: translateY(12px); animation: toast-in .3s ease forwards, toast-out .3s ease 3.2s forwards; }
.toast-ok { background: var(--color-ok-texto); }
.toast-error { background: var(--color-error); }
.toast-warning { background: var(--color-ambar-texto); }
@keyframes toast-in { to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-8px); } }

/* ---------- velo y hoja (modal): hoja inferior en celular, centrada desde 640 px ---------- */
.velo { position: fixed; inset: 0; z-index: 80; background: var(--velo); display: flex; align-items: flex-end; justify-content: center; }
.hoja { background: var(--color-surface-container-lowest); width: 100%; max-width: 520px; max-height: 92dvh; overflow: auto; border-radius: var(--radio-lg) var(--radio-lg) 0 0; padding: 22px; }
@media (min-width: 640px) { .velo { align-items: center; } .hoja { border-radius: var(--radio-lg); } }

/* ---------- tabla: encabezado fijo, cifras a la derecha y tabulares ---------- */
.tabla, .tw > table { width: 100%; border-collapse: collapse; }
.tabla th, .tabla td, .tw > table th, .tw > table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--color-outline-variant); font-size: 13px; }
.tabla th, .tw > table th { position: sticky; top: 0; background: var(--brand-navy-light); color: var(--color-primary-container); font-family: var(--fuente-titulos); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.tabla .num, .tw > table .num { text-align: right; font-variant-numeric: tabular-nums; }
.tabla tfoot td, .tw > table tfoot td { font-weight: 700; }
