:root {
  --font-size-xs: 10px;
  --font-size-s: 12px;
  --font-size-m: 14px;
  --font-size-l: 16px;
  --font-size-xl: 24px;
  --font-size-xxl: 32px;
}

body {
  margin: 0px;
  width: 100vw;
  height: 100vh;
  font-family: "Nunito", sans-serif;
  background-color: var(--bg-neutral-0);
  position: relative;
  overflow: hidden;
}

* {
  user-select: none;
}

button {
  border: none;
  background: transparent;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
  padding: 0px;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0px;
  padding: 0px;
}

a {
  text-decoration: none;
  color: var(--black);
}

input {
  outline: none;
  background: transparent;
  border: none;
}

* {
  box-sizing: border-box;
}

ul,
li {
  margin: 0px;
  padding: 0px;
  list-style: none;
}

.scroll {
  overflow-y: scroll;
}

.scroll::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.scroll::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background-color: var(--bg-primary-500);
}

.scrollNone {
  overflow-y: scroll;
}

.scrollNone::-webkit-scrollbar {
  width: 0px;
  height: 0px;
}

.scrollNone::-webkit-scrollbar-thumb {
  background-color: transparent;
}

@keyframes swing {
  0%,
  30%,
  50%,
  70%,
  100% {
    transform: rotate(0deg);
  }

  10% {
    transform: rotate(10deg);
  }

  40% {
    transform: rotate(-10deg);
  }

  60% {
    transform: rotate(5deg);
  }

  80% {
    transform: rotate(-5deg);
  }
}

@keyframes flash {
  0%,
  100% {
    transform: scale(0) rotate(45deg);
    opacity: 0;
  }
  8% {
    transform: scale(0) rotate(45deg);
    opacity: 0.5;
  }
  8.1% {
    transform: scale(4) rotate(45deg);
    opacity: 1;
  }
  10% {
    transform: scale(50) rotate(45deg);
    opacity: 0;
  }
}

.truncateText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ######### Font Class ########## */
span:not(.u), h1, h2, h3, h4, h5, h6, p, a, label, button, input {
  font-family: Nunito !important;
}

/* HeadLine */
.headline-2xl-b {
  font-size: var(--size-headline-2xl);
  line-height: var(--line-height-headline-2xl);
  font-weight: var(--font-weight-bold);
}

.headline-xl-b {
  font-size: var(--size-headline-xl);
  line-height: var(--line-height-headline-xl);
  font-weight: var(--font-weight-bold);
}

.headline-l-b {
  font-size: var(--size-headline-l);
  line-height: var(--line-height-headline-l);
  font-weight: var(--font-weight-bold);
}

.headline-m-b {
  font-size: var(--size-headline-m);
  line-height: var(--line-height-headline-m);
  font-weight: var(--font-weight-bold);
}

.headline-s-b {
  font-size: var(--size-headline-s);
  line-height: var(--line-height-headline-s);
  font-weight: var(--font-weight-bold);
}


.headline-2xl-sb {
  font-size: var(--size-headline-2xl);
  line-height: var(--line-height-headline-2xl);
  font-weight: var(--font-weight-semi-bold);
}

.headline-xl-sb {
  font-size: var(--size-headline-xl);
  line-height: var(--line-height-headline-xl);
  font-weight: var(--font-weight-semi-bold);
}

.headline-l-sb {
  font-size: var(--size-headline-l);
  line-height: var(--line-height-headline-l);
  font-weight: var(--font-weight-semi-bold);
}

.headline-m-sb {
  font-size: var(--size-headline-m);
  line-height: var(--line-height-headline-m);
  font-weight: var(--font-weight-semi-bold);
}

.headline-s-sb {
  font-size: var(--size-headline-s);
  line-height: var(--line-height-headline-s);
  font-weight: var(--font-weight-semi-bold);
}


.headline-2xl-r {
  font-size: var(--size-headline-2xl);
  line-height: var(--line-height-headline-2xl);
  font-weight: var(--font-weight-regular);
}

.headline-xl-r {
  font-size: var(--size-headline-xl);
  line-height: var(--line-height-headline-xl);
  font-weight: var(--font-weight-regular);
}

.headline-l-r {
  font-size: var(--size-headline-l);
  line-height: var(--line-height-headline-l);
  font-weight: var(--font-weight-regular);
}

.headline-m-r {
  font-size: var(--size-headline-m);
  line-height: var(--line-height-headline-m);
  font-weight: var(--font-weight-regular);
}

.headline-s-r {
  font-size: var(--size-headline-s);
  line-height: var(--line-height-headline-s);
  font-weight: var(--font-weight-regular);
}


/* Body */
.body-2xl-xb {
  font-size: var(--size-body-2xl);
  line-height: var(--line-height-body-2xl);
  font-weight: var(--font-weight-extra-bold);
}

.body-xl-xb {
  font-size: var(--size-body-xl);
  line-height: var(--line-height-body-xl);
  font-weight: var(--font-weight-extra-bold);
}

.body-l-xb {
  font-size: var(--size-body-l);
  line-height: var(--line-height-body-l);
  font-weight: var(--font-weight-extra-bold);
}

.body-m-xb {
  font-size: var(--size-body-m);
  line-height: var(--line-height-body-m);
  font-weight: var(--font-weight-extra-bold);
}

.body-s-xb {
  font-size: var(--size-body-s);
  line-height: var(--line-height-body-s);
  font-weight: var(--font-weight-extra-bold);
}

.body-xs-xb {
  font-size: var(--size-body-xs);
  line-height: var(--line-height-body-xs);
  font-weight: var(--font-weight-extra-bold);
  text-transform: uppercase !important;
}


.body-2xl-sb {
  font-size: var(--size-body-2xl);
  line-height: var(--line-height-body-2xl);
  font-weight: var(--font-weight-semi-bold);
}

.body-xl-sb {
  font-size: var(--size-body-xl);
  line-height: var(--line-height-body-xl);
  font-weight: var(--font-weight-semi-bold);
}

.body-l-sb {
  font-size: var(--size-body-l);
  line-height: var(--line-height-body-l);
  font-weight: var(--font-weight-semi-bold);
}

.body-m-sb {
  font-size: var(--size-body-m);
  line-height: var(--line-height-body-m);
  font-weight: var(--font-weight-semi-bold);
}

.body-s-sb {
  font-size: var(--size-body-s);
  line-height: var(--line-height-body-s);
  font-weight: var(--font-weight-semi-bold);
}

.body-xs-sb {
  font-size: var(--size-body-xs);
  line-height: var(--line-height-body-xs);
  font-weight: var(--font-weight-semi-bold);
  text-transform: uppercase !important;
}


.body-2xl-r {
  font-size: var(--size-body-2xl);
  line-height: var(--line-height-body-2xl);
  font-weight: var(--font-weight-regular);
}

.body-xl-r {
  font-size: var(--size-body-xl);
  line-height: var(--line-height-body-xl);
  font-weight: var(--font-weight-regular);
}

.body-l-r {
  font-size: var(--size-body-l);
  line-height: var(--line-height-body-l);
  font-weight: var(--font-weight-regular);
}

.body-m-r {
  font-size: var(--size-body-m);
  line-height: var(--line-height-body-m);
  font-weight: var(--font-weight-regular);
}

.body-s-r {
  font-size: var(--size-body-s);
  line-height: var(--line-height-body-s);
  font-weight: var(--font-weight-regular);
}

.body-xs-r {
  font-size: var(--size-body-xs);
  line-height: var(--line-height-body-xs);
  font-weight: var(--font-weight-regular);
  text-transform: uppercase !important;
}


.body-2xl-r {
  font-size: var(--size-body-2xl);
  line-height: var(--line-height-body-2xl);
  font-weight: var(--font-weight-regular);
}

.body-xl-r {
  font-size: var(--size-body-xl);
  line-height: var(--line-height-body-xl);
  font-weight: var(--font-weight-regular);
}

.body-l-r {
  font-size: var(--size-body-l);
  line-height: var(--line-height-body-l);
  font-weight: var(--font-weight-regular);
}

.body-m-r {
  font-size: var(--size-body-m);
  line-height: var(--line-height-body-m);
  font-weight: var(--font-weight-regular);
}

.body-s-r {
  font-size: var(--size-body-s);
  line-height: var(--line-height-body-s);
  font-weight: var(--font-weight-regular);
}

.body-xs-r {
  font-size: var(--size-body-xs);
  line-height: var(--line-height-body-xs);
  font-weight: var(--font-weight-regular);
  text-transform: uppercase !important;
}
/* ── Light Theme Override ──────────────────────────────────────────────────── */
/* Cuando está activo el modo claro, fuerza fondos y textos claros en las páginas */
:root.light-theme {
  color-scheme: light;
}

:root.light-theme body,
:root.light-theme .rrhh-content {
  background-color: #f8fafc;
}

/* Páginas principales */
:root.light-theme .trabajadores-page,
:root.light-theme .contratos-page,
:root.light-theme .liquidaciones-page,
:root.light-theme .reportes-page,
:root.light-theme .asistencia-page,
:root.light-theme .indicadores-page,
:root.light-theme .ficha-trabajador {
  background: #f8fafc !important;
  color: #111827 !important;
}

/* Tablas */
:root.light-theme .data-table,
:root.light-theme table {
  background: #ffffff !important;
  color: #111827 !important;
}

:root.light-theme .data-table th {
  background: #f1f5f9 !important;
  color: #374151 !important;
  border-color: #e2e8f0 !important;
}

:root.light-theme .data-table td,
:root.light-theme .data-table tr {
  border-color: #e2e8f0 !important;
  color: #111827 !important;
}

:root.light-theme .data-table tr:hover,
:root.light-theme .table-row:hover {
  background: #f0fdf9 !important;
}

/* Cards de contratos */
:root.light-theme .contrato-card,
:root.light-theme .kpi-card,
:root.light-theme .kpi-row .kpi-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #111827 !important;
}

/* Toolbar y filtros */
:root.light-theme .page-toolbar,
:root.light-theme .filter-bar,
:root.light-theme .page-header {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

/* Inputs y selects */
:root.light-theme .form-input,
:root.light-theme input,
:root.light-theme select {
  background: #ffffff !important;
  color: #111827 !important;
  border-color: #cbd5e1 !important;
}

/* Modales */
:root.light-theme .modal-box {
  background: #ffffff !important;
  color: #111827 !important;
}

:root.light-theme .modal-header {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

/* Bottom bar / KPI bar */
:root.light-theme .kpi-bar,
:root.light-theme .bottom-bar,
:root.light-theme [class*="bottom"] {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #374151 !important;
}

/* Tabs */
:root.light-theme .tabs-bar,
:root.light-theme .tab-btn:not(.active),
:root.light-theme .report-tabs .tab-btn:not(.active) {
  background: transparent !important;
  color: #6b7280 !important;
}

/* Texto general */
:root.light-theme h1,
:root.light-theme h2,
:root.light-theme h3,
:root.light-theme h4,
:root.light-theme p,
:root.light-theme span,
:root.light-theme label {
  color: inherit;
}

/* Búsqueda */
:root.light-theme .search-input,
:root.light-theme .filterInput input {
  background: #f8fafc !important;
  color: #111827 !important;
  border-color: #cbd5e1 !important;
}

/* Sección table-container */
:root.light-theme .table-container,
:root.light-theme .table-wrap,
:root.light-theme .contratos-grid {
  background: transparent !important;
}

/* ── Light Mode: Overrides adicionales páginas ──────────────────────────── */
:root.light-theme .trabajadores-page > *,
:root.light-theme .contratos-page > *,
:root.light-theme .liquidaciones-page > *,
:root.light-theme .ficha-trabajador > * {
  background-color: transparent;
}

/* Contenedor principal dark que envuelve todo */
:root.light-theme [class$="-page"],
:root.light-theme .ficha-trabajador {
  background: #f8fafc !important;
}

/* Barra de herramientas superior */
:root.light-theme .page-toolbar,
:root.light-theme .filter-bar,
:root.light-theme .page-header,
:root.light-theme .kpi-row {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #111827 !important;
}

/* KPI cards */
:root.light-theme .kpi-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #111827 !important;
}

:root.light-theme .kpi-label { color: #6b7280 !important; }
:root.light-theme .kpi-value { color: #111827 !important; }
:root.light-theme .kpi-value.teal { color: #0d9488 !important; }

/* Barra inferior de KPIs */
:root.light-theme div[style*="background"],
:root.light-theme .bottom-kpi,
:root.light-theme footer {
  background: #f1f5f9 !important;
}

/* Texto dentro de páginas */
:root.light-theme .trabajadores-page *:not(.badge):not(.btn):not(.btn-primary):not(.btn-danger):not(.btn-outline):not(.avatar-lg):not(.mini-avatar):not(.chip):not(.badge-estado-vigente):not(.badge-estado-activo) {
  color: #374151;
}

/* Inputs y search */
:root.light-theme .search-wrap,
:root.light-theme .filterInput {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

:root.light-theme .search-input { color: #111827 !important; background: transparent !important; }

/* Table headers */
:root.light-theme thead tr { background: #f1f5f9 !important; }
:root.light-theme th { color: #374151 !important; border-color: #e2e8f0 !important; }
:root.light-theme td { border-color: #f1f5f9 !important; }

/* Worker name, cargo */
:root.light-theme .worker-name { color: #111827 !important; }
:root.light-theme .worker-cargo { color: #6b7280 !important; }

/* Monto values */
:root.light-theme .teal { color: #0d9488 !important; }
:root.light-theme .muted { color: #9ca3af !important; }

/* ── LIGHT MODE: Contraste mejorado ─────────────────────────────────────── */

/* Avatares — fondo teal fuerte y texto blanco */
:root.light-theme .avatar,
:root.light-theme .mini-avatar,
:root.light-theme .avatar-lg {
  background: #e5e7eb !important;
  color: #374151 !important;
  font-weight: 800 !important;
}

/* Badges de modalidad de contrato — más sólidos en fondo blanco */
:root.light-theme .tagContrato.indefinido  { background: rgba(58,199,165,0.20) !important; }
:root.light-theme .tagContrato.proyecto    { background: rgba(133,140,240,0.22) !important; }
:root.light-theme .tagContrato.plazo_fijo  { background: rgba(251,191,36,0.22) !important; }
:root.light-theme .tagContrato.jornada     { background: rgba(139,92,246,0.22) !important; }

/* Badge de estado: Activo */
:root.light-theme .tagEstado.activo { background: rgba(52,211,153,0.15) !important; color: #059669 !important; }
:root.light-theme .tagEstado.inactivo { background: rgba(248,113,113,0.15) !important; color: #dc2626 !important; }

/* Badge "Indefinido", "Sin contrato" en la columna contrato */
:root.light-theme .badge-indef,
:root.light-theme [class*="badge"] { border: 1px solid rgba(0,0,0,0.1) !important; }

/* Texto muted — más oscuro en fondo blanco */
:root.light-theme .muted,
:root.light-theme td.muted { color: #374151 !important; }

/* Celdas del tabla */
:root.light-theme .data-table td { color: #111827 !important; }

/* Sidebar nav icons — más visibles */
:root.light-theme .nav-icon { color: #374151 !important; }
:root.light-theme .nav-item { color: #374151 !important; }
:root.light-theme .nav-item:hover { color: #111827 !important; }
:root.light-theme .nav-item.active .nav-icon { color: #0d9488 !important; }

/* Nav section labels */
:root.light-theme .nav-section-label { color: #9ca3af !important; }

/* Header del tabla más sólido */
:root.light-theme .data-table th {
  background: #f1f5f9 !important;
  color: #111827 !important;
  font-weight: 700 !important;
  border-bottom: 2px solid #e2e8f0 !important;
}

/* Separador del sidebar */
:root.light-theme .nav-section-divider { background: rgba(0,0,0,0.08) !important; }
