/* =============================================================
   CheckNomina - componentes reutilizables
   CSS plano (funciona con Tailwind CDN o compilado)
   ============================================================= */

[x-cloak] { display: none !important; }

body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; }

.tabular-nums { font-variant-numeric: tabular-nums; }

/* Scrollbar del sidebar */
.sidebar-scrollbar::-webkit-scrollbar { width: 4px; }
.sidebar-scrollbar::-webkit-scrollbar-track { background: transparent; }
.sidebar-scrollbar::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

/* ---------- Formularios ---------- */
.form-label {
    display: block;
    margin-bottom: .375rem;
    font-size: .875rem;
    font-weight: 500;
    color: #374151;
}
.form-input {
    display: block;
    width: 100%;
    border-radius: .5rem;
    border: 1px solid #d1d5db;
    background: #fff;
    padding: .5rem .75rem;
    font-size: .875rem;
    line-height: 1.25rem;
    color: #111827;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
    transition: border-color .15s, box-shadow .15s;
}
.form-input::placeholder { color: #9ca3af; }
.form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgb(99 102 241 / .2);
}
.form-input:disabled { background: #f9fafb; color: #6b7280; }
.form-input.is-invalid { border-color: #f87171; }
.form-input.is-invalid:focus { box-shadow: 0 0 0 3px rgb(248 113 113 / .2); }
.form-help { margin-top: .25rem; font-size: .75rem; color: #6b7280; }
.form-error { margin-top: .25rem; font-size: .75rem; font-weight: 500; color: #dc2626; }

.form-checkbox {
    height: 1rem; width: 1rem;
    border-radius: .25rem;
    border: 1px solid #d1d5db;
    accent-color: #4f46e5;
}

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border-radius: .5rem;
    padding: .5rem 1rem;
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.25rem;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
    transition: background-color .15s, border-color .15s, color .15s, opacity .15s;
    cursor: pointer;
    white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 1rem; height: 1rem; }
.btn-primary { background: #4f46e5; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #4338ca; }
.btn-secondary { background: #fff; color: #374151; border-color: #d1d5db; }
.btn-secondary:hover:not(:disabled) { background: #f9fafb; }
.btn-dark { background: #1f2937; color: #fff; }
.btn-dark:hover:not(:disabled) { background: #374151; }
.btn-success { background: #059669; color: #fff; }
.btn-success:hover:not(:disabled) { background: #047857; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-sm { padding: .375rem .75rem; font-size: .8125rem; }

.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: .5rem; padding: .375rem; color: #9ca3af;
    transition: background-color .15s, color .15s;
}
.btn-icon:hover { background: #f3f4f6; color: #4b5563; }
.btn-icon svg { width: 1rem; height: 1rem; }

/* ---------- Tarjetas y tablas ---------- */
.card {
    border-radius: .75rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
}
.table { min-width: 100%; border-collapse: separate; border-spacing: 0; }
.table thead th {
    background: #f9fafb;
    padding: .75rem 1rem;
    text-align: left;
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
.table tbody td {
    padding: .75rem 1rem;
    font-size: .875rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #f9fafb; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: .25rem;
    border-radius: 9999px;
    padding: .125rem .625rem;
    font-size: .75rem; font-weight: 500;
    white-space: nowrap;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-amber  { background: #fef3c7; color: #b45309; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-sky    { background: #e0f2fe; color: #0369a1; }
.badge-purple { background: #f3e8ff; color: #7e22ce; }
.badge-gray   { background: #f3f4f6; color: #4b5563; }
.badge-indigo { background: #e0e7ff; color: #4338ca; }

/* ---------- Reloj checador ---------- */
.punch-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border-radius: 1rem;
    padding: 1.25rem 1rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 10px 25px -10px rgb(0 0 0 / .35);
    transition: transform .12s, box-shadow .12s, opacity .15s;
    -webkit-tap-highlight-color: transparent;
}
.punch-btn:active:not(:disabled) { transform: scale(.97); }
.punch-btn:disabled { opacity: .5; cursor: not-allowed; }
.punch-btn svg { width: 2rem; height: 2rem; }

@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgb(99 102 241 / .45); }
    70%  { box-shadow: 0 0 0 14px rgb(99 102 241 / 0); }
    100% { box-shadow: 0 0 0 0 rgb(99 102 241 / 0); }
}
.pulse-ring { animation: pulse-ring 2s infinite; }

@media print {
    aside, header, footer, .no-print { display: none !important; }
    main { padding: 0 !important; overflow: visible !important; }
    .lg\:ml-64, .lg\:ml-20 { margin-left: 0 !important; }
}
