/* rrhh.css – RRHH Superagro */

/* ===== VARIABLES BÁSICAS ===== */
:root {
  --bg-body: #edf2f7;
  --bg-card: #ffffff;
  --border-soft: #d0d7e2;
  --primary: #0064e0;
  --primary-dark: #0050b5;
  --danger: #b91c1c;
  --text-main: #13213a;
  --text-muted: #6b7280;
}

/* ===== RESETEO ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text-main);
  background: var(--bg-body);
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.hoja {
  max-width: 1440px;
  margin: 0 auto 32px;
  background: var(--bg-card);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(15,23,42,.12);
  padding: 18px 24px 28px;
}

/* ===== ENCABEZADO ===== */
.encabezado {
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.encab-col {
  flex: 1;
}

.encab-left img {
  max-height: 60px;
}

.encab-center {
  text-align: center;
}

.encab-center h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: .04em;
}

.encab-center h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
}

.encab-right {
  text-align: right;
  font-size: 12px;
}

.encab-meta {
  border-collapse: collapse;
  margin-left: auto;
}

.encab-meta th,
.encab-meta td {
  padding: 2px 4px;
  white-space: nowrap;
}

.encab-meta th {
  text-align: left;
  font-weight: 600;
}

/* ===== DOCK DE ACCESOS ===== */
.linkzone {
  margin: 4px -8px 4px;
  padding: 18px 16px 12px;
  border-radius: 14px;
  background: #f6fafc;
}

.menus {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px 60px;
}

.menu-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
  min-width: 150px;
  transition: transform .14s ease, box-shadow .14s ease;
}

.menu-item:hover {
  transform: translateY(-2px);
}

.menu-icon {
  display: block;
}

/* Solo la imagen, sin anillo verde extra */
.menu-icon img {
  display: block;
  width: 100px;
  height: auto;
}

.menu-text {
  margin-top: 8px;
}

/* ===== SECCIONES ===== */
.sec-block {
  margin-top: 18px;
}

.section {
  margin-top: 12px;
  padding: 16px 18px 18px;
  border-radius: 14px;
  background: #f9fbff;
  border: 1px solid var(--border-soft);
}

.section + .section {
  margin-top: 18px;
}

.section-title {
  margin: 0;
  font-size: 16px;
}

/* ===== LAYOUT DE FILTROS ===== */
.f-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: flex-end;       /* <<< alinear las cajas por abajo */
}

.f-col {
  flex: 1 1 220px;             /* que cada columna crezca parejo */
  min-width: 220px;
}


.f-col label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ===== CAMPOS DE FORMULARIO – UNIFICADOS ===== */
/* Incluimos también los inputs sin atributo type (Documento, Nombre, etc.) */
input:not([type]),
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="email"],
input[type="search"],
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  height: 38px;
  padding: 6px 10px;
  margin-top: 2px;
  border-radius: 10px;
  border: 1px solid #cbd4e3;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  background: #fdfefe;
  outline: none;
  transition:
    border-color .15s ease,
    box-shadow .15s ease,
    background-color .15s ease;
}

/* Textarea más alta pero con el mismo look */
textarea {
  height: auto;
  min-height: 80px;
  resize: vertical;
}


/* Quitar estilo nativo de los inputs numéricos (flechitas) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* Quitar apariencia nativa */
input:not([type]),
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="email"],
select,
textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Estado FOCUS común para todos */
input:not([type]):focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  border-color: #0054d6;
  box-shadow:
    0 0 0 1px rgba(0,84,214,0.18),
    0 0 0 4px rgba(0,84,214,0.06);
  background: #f8fbff;
}


/* ===== TABLAS ===== */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 13px;
}

.table th,
.table td {
  padding: 6px 8px;
  border: 1px solid var(--border-soft);
}

.table th {
  background: #eef2fb;
  font-weight: 600;
  text-align: left;
}

.table tr:nth-child(even) td {
  background: #f9fbff;
}

/* Detalle marcaciones */
.table--marcas input[type="time"] {
  width: 90px;
}

.table--marcas th:nth-child(1),
.table--marcas td:nth-child(1) {
  white-space: nowrap;
}

/* Tags festivo / descanso */
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  padding: 0 6px;
  font-size: 11px;
  line-height: 16px;
  margin-left: 4px;
}

.tag--fest {
  background: #fef3c7;
  color: #92400e;
}

.tag--rest {
  background: #e0f2fe;
  color: #075985;
}

/* Estados de guardado en filas */
.tr-saving {
  opacity: .6;
}

.tr-saved {
  animation: rowSaved 1.2s ease;
}

@keyframes rowSaved {
  0%   { background-color: #dcfce7; }
  100% { background-color: transparent; }
}

/* ===== BOTONES ===== */
.btn,
.btn:link,
.btn:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 18px;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0,100,224,.28);
  transition:
    background-color .15s ease,
    box-shadow .15s ease,
    transform .15s ease;
}

/* Botón verde = desplazamiento de ida */
.btn-ida {
  background: #16a34a;           /* verde */
  border-color: #15803d;
  color: #fff;
}

.btn-ida:hover {
  background: #15803d;
  border-color: #166534;
  box-shadow: 0 10px 18px rgba(22, 163, 74, 0.35);
}

/* Botón rojo = desplazamiento de vuelta */
.btn-vuelta {
  background: #dc2626;           /* rojo */
  border-color: #b91c1c;
  color: #fff;
}

.btn-vuelta:hover {
  background: #b91c1c;
  border-color: #991b1b;
  box-shadow: 0 10px 18px rgba(220, 38, 38, 0.35);
}


.btn:hover,
.btn:focus-visible {
  background: var(--primary-dark);
  text-decoration: none;
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(0,100,224,.35);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0,100,224,.25);
}

/* Botón secundario */
.btn--ghost {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 0 0 1px rgba(0,100,224,.35);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  background: rgba(0,100,224,.04);
}

/* Botón rojo (Salir / Eliminar) */
.btn--logout {
  background: var(--danger);
  box-shadow: 0 3px 10px rgba(185,28,28,.30);

}

.btn--logout:hover,
.btn--logout:focus-visible {
  background: #991b1b;
}

/* Pastilla "Guardando..." */
.save-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: #fef3c7;
  color: #92400e;
}

/* Footer (botón salir centrado) */
.page-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

/* ===== RESPONSIVO GENERAL ===== */
@media (max-width: 900px) {
  .encabezado {
    flex-direction: column;
    align-items: flex-start;
  }

  .encab-right {
    align-self: stretch;
    text-align: left;
  }

  .hoja {
    padding: 14px 12px 22px;
  }

  .menus {
    gap: 24px 32px;
  }

  .menu-icon img {
    width: 110px;
  }
}

/* ===== FOOTER CENTRADO (texto copyright) ===== */
.footer {
  margin: 18px 0 10px;
  text-align: center;
  color: #666;
  font-size: 13px;
}

/* Botón "Volver a accesos" para todas las pantallas */
.sec-back {
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin:-4px 0 14px;
  padding:7px 16px;
  border-radius:999px;
  border:1px solid #bfdbfe;
  background:#eff6ff;
  color:#1d4ed8;
  font-weight:600;
  font-size:14px;
  cursor:pointer;
  text-decoration:none;
  box-shadow:0 1px 2px rgba(15,23,42,.08);
}

.sec-back:hover {
  background:#dbeafe;
}

.sec-back:focus {
  outline:none;
  box-shadow:0 0 0 3px rgba(59,130,246,.45);
}

/* ========== LOGIN (page-login) ========== */

.page-login {
  padding: 16px 8px;
}

.page-login .hoja {
  max-width: 520px;
  margin: 10px auto 24px;
  padding: 16px 18px 22px;
}

.page-login .encabezado {
  margin-bottom: 20px;
}

.login-card {
  max-width: 480px;
  margin: 8px auto 12px;
  padding: 18px 18px 22px;
}

.login-title {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  color: #0b3c80;
}

/* estructura del formulario */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form .field label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

/* campos del login: MISMO ANCHO */
.login-input {
  width: 100%;
  box-sizing: border-box;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #cbd4e3;
  padding: 0 10px;
  font-size: 15px;
  outline: none;
  background: #fdfefe;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.login-input:focus {
  border-color: #0054d6;
  box-shadow:
    0 0 0 1px rgba(0,84,214,0.10),
    0 0 0 4px rgba(0,84,214,0.06);
  background-color: #f8fbff;
}

/* wrapper contraseña + ojo */
.field-input-wrap {
  position: relative;
}

.field-input-wrap .login-input {
  padding-right: 44px; /* espacio para el ojo */
}

/* botón del ojo */
.pass-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: #e5edff;
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

.pass-toggle.is-on {
  background: #1d4ed8;
  color: #fff;
}

.pass-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59,130,246,.45);
}

/* botón Entrar en login: ancho completo */
.page-login .btn.btn--full {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
}

/* login en pantallas pequeñas */
@media (max-width: 600px) {
  .page-login .hoja {
    margin: 6px auto 18px;
    padding: 12px 10px 18px;
  }

  .login-card {
    padding: 16px 14px 20px;
  }

  .login-title {
    font-size: 22px;
  }
}

/* Botón pequeño para acciones en tablas */
.btn--sm{
  padding: 4px 10px;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(0,100,224,.25);
}

/* Columna de acciones centrada */
.table-actions{
  text-align: center;
  white-space: nowrap;
}

 /* ===== Dock de accesos (RRHH + Dashboard) ===== */

.linkzone {
  padding: 24px 16px 32px;
}

/* CONTENEDOR DE ICONOS */
.linkzone .menus {
  display: grid;
  /* En PC: tantas columnas como quepan de mínimo 220px */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px 40px;          /* espacio entre filas / columnas */
  justify-items: center;   /* centra cada tarjeta */
  align-items: flex-start;
}

/* TARJETA / ICONO */
.menu-item {
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

/* Por si tenías un max-width raro en .menu-item, mejor controlarlo aquí */
.menu-item {
  max-width: 260px;
  width: 100%;
}

/* ===== Vista móvil: 2 columnas ===== */
@media (max-width: 768px) {
  .linkzone .menus {
    /* En móvil: EXACTAMENTE 2 columnas */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 12px;
  }

  .menu-item {
    max-width: none;
    width: 100%;
  }
}
/* === Formularios de Crear / Editar usuario: 3 columnas en PC === */
.user-form{
  display:grid;
  grid-template-columns:repeat(3, minmax(260px, 1fr));
  gap:16px;
}

/* Títulos / bloques que deban ocupar todo el ancho */
.user-form .full-row{
  grid-column:1 / -1;
}

/* En pantallas pequeñas: 1 sola columna */
@media (max-width: 900px){
  .user-form{
    grid-template-columns:1fr;
  }
}

.pw-field{
  display:flex;
  gap:6px;
  align-items:center;
}

.btn--pw{
  padding:4px 10px;
  font-size:12px;
  box-shadow:none;
}

/* Layout específico para la fila de ajustes salariales */
.f-row--salario {
  align-items: flex-end;          /* alinea las cajas por la parte inferior */
  gap: 12px 18px;
}

.f-row--salario .f-col {
  flex: 1 1 220px;
}

/* La columna de acciones puede ser un poco más angosta */
.f-row--salario .f-col--acciones {
  flex: 0 0 260px;
}

/* Texto de ayuda debajo de inputs */
.help-text {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

/* === Forzar que TODAS las cajas de las secciones se vean igual === */
.section input[type="text"],
.section input[type="password"],
.section input[type="number"],
.section input[type="date"],
.section input[type="time"],
.section input[type="email"],
.section select,
.section textarea {
  width: 100%;
  box-sizing: border-box;
  height: 38px !important;
  padding: 6px 10px !important;
  border-radius: 10px !important;
  border: 1px solid #cbd4e3 !important;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  background: #fdfefe;
  outline: none;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  transition:
    border-color .15s ease,
    box-shadow .15s ease,
    background-color .15s ease;
}

.section input[type="text"]:focus,
.section input[type="password"]:focus,
.section input[type="number"]:focus,
.section input[type="date"]:focus,
.section input[type="time"]:focus,
.section input[type="email"]:focus,
.section select:focus,
.section textarea:focus {
  border-color: #0054d6 !important;
  box-shadow:
    0 0 0 1px rgba(0,84,214,0.18),
    0 0 0 4px rgba(0,84,214,0.06);
  background: #f8fbff;
}

/* ========== DASHBOARD / PANEL TRABAJADOR ========== */

/* Ocultar secciones con atributo hidden */
.sec-block[hidden] {
  display: none;
}

/* Texto pequeño debajo del título del icono */
.menu-text .menu-sub {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 400;
  color: #1d4ed8;
}

/* Grid de 2 columnas reutilizable */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Encabezado de secciones con título + botón a la derecha */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* Filtros de 3 columnas (fecha desde/hasta + botón) */
.filtros {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: flex-end;
}

/* Tablas con scroll horizontal en pantallas pequeñas */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

/* --- Marcaciones: tarjetas entrada / salida --- */
.marca-card {
  border-radius: 14px;
  padding: 16px 18px 18px;
  border: 1px solid var(--border-soft, #d0d7e2);
  background: #f9fbff;
  box-shadow: 0 2px 6px rgba(15,23,42,.06);
}

.marca-card--in {
  background: #ecfdf3;      /* verde muy claro */
  border-color: #bbf7d0;
}

.marca-card--out {
  background: #fef2f2;      /* rojo muy claro */
  border-color: #fecaca;
}

.marca-title {
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.btn--marca-in {
  background: #16a34a;
  box-shadow: 0 3px 10px rgba(22,163,74,.35);
}

.btn--marca-in:hover,
.btn--marca-in:focus-visible {
  background: #15803d;
}

.btn--marca-out {
  background: #dc2626;
  box-shadow: 0 3px 10px rgba(220,38,38,.35);
}

.btn--marca-out:hover,
.btn--marca-out:focus-visible {
  background: #b91c1c;
}

/* Layout específico para la sección de marcaciones */
#sec-marca .form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* ---------- Responsive para dashboard / móvil ---------- */
@media (max-width: 768px) {
  .hoja {
    width: 100%;
    margin: 0;
    border-radius: 0;
  }

  .section-title {
    text-align: center;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .section-header .btn {
    align-self: center;
    width: 100%;
    max-width: 240px;
  }

  .form-grid-2,
  .filtros {
    grid-template-columns: 1fr;
  }

  .sec-back {
    margin: 0 auto 14px;
  }

  .page-actions .btn {
    width: 100%;
    max-width: 220px;
  }
  
   /* Fuerza que ENTRADA y SALIDA se vean una debajo de la otra */
  #sec-marca .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Tarjetas de desplazamientos en el dashboard */
.desp-card {
  padding: 16px 18px 18px;
  border-radius: 14px;
  border: 1px solid var(--border-soft, #d0d7e2);
  background: #f9fbff;
  box-shadow: 0 2px 6px rgba(15,23,42,.06);
}

/* Viaje de ida: fondo verde suave */
.desp-card-ida {
  background: #ecfdf3;   /* verde muy claro */
  border-color: #bbf7d0;
}

/* Viaje de vuelta: fondo rojo suave */
.desp-card-vuelta {
  background: #fef2f2;   /* rojo muy claro */
  border-color: #fecaca;
}




/*==========ESTLOS PARA MODO DE PRUEBA=============*/
.entorno-banner{
  text-align:center;
  padding:6px 10px;
  font-weight:700;
  font-size:33px;
}

.entorno-banner--test{
  background:#fef3c7;
  color:#92400e;
  border-bottom:2px solid #f59e0b;
}


.notif-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:20px;
  padding:0 6px;
  margin-left:6px;
  border-radius:999px;
  background:#dc2626;
  color:#fff;
  font-size:11px;
  font-weight:700;
}

/* ===== Scroll horizontal para tablas de Arqueos ===== */
.arq-scroll {
  width: 100%;
  overflow-x: auto;   /* 👈 aparece barra horizontal si se desborda */
  overflow-y: hidden;
  margin-bottom: 8px;
}

/* Forzamos ancho mínimo para que exista algo que desplazar */
.arq-scroll table {
  min-width: 1400px;  /* ajusta el valor según necesites */
  border-collapse: collapse;
}

/* Que las celdas no se partan en varias líneas */
.arq-scroll th,
.arq-scroll td {
  white-space: nowrap;
}

/* Opcional: estilo de la barra (Chromium/WebKit) */
.arq-scroll::-webkit-scrollbar {
  height: 8px;
}
.arq-scroll::-webkit-scrollbar-track {
  background: #f0f0f0;
}
.arq-scroll::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 4px;
}

/* Encabezado: logo centrado */
.encabezado--logo-solo {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 20px;
}

.encabezado-logo {
  height: 130px;       /* ajusta a tu gusto */
  width: auto;
}

