/* ==============================================================
   ACCOUNTING.CSS — TuEstilo
   Módulo de Contabilidad y Nómina: modal configuración, dashboard,
   cards de trabajadores, KPIs, períodos, exportación PDF
   ============================================================== */

/* ── Modal de Configuración de Nómina ──────────────────────── */
.payroll-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.payroll-modal-overlay.is-open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.payroll-modal-sheet {
  background: #fff;
  width: 100%;
  max-width: 420px;
  max-height: 92vh;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.payroll-modal-overlay.is-open .payroll-modal-sheet {
  transform: translateY(0);
}

@media (min-width: 640px) {
  .payroll-modal-overlay {
    align-items: center;
  }
  .payroll-modal-sheet {
    border-radius: 16px;
    max-height: 85vh;
    transform: translateY(20px) scale(0.97);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.2s ease;
  }
  .payroll-modal-overlay.is-open .payroll-modal-sheet {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Header */
.payroll-modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}
.payroll-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}
.payroll-modal-subtitle {
  font-size: 0.8rem;
  color: #64748b;
  margin: 2px 0 0;
}
.payroll-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s;
}
.payroll-modal-close:hover {
  background: #e2e8f0;
  color: #334155;
}

/* Body */
.payroll-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  -webkit-overflow-scrolling: touch;
}

/* Secciones del formulario */
.payroll-section {
  margin-bottom: 24px;
}
.payroll-section:last-child {
  margin-bottom: 0;
}
.payroll-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin: 0 0 4px;
}
.payroll-section-hint-top {
  font-size: 0.72rem;
  color: #64748b;
  margin: 0 0 10px;
  line-height: 1.35;
}
.payroll-section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* ── Cards de tipo de vínculo (radio visual) ────────────────── */
.payroll-vinculo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.payroll-vinculo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 6px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.payroll-vinculo-card:hover {
  border-color: #c7d2fe;
  background: #fafbff;
}
.payroll-vinculo-card.is-selected {
  border-color: #6366f1;
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.payroll-vinculo-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.payroll-vinculo-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.payroll-vinculo-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  line-height: 1.2;
}
.payroll-vinculo-desc {
  font-size: 0.62rem;
  color: #94a3b8;
  line-height: 1.25;
}

/* ── Comisión input con +/- ─────────────────────────────────── */
.payroll-comision-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.payroll-comision-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}
.payroll-comision-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
  background: #eef2ff;
}
.payroll-comision-btn:active {
  transform: scale(0.92);
}
.payroll-comision-display {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1e293b;
  min-width: 80px;
  text-align: center;
  letter-spacing: -0.02em;
}
.payroll-comision-hint {
  font-size: 0.75rem;
  color: #64748b;
  text-align: center;
  margin-top: 8px;
  line-height: 1.4;
}
.payroll-comision-hint strong {
  color: #6366f1;
  font-weight: 700;
}

/* ── Período pills ──────────────────────────────────────────── */
.payroll-periodo-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.payroll-periodo-pill {
  flex: 1;
  min-width: 0;
  padding: 10px 6px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.payroll-periodo-pill:hover {
  border-color: #c7d2fe;
  background: #fafbff;
}
.payroll-periodo-pill.is-selected {
  border-color: #6366f1;
  background: #6366f1;
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ── Seguridad social (radio list) ──────────────────────────── */
.payroll-ss-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
  background: #fff;
}
.payroll-ss-option:last-child {
  margin-bottom: 0;
}
.payroll-ss-option:hover {
  border-color: #c7d2fe;
}
.payroll-ss-option.is-selected {
  border-color: #6366f1;
  background: #eef2ff;
}
.payroll-ss-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.payroll-ss-option.is-selected .payroll-ss-radio {
  border-color: #6366f1;
  background: #6366f1;
}
.payroll-ss-option.is-selected .payroll-ss-radio::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}
.payroll-ss-text {
  flex: 1;
  min-width: 0;
}
.payroll-ss-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  margin: 0;
}
.payroll-ss-desc {
  font-size: 0.7rem;
  color: #94a3b8;
  margin: 2px 0 0;
  line-height: 1.3;
}

/* ── Input de salario base ──────────────────────────────────── */
.payroll-salary-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  outline: none;
  transition: border-color 0.15s;
}
.payroll-salary-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.payroll-salary-hint {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 6px;
}

/* ── Propinas pills ─────────────────────────────────────────── */
.payroll-propinas-grid {
  display: flex;
  gap: 6px;
}
.payroll-propinas-pill {
  flex: 1;
  padding: 10px 6px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.payroll-propinas-pill:hover {
  border-color: #c7d2fe;
}
.payroll-propinas-pill.is-selected {
  border-color: #6366f1;
  background: #6366f1;
  color: #fff;
}

/* ── Monto arriendo ─────────────────────────────────────────── */
.payroll-arriendo-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  outline: none;
  transition: border-color 0.15s;
}
.payroll-arriendo-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* ── Botón guardar ──────────────────────────────────────────── */
.payroll-modal-footer {
  flex-shrink: 0;
  padding: 16px 20px;
  border-top: 1px solid #f1f5f9;
}
.payroll-save-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.payroll-save-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}
.payroll-save-btn:active {
  transform: translateY(0);
}
.payroll-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── Condicional: ocultar secciones ─────────────────────────── */
.payroll-section[data-show-for] {
  display: none;
}
.payroll-section[data-show-for].is-visible {
  display: block;
}

/* ── Staff card: botón de configurar nómina ──────────────────── */
.team-card-payroll-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #6366f1;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 4px;
}
.team-card-payroll-btn:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
}
.team-card-payroll-btn svg {
  width: 12px;
  height: 12px;
}

/* ==============================================================
   DASHBOARD DE CONTABILIDAD — Tabs, KPIs, Worker Cards, Pay Run
   ============================================================== */

/* ── Tabs Estadísticas / Contabilidad ──────────────────────── */
.acct-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
}
.acct-tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.acct-tab:hover {
  color: #334155;
}
.acct-tab--active {
  background: #fff;
  color: #1e293b;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

/* ── Selector de Período ────────────────────────────────────── */
.acct-period-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 0;
  margin-bottom: 16px;
}
.acct-period-arrow {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}
.acct-period-arrow:hover {
  border-color: #6366f1;
  color: #6366f1;
  background: #eef2ff;
}
.acct-period-label {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  min-width: 180px;
  text-align: center;
}

/* ── KPIs de Contabilidad ───────────────────────────────────── */
.acct-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.acct-kpi-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px 14px;
  border: 1px solid #e2e8f0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.acct-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.acct-kpi--blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.acct-kpi--purple::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.acct-kpi--green::before { background: linear-gradient(90deg, #10b981, #34d399); }

.acct-kpi-icon {
  font-size: 1.3rem;
  display: block;
  margin-bottom: 4px;
}
.acct-kpi-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 4px;
}
.acct-kpi-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
  letter-spacing: -0.02em;
}
.acct-kpi--orange::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.acct-kpi--dark::before { background: linear-gradient(90deg, #1e293b, #475569); }
.acct-kpi--dark .acct-kpi-value { color: #1e293b; }

/* ── Provisión colapsable en worker card ── */
.acct-provision-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-top: 4px;
  background: #FFFBEB;
  border: 1px solid #F3E8C0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: #92400E;
  transition: background 0.2s;
}
.acct-provision-toggle:hover { background: #FEF3C7; }
.acct-prov-arrow {
  font-size: 0.6rem;
  transition: transform 0.25s;
  display: inline-block;
  color: #B45309;
}
.acct-prov-arrow--open { transform: rotate(90deg); }
.acct-prov-total {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 800;
  color: #B45309;
  font-variant-numeric: tabular-nums;
}
.acct-provision-detail {
  background: #FFFDF5;
  border: 1px solid #F3E8C0;
  border-top: none;
  border-radius: 0 0 4px 4px;
  padding: 10px 14px;
  margin-bottom: 4px;
}
.acct-prov-section-title {
  font-size: 0.68rem;
  font-weight: 800;
  color: #78350F;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 10px 0 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid #F3E8C0;
}
.acct-prov-section-title:first-child { margin-top: 0; }
.acct-prov-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 0.74rem;
  color: #6B5A2E;
  font-variant-numeric: tabular-nums;
}
.acct-prov-subtotal {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: #92400E;
  border-top: 1px solid #F3E8C0;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.acct-prov-grandtotal {
  display: flex;
  justify-content: space-between;
  padding: 8px 0 4px;
  font-size: 0.82rem;
  font-weight: 900;
  color: #78350F;
  border-top: 2px solid #D4A853;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 500px) {
  .acct-kpi-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .acct-kpi-card {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    padding: 12px 14px;
  }
  .acct-kpi-card::before { height: 100%; width: 3px; right: auto; bottom: 0; }
  .acct-kpi-icon { font-size: 1.1rem; margin: 0; }
  .acct-kpi-label { margin: 0; }
  .acct-kpi-value { font-size: 1.1rem; margin-left: auto; }
}

/* ── Sección header ─────────────────────────────────────────── */
.acct-section-header {
  margin-bottom: 14px;
}
.acct-section-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}
.acct-section-desc {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 2px 0 0;
}

/* ── Worker Card ────────────────────────────────────────────── */
.acct-worker-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  transition: box-shadow 0.2s;
}
.acct-worker-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.acct-worker-card--owner {
  border-color: #E2E8F0;
  background: #fff;
}

.acct-worker-header {
  padding: 10px 16px;
  border-bottom: 1px solid #E2E8F0;
  background: #F7F8FA;
}
.acct-worker-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.acct-worker-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: #1E293B;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.acct-worker-cat {
  font-size: 0.7rem;
  color: #94A3B8;
  font-weight: 500;
}

/* Badges — semánticos profesionales */
.acct-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  color: #475569;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.acct-badge--blue {
  background: #EFF6FF;
  color: #1D4ED8;
  border-color: #BFDBFE;
}
.acct-badge--purple {
  background: #F5F3FF;
  color: #6D28D9;
  border-color: #DDD6FE;
}
.acct-badge--orange {
  background: #FFF7ED;
  color: #C2410C;
  border-color: #FED7AA;
}
.acct-badge--amber {
  background: #FFFBEB;
  color: #B45309;
  border-color: #FDE68A;
}
.acct-badge--green {
  background: #F0FDF4;
  color: #15803D;
  border-color: #BBF7D0;
}
.acct-badge--red {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FECACA;
}

.acct-ss-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
}

/* ── Services Table ─────────────────────────────────────────── */
.acct-svc-table {
  padding: 0 16px;
}
.acct-svc-header {
  display: grid;
  grid-template-columns: 1fr 40px 90px;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #E2E8F0;
  font-size: 0.65rem;
  font-weight: 800;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #F7F8FA;
}
.acct-svc-header span:nth-child(2),
.acct-svc-header span:nth-child(3) {
  text-align: right;
}
.acct-svc-row {
  display: grid;
  grid-template-columns: 1fr 40px 90px;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #F1F5F9;
  font-size: 0.78rem;
  color: #1E293B;
}
.acct-svc-row:nth-child(even) {
  background: #FAFBFC;
}
.acct-svc-row:last-child { border-bottom: none; }
.acct-svc-name {
  font-weight: 600;
  color: #334155;
}
.acct-svc-qty {
  text-align: right;
  color: #64748B;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.acct-svc-monto {
  text-align: right;
  font-weight: 700;
  color: #1E293B;
  font-variant-numeric: tabular-nums;
}

.acct-no-data {
  padding: 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.8rem;
}

/* ── Summary ── profesional contable */
.acct-summary {
  padding: 10px 16px;
  background: #fff;
  border-top: 1px solid #E2E8F0;
}
.acct-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 4px;
  font-size: 0.78rem;
  color: #334155;
  border-bottom: 1px solid #F1F5F9;
  font-variant-numeric: tabular-nums;
}
.acct-summary-row:nth-child(even) {
  background: #FAFBFC;
}
.acct-summary--deduct {
  color: #DC2626;
}
.acct-summary--insumos {
  color: #EA580C;
  background: #FFF7ED;
  border-radius: 3px;
  padding: 5px 6px !important;
  margin: 1px 0;
}
.acct-summary--insumos-base {
  color: #64748B;
  font-style: italic;
}
.acct-summary--vale { color: #000; }
.acct-summary--deuda { color: #000; }
.acct-summary--total {
  padding-top: 8px;
  margin-top: 4px;
  border-top: 2px solid #1E293B;
  border-bottom: none;
  font-size: 0.95rem;
  font-weight: 900;
  color: #0F172A;
  background: transparent;
}
.acct-summary--owner {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  border-bottom: none;
}

/* ── Action Buttons ── profesional */
.acct-worker-actions {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid #E2E8F0;
  background: #FAFBFC;
}
.acct-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  background: #fff;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.acct-btn:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}
.acct-btn--pdf {
  background: #1E293B;
  color: #fff;
  border-color: #1E293B;
}
.acct-btn--pdf:hover {
  background: #334155;
  border-color: #334155;
}
.acct-btn--detail {
  background: #F8FAFC;
  color: #475569;
  border-color: #E2E8F0;
}
.acct-btn--detail:hover {
  background: #F1F5F9;
}

/* ── Empty State ────────────────────────────────────────────── */
.acct-empty {
  padding: 40px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
  background: #f8fafc;
  border-radius: 14px;
  border: 1px dashed #e2e8f0;
}

/* ── Vales / Adelantos ──────────────────────────────────────── */
.vale-historial-list {
  max-height: 180px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.vale-historial-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fefce8;
  border: 1px solid #fde68a;
  margin-bottom: 6px;
  gap: 8px;
}
.vale-historial-item:last-child { margin-bottom: 0; }
.vale-historial-info {
  flex: 1;
  min-width: 0;
}
.vale-historial-monto {
  font-size: 0.9rem;
  font-weight: 700;
  color: #92400e;
}
.vale-historial-nota {
  font-size: 0.68rem;
  color: #a16207;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vale-historial-fecha {
  font-size: 0.62rem;
  color: #ca8a04;
  flex-shrink: 0;
}
.vale-historial-delete {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: #fef3c7;
  color: #b45309;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  font-size: 0.75rem;
}
.vale-historial-delete:hover {
  background: #fde68a;
  color: #92400e;
}
.vale-historial-total {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  margin-top: 8px;
  border-radius: 10px;
  background: #fffbeb;
  border: 2px solid #f59e0b;
  font-weight: 700;
  font-size: 0.85rem;
  color: #92400e;
}

/* Vale deduction line in pay run summary */
.acct-summary--vale {
  color: #B45309;
  background: #FFFBEB;
  border-radius: 3px;
  padding: 5px 6px !important;
  margin: 1px 0;
}

/* Vale button in worker card */
.acct-btn--vale {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}
.acct-btn--vale:hover {
  background: #FEF3C7;
  border-color: #F59E0B;
}

/* ==============================================================
   DEUDA ACUMULADA — Estilos para saldo en rojo y liquidación
   ============================================================== */

/* Badge rojo para workers con deuda */
.acct-badge--red {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FECACA;
  animation: acct-pulse-red 2.5s ease-in-out infinite;
}
@keyframes acct-pulse-red {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Worker card con deuda — borde izquierdo rojo */
.acct-worker-card--deuda {
  border-color: #FECACA;
  border-left: 3px solid #EF4444;
  background: #FFFBFB;
}
.acct-worker-card--deuda:hover {
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.08);
}

/* Fila de deuda anterior en el resumen */
.acct-summary--deuda {
  color: #DC2626;
  background: #FEF2F2;
  border-radius: 3px;
  padding: 5px 6px !important;
  margin: 1px 0;
  font-weight: 600;
}

/* Alerta de deuda nueva generada */
.acct-summary-deuda-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  margin: 8px 0 4px;
  border-radius: 4px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-left: 3px solid #EF4444;
}
.acct-deuda-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  line-height: 1.4;
}
.acct-deuda-text {
  flex: 1;
  min-width: 0;
}
.acct-deuda-text strong {
  color: #DC2626;
  font-size: 0.82rem;
}
.acct-deuda-text small {
  color: #9F1239;
  font-size: 0.68rem;
}

/* ── Botón Liquidar Período ────────────────────────────────── */
.acct-liquidar-section {
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  text-align: center;
}
.acct-liquidar-info {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0 0 14px;
  line-height: 1.5;
}
.acct-liquidar-info strong {
  color: #1e293b;
}
.acct-liquidar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}
.acct-liquidar-btn:hover {
  background: linear-gradient(135deg, #047857, #065f46);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.45);
  transform: translateY(-1px);
}
.acct-liquidar-btn:active {
  transform: translateY(0);
}
.acct-liquidar-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Resumen de deudas pendientes en la sección liquidar */
.acct-liquidar-deudas {
  margin-top: 12px;
  padding: 12px 16px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  text-align: left;
}
.acct-liquidar-deudas-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}
.acct-liquidar-deuda-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.8rem;
}
.acct-liquidar-deuda-row:last-child {
  border-bottom: none;
}
.acct-liquidar-deuda-name {
  color: #334155;
  font-weight: 500;
}
.acct-liquidar-deuda-monto {
  color: #dc2626;
  font-weight: 700;
}

/* Badge de período liquidado */
.acct-liquidado-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  background: #d1fae5;
  border: 1.5px solid #6ee7b7;
  color: #047857;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 12px;
}

/* ── Botón para limpiar deuda manualmente ───────────────────── */
.acct-btn--clear-debt {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
  font-size: 0.7rem;
}
.acct-btn--clear-debt:hover {
  background: #FEE2E2;
  border-color: #EF4444;
}

/* ══════════════════════════════════════════════════════════════
   MODAL ELIMINAR VALE — Premium Animated
   ══════════════════════════════════════════════════════════════ */

.vale-del-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.vale-del-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.vale-del-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.vale-del-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.05);
  text-align: center;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.vale-del-overlay.is-open .vale-del-card {
  transform: scale(1) translateY(0);
}

/* Icono animado */
.vale-del-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.vale-del-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
  animation: valeDelPulse 2s ease-in-out infinite;
}
@keyframes valeDelPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.3); }
  50% { box-shadow: 0 0 0 12px rgba(239,68,68,0); }
}

/* Texto */
.vale-del-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 4px;
}
.vale-del-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 16px;
}

/* Info del vale */
.vale-del-info {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.vale-del-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}
.vale-del-info-row + .vale-del-info-row {
  border-top: 1px solid #e2e8f0;
  margin-top: 4px;
  padding-top: 8px;
}
.vale-del-info-label {
  font-size: 13px;
  color: #64748b;
}
.vale-del-info-value {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
}

/* Motivo */
.vale-del-reason {
  text-align: left;
  margin-bottom: 20px;
}
.vale-del-reason-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  margin-bottom: 6px;
}
.vale-del-reason-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13px;
  color: #334155;
  background: #f8fafc;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: auto;
}
.vale-del-reason-select:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

/* Botones */
.vale-del-actions {
  display: flex;
  gap: 10px;
}
.vale-del-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
.vale-del-btn--cancel {
  background: #f1f5f9;
  color: #475569;
}
.vale-del-btn--cancel:hover {
  background: #e2e8f0;
}
.vale-del-btn--confirm {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}
.vale-del-btn--confirm:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 6px 16px rgba(239,68,68,0.4);
  transform: translateY(-1px);
}
.vale-del-btn--confirm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Estado de éxito */
.vale-del-success {
  padding: 24px 0 8px;
  text-align: center;
}
.vale-del-success-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  animation: valeDelSuccessIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes valeDelSuccessIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.vale-del-check-path {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: valeDelCheckDraw 0.6s 0.2s ease forwards;
}
@keyframes valeDelCheckDraw {
  to { stroke-dashoffset: 0; }
}
.vale-del-success-text {
  font-size: 15px;
  font-weight: 600;
  color: #059669;
  margin: 0;
}

/* ══════════════════════════════════════════════════════════════
   MODAL LIQUIDAR PERÍODO — Premium Animated
   ══════════════════════════════════════════════════════════════ */

.liq-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.liq-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.liq-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.liq-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 400px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.05);
  text-align: center;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.liq-overlay.is-open .liq-card {
  transform: scale(1) translateY(0);
}

/* Icono */
.liq-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.liq-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #059669;
  animation: liqPulse 2s ease-in-out infinite;
}
@keyframes liqPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(5,150,105,0.25); }
  50% { box-shadow: 0 0 0 12px rgba(5,150,105,0); }
}

/* Título */
.liq-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 4px;
}
.liq-subtitle {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 20px;
  font-weight: 500;
}

/* Stats row */
.liq-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 8px;
  margin-bottom: 16px;
}
.liq-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.liq-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: #1e293b;
}
.liq-stat--green { color: #059669; }
.liq-stat--red { color: #ef4444; }
.liq-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.liq-stat-divider {
  width: 1px;
  height: 32px;
  background: #e2e8f0;
}

/* Warning de deudas */
.liq-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 20px;
  text-align: left;
}
.liq-warning-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.liq-deuda-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.liq-deuda-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.7);
  padding: 8px 12px;
  border-radius: 10px;
}
.liq-deuda-name {
  font-size: 13px;
  font-weight: 500;
  color: #78350f;
}
.liq-deuda-monto {
  font-size: 14px;
  font-weight: 700;
  color: #dc2626;
}

/* Estado limpio */
.liq-clean {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  color: #065f46;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

/* Botones */
.liq-actions {
  display: flex;
  gap: 10px;
}
.liq-btn {
  flex: 1;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
.liq-btn--cancel {
  background: #f1f5f9;
  color: #475569;
}
.liq-btn--cancel:hover {
  background: #e2e8f0;
}
.liq-btn--confirm {
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  box-shadow: 0 4px 14px rgba(5,150,105,0.35);
}
.liq-btn--confirm:hover {
  background: linear-gradient(135deg, #047857, #065f46);
  box-shadow: 0 6px 18px rgba(5,150,105,0.45);
  transform: translateY(-1px);
}
.liq-btn--confirm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Estado de éxito */
.liq-success {
  padding: 28px 0 12px;
  text-align: center;
}
.liq-success-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  animation: liqSuccessIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes liqSuccessIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.liq-check-path {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: liqCheckDraw 0.6s 0.2s ease forwards;
}
@keyframes liqCheckDraw {
  to { stroke-dashoffset: 0; }
}
.liq-success-title {
  font-size: 20px;
  font-weight: 700;
  color: #059669;
  margin: 0 0 4px;
}
.liq-success-text {
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  margin: 0 0 4px;
}
.liq-success-detail {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

/* ══════════════════════════════════════════════════════════════
   BANNER SNAPSHOT — Período Liquidado (Modo Lectura)
   ══════════════════════════════════════════════════════════════ */

.acct-snapshot-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1.5px solid #6ee7b7;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
  animation: snapshotBannerIn 0.4s ease;
}
@keyframes snapshotBannerIn {
  0% { opacity: 0; transform: translateY(-8px); }
  100% { opacity: 1; transform: translateY(0); }
}
.acct-snapshot-banner-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.acct-snapshot-banner-text {
  font-size: 14px;
  color: #065f46;
  line-height: 1.4;
}
.acct-snapshot-banner-text strong {
  font-size: 15px;
  color: #047857;
}
.acct-snapshot-banner-text small {
  color: #059669;
  font-size: 12px;
}

/* ══════════════════════════════════════════════════════════════
   MODAL REABRIR PERÍODO — Premium Animated (Super Admin)
   ══════════════════════════════════════════════════════════════ */

.reabrir-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.reabrir-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.reabrir-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.reabrir-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 400px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.05);
  text-align: center;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.reabrir-overlay.is-open .reabrir-card {
  transform: scale(1) translateY(0);
}

/* Icono animado — Amber/Naranja */
.reabrir-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.reabrir-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d97706;
  animation: reabrirPulse 2s ease-in-out infinite;
}
@keyframes reabrirPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217,119,6,0.25); }
  50% { box-shadow: 0 0 0 12px rgba(217,119,6,0); }
}

/* Título */
.reabrir-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 4px;
}
.reabrir-subtitle {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 14px;
  font-weight: 500;
}

/* Badge Super Admin */
.reabrir-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 16px;
}

/* Warning — Reversiones */
.reabrir-warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
  text-align: left;
}
.reabrir-warning-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #9a3412;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.reabrir-rev-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.reabrir-rev-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.7);
  padding: 8px 12px;
  border-radius: 10px;
}
.reabrir-rev-name {
  font-size: 13px;
  font-weight: 500;
  color: #7c2d12;
}
.reabrir-rev-delta {
  font-size: 14px;
  font-weight: 700;
  color: #059669;
}

/* Estado sin reversiones */
.reabrir-clean {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  color: #0c4a6e;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

/* Nota informativa */
.reabrir-note {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  text-align: left;
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
}
.reabrir-note strong {
  display: block;
  font-size: 12px;
  color: #1e293b;
  margin-bottom: 6px;
}
.reabrir-note ul {
  margin: 0;
  padding-left: 18px;
}
.reabrir-note li {
  margin-bottom: 3px;
}
.reabrir-note li:last-child {
  margin-bottom: 0;
}

/* Botones */
.reabrir-actions {
  display: flex;
  gap: 10px;
}
.reabrir-btn {
  flex: 1;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
.reabrir-btn--cancel {
  background: #f1f5f9;
  color: #475569;
}
.reabrir-btn--cancel:hover {
  background: #e2e8f0;
}
.reabrir-btn--confirm {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
  box-shadow: 0 4px 14px rgba(217,119,6,0.35);
}
.reabrir-btn--confirm:hover {
  background: linear-gradient(135deg, #b45309, #92400e);
  box-shadow: 0 6px 18px rgba(217,119,6,0.45);
  transform: translateY(-1px);
}
.reabrir-btn--confirm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Estado de éxito */
.reabrir-success {
  padding: 28px 0 12px;
  text-align: center;
}
.reabrir-success-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  animation: reabrirSuccessIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes reabrirSuccessIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.reabrir-check-path {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: reabrirCheckDraw 0.6s 0.2s ease forwards;
}
@keyframes reabrirCheckDraw {
  to { stroke-dashoffset: 0; }
}
.reabrir-success-title {
  font-size: 20px;
  font-weight: 700;
  color: #d97706;
  margin: 0 0 4px;
}
.reabrir-success-text {
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  margin: 0 0 4px;
}
.reabrir-success-detail {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

/* ═════════════════════════════════════════════════════════
   HISTORIAL DE NÓMINAS — Modal, tabla, botón de acceso
   ═════════════════════════════════════════════════════════ */

/* ── Botón "Ver Historial" en la barra de período ──────── */
.acct-period-bar {
  position: relative;
}
.acct-historial-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 2px solid #e0e7ff;
  border-radius: 12px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  color: #4338ca;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}
.acct-historial-btn:hover {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  border-color: #a5b4fc;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2);
  transform: translateY(-50%) translateY(-1px);
}
.acct-historial-btn:active {
  transform: translateY(-50%) scale(0.97);
}

@media (max-width: 600px) {
  .acct-historial-btn {
    position: static;
    transform: none;
    padding: 6px 10px;
    font-size: 0.72rem;
    margin-left: 8px;
  }
  .acct-historial-btn:hover {
    transform: none;
  }
  .acct-historial-btn:active {
    transform: scale(0.97);
  }
  .acct-historial-btn-text {
    display: none;
  }
}

/* ── Modal Overlay ─────────────────────────────────────── */
.historial-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.historial-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Modal Card ────────────────────────────────────────── */
.historial-modal {
  background: #fff;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 48px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}
.historial-overlay.is-open .historial-modal {
  transform: translateY(0);
}

@media (min-width: 640px) {
  .historial-overlay {
    align-items: center;
  }
  .historial-modal {
    border-radius: 20px;
    max-height: 80vh;
    transform: translateY(24px) scale(0.96);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.25s ease;
  }
  .historial-overlay.is-open .historial-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* ── Header ────────────────────────────────────────────── */
.historial-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
  color: #fff;
}
.historial-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.historial-header-icon {
  font-size: 1.6rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.historial-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.01em;
}
.historial-subtitle {
  font-size: 0.75rem;
  margin: 2px 0 0;
  opacity: 0.8;
  font-weight: 500;
}
.historial-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.historial-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ── Body ──────────────────────────────────────────────── */
.historial-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}

/* ── Loading State ─────────────────────────────────────── */
.historial-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
  color: #94a3b8;
  font-size: 0.85rem;
}
.historial-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: historialSpin 0.7s linear infinite;
}
@keyframes historialSpin {
  to { transform: rotate(360deg); }
}

/* ── Empty State ───────────────────────────────────────── */
.historial-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 30px;
  text-align: center;
}
.historial-empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.7;
}
.historial-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: #475569;
  margin: 0 0 8px;
}
.historial-empty-hint {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 0;
  max-width: 320px;
  line-height: 1.5;
}

/* ── Table ─────────────────────────────────────────────── */
.historial-table {
  padding: 0;
}
.historial-table-header {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.5fr 1fr;
  gap: 8px;
  padding: 12px 22px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.historial-table-header span:nth-child(2),
.historial-table-header span:nth-child(4) {
  text-align: right;
}
.historial-table-header span:nth-child(3) {
  text-align: center;
}

/* ── Row ───────────────────────────────────────────────── */
.historial-row {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.5fr 1fr;
  gap: 8px;
  padding: 14px 22px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
}
.historial-row:last-child {
  border-bottom: none;
}
.historial-row:hover {
  background: linear-gradient(135deg, #eef2ff, #f0f4ff);
  box-shadow: inset 3px 0 0 #6366f1;
}
.historial-row:active {
  background: #e0e7ff;
}

/* ── Cells ─────────────────────────────────────────────── */
.historial-cell {
  display: flex;
  align-items: center;
  min-width: 0;
}
.historial-cell--period {
  gap: 8px;
}
.historial-period-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.historial-period-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.historial-cell--monto {
  font-size: 0.9rem;
  font-weight: 800;
  color: #059669;
  justify-content: flex-end;
  letter-spacing: -0.02em;
}
.historial-cell--fecha {
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.historial-fecha-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
}
.historial-fecha-hora {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 500;
}
.historial-cell--estado {
  justify-content: flex-end;
}
.historial-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  background: #d1fae5;
  color: #047857;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Hint footer ───────────────────────────────────────── */
.historial-hint {
  padding: 14px 22px 18px;
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  margin: 0;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
}

/* ── Mobile responsive: collapse grid to cards ─────────── */
@media (max-width: 560px) {
  .historial-table-header {
    display: none;
  }
  .historial-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 4px 12px;
    padding: 14px 18px;
  }
  .historial-cell--period {
    grid-column: 1 / -1;
    margin-bottom: 4px;
  }
  .historial-cell--monto {
    justify-content: flex-start;
    font-size: 0.95rem;
  }
  .historial-cell--fecha {
    align-items: flex-end;
    flex-direction: row;
    gap: 6px;
  }
  .historial-cell--estado {
    display: none;
  }
}

/* ═════════════════════════════════════════════════════════
   INSUMOS — Toggle switch y líneas de transparencia
   ═════════════════════════════════════════════════════════ */

/* ── Toggle wrap (payroll config modal) ────────────────── */
.payroll-insumos-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  margin-top: 10px;
}
.payroll-insumos-toggle-wrap:hover {
  border-color: #10b981;
  background: #f0fdf4;
}
.payroll-insumos-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}
.payroll-insumos-toggle-icon {
  font-size: 1.2rem;
}

/* ── Toggle switch (iOS style) ─────────────────────────── */
.payroll-toggle-switch {
  position: relative;
  width: 48px;
  height: 28px;
  background: #cbd5e1;
  border-radius: 14px;
  flex-shrink: 0;
  transition: background 0.25s ease;
  cursor: pointer;
}
.payroll-toggle-switch.is-on {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}
.payroll-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.payroll-toggle-switch.is-on .payroll-toggle-thumb {
  transform: translateX(20px);
}

/* ── Insumos transparency lines (worker card summary) ─── */
.acct-summary--insumos {
  color: #0d9488 !important;
  background: linear-gradient(90deg, #f0fdfa, transparent);
  border-radius: 6px;
  padding: 4px 8px !important;
  margin: 2px 0;
}
.acct-summary--insumos span:first-child {
  font-weight: 700;
  font-size: 0.78rem;
}
.acct-summary--insumos span:last-child {
  color: #0f766e;
  font-weight: 800;
}
.acct-summary--insumos-base {
  color: #64748b !important;
  font-style: italic;
  padding: 2px 8px !important;
  margin-bottom: 4px;
}
.acct-summary--insumos-base span:first-child {
  font-size: 0.72rem;
}
.acct-summary--insumos-base span:last-child {
  font-weight: 700;
  color: #475569;
}

/* ── Insumos badge in worker header ────────────────────── */
.acct-badge--teal {
  background: #ccfbf1;
  color: #0f766e;
  border: 1px solid #99f6e4;
}
