@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@600;700&display=swap');

/* ================================================================
   BELÚ SYSTEM — DESIGN SYSTEM UNIFICADO
   Basado en: Mini Sistema Contable-Operativo para BELÚ
   ================================================================ */

/* ── VARIABLES ──────────────────────────────────────────────── */
:root {
  --primary:      #8fa3ff;
  --primary-dim:  rgba(143, 163, 255, 0.12);
  --primary-glow: rgba(143, 163, 255, 0.25);
  --success:      #56d08e;
  --danger:       #ff6b6b;
  --warning:      #c5a86f;
  --info:         #7da3f7;

  --bg-dark:    #0b0d12;
  --bg-darker:  #06070a;
  --bg-card:    #121620;
  --bg-input:   #0d1118;

  --text-light: #edf1fb;
  --text-muted: #8d96ac;
  --border:     #242a38;
  --border-soft:#1a1f2b;

  --shadow:    0 10px 30px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.55);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-w: 280px;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  background:
    radial-gradient(1200px 700px at 90% -10%, rgba(143,163,255,0.08), transparent 60%),
    radial-gradient(900px 500px at -20% 20%, rgba(86,208,142,0.05), transparent 60%),
    linear-gradient(160deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
  color: var(--text-light);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: linear-gradient(160deg, #131826 0%, #10141f 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 50px 45px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 35px;
}

.logo-img {
  display: block;
  max-width: 100%;
  width: 200px;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

.logo-img-login {
  max-height: 140px;
  margin-bottom: 16px;
}

.sidebar-header .logo-img {
  max-height: 72px;
  margin-bottom: 4px;
}

.login-logo p {
  color: var(--text-muted);
  font-size: 0.9em;
  margin-top: 5px;
}

.login-error {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: var(--danger);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.9em;
  margin-bottom: 20px;
  display: none;
}

.login-error.show { display: block; }

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, #0f131c 0%, #090b10 100%);
  border-right: 1px solid var(--border);
  padding: 30px 0;
  overflow-y: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 0 25px 25px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 15px;
  text-align: center;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.logo-subtitle {
  font-size: 0.8em;
  color: var(--text-muted);
}

/* Separador de grupos */
.nav-group-label {
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 18px 25px 6px;
  font-weight: 600;
}

.sidebar-nav { flex: 1; padding: 0 15px; }
.nav-list { list-style: none; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  margin-bottom: 4px;
  color: var(--text-light);
  text-decoration: none;
  border-radius: 10px;
  transition: var(--transition);
  font-weight: 500;
  font-size: 0.93em;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-link:hover {
  background: var(--primary-dim);
  border-left: 3px solid #7f93ea;
  padding-left: 15px;
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(143,163,255,0.2), rgba(143,163,255,0.06));
  border-left: 3px solid #9fb0ff;
  color: #dbe2ff;
  padding-left: 15px;
}

/* Badge de módulo bloqueado */
.nav-link.locked {
  opacity: 0.35;
  cursor: not-allowed;
}

.nav-icon { font-size: 1.2em; min-width: 22px; display: flex; align-items: center; }
.nav-text  { flex: 1; }

.nav-badge {
  font-size: 0.7em;
  background: var(--primary-dim);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 20px 25px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--info));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9em;
  color: #fff;
  flex-shrink: 0;
}

.user-name  { font-size: 0.88em; font-weight: 600; color: var(--text-light); }
.user-rol   { font-size: 0.75em; color: var(--text-muted); }

.btn-logout {
  width: 100%;
  padding: 10px;
  background: rgba(255,107,107,0.1);
  border: 1px solid rgba(255,107,107,0.25);
  color: var(--danger);
  border-radius: 8px;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Manrope', sans-serif;
}

.btn-logout:hover {
  background: rgba(255,107,107,0.2);
  border-color: var(--danger);
}

/* ================================================================
   CONTENIDO PRINCIPAL
   ================================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 40px;
  display: flex;
  flex-direction: column;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 40px;
  margin: -40px -40px 30px -40px;
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25em;
  color: #f0f3ff;
  white-space: nowrap;
  flex-shrink: 0;
}

#modTabsSlot {
  display: flex;
  gap: 6px;
  flex: 1;
  flex-wrap: wrap;
}

.date-time {
  color: var(--text-muted);
  font-size: 0.82em;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-kiosco-login {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-light);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 1.05em;
  cursor: pointer;
  transition: var(--transition);
}

.btn-kiosco-login:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-dim);
}

/* ── Tabs de módulo (global) ─────────────────────────────── */
.mod-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.mod-tab {
  padding: 7px 15px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: 'Manrope', sans-serif;
  font-size: .84em;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.mod-tab:hover  { border-color: var(--primary); color: var(--primary); }
.mod-tab.active { background: var(--primary); color: #0b0d12; border-color: var(--primary); }

/* ── Secciones / Módulos ─────────────────────────────────────── */
.module-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.module-section.active { display: block; }

/* Modo kiosco: portada de asistencia sin sidebar */
body.kiosco-mode .sidebar {
  display: none;
}

body.kiosco-mode .main-content {
  margin-left: 0;
  padding: 18px;
}

body.kiosco-mode .page-header {
  margin: -18px -18px 16px -18px;
  padding: 10px 14px;
  justify-content: flex-end;
}

body.kiosco-mode #modTabsSlot {
  display: none;
}

body.kiosco-mode .date-time {
  display: none;
}

body.kiosco-mode #pageTitle {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Bienvenida (dashboard inicial) ─────────────────────────── */
.welcome-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 10px;
}

.module-card {
  background: linear-gradient(160deg, #131826 0%, #10141f 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-light);
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: '';
  position: absolute;
  top: -60%; right: -60%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(143,163,255,0.1), transparent);
  border-radius: 50%;
  opacity: 0;
  transition: var(--transition);
}

.module-card:hover {
  transform: translateY(-6px);
  border-color: #4c556e;
  box-shadow: var(--shadow-lg);
}

.module-card:hover::before { opacity: 1; }

.module-card-icon { font-size: 2.5em; margin-bottom: 14px; }
.module-card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1em;
  font-weight: 700;
  margin-bottom: 6px;
}

.module-card-desc { font-size: 0.83em; color: var(--text-muted); }

/* ================================================================
   CARDS
   ================================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.card {
  background: linear-gradient(160deg, #131826 0%, #10141f 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover { transform: translateY(-3px); border-color: #4c556e; box-shadow: var(--shadow); }

.card-icon { font-size: 1.55em; min-width: 38px; display: flex; align-items: center; justify-content: center; }
.card-content { flex: 1; }
.card-label { color: var(--text-muted); font-size: 0.72em; text-transform: uppercase; letter-spacing: .7px; margin-bottom: 2px; }
.card-value { font-size: 1.45em; font-weight: bold; margin: 3px 0; letter-spacing: -0.3px; line-height: 1.15; }
.card-detail { font-size: 0.72em; color: var(--text-muted); line-height: 1.25; }

.card-primary .card-value { color: var(--primary); }
.card-success .card-value { color: var(--success); }
.card-danger  .card-value { color: var(--danger); }
.card-warning .card-value { color: var(--warning); }

/* ================================================================
   FORMULARIOS
   ================================================================ */
.form-card {
  background: linear-gradient(160deg, #131826 0%, #10141f 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 25px;
}

.form-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1em;
  margin-bottom: 22px;
  color: #dbe2ff;
}

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.85em; color: var(--text-muted); margin-bottom: 7px; font-weight: 500; }

.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-light);
  font-family: 'Manrope', sans-serif;
  font-size: 0.92em;
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

select option { background: var(--bg-card); }
textarea { resize: vertical; min-height: 80px; }

/* ── Botones ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 9px;
  border: none;
  font-family: 'Manrope', sans-serif;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: #0b0d12; }
.btn-primary:hover { background: #a8bcff; }

.btn-success { background: var(--success); color: #0b0d12; }
.btn-success:hover { background: #6de0a0; }

.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover  { background: #ff8585; }

.btn-secondary { background: var(--border); color: var(--text-light); }
.btn-secondary:hover { background: #2e3648; }

.btn-block { width: 100%; margin-top: 10px; }

.btn-sm { padding: 7px 14px; font-size: 0.82em; }
.btn-xs { padding: 4px 9px; font-size: 0.75em; }
.btn-icon { padding: 8px; border-radius: 7px; }

/* ================================================================
   TABLAS
   ================================================================ */
.table-responsive { overflow-x: auto; }

#asist-sueldos {
  font-size: calc(1em - 1pt);
}

.asistencia-sueldos-table {
  width: 100%;
  table-layout: auto;
  font-size: 0.78em;
}

.asistencia-sueldos-table th,
.asistencia-sueldos-table td {
  padding-left: 4px !important;
  padding-right: 4px !important;
  white-space: nowrap;
}

.asistencia-sueldos-table .asistencia-sueldos-empleado {
  min-width: 130px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asistencia-sueldos-table .asistencia-sueldos-nota {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
}

.asistencia-sueldos-table .asistencia-sueldos-nota textarea,
.asistencia-sueldos-table .asistencia-sueldos-nota span {
  width: 100% !important;
}

.asistencia-sueldos-table .asistencia-sueldos-nota span {
  display: inline-block;
  overflow-wrap: anywhere;
}

.asistencia-sueldos-table .asistencia-sueldos-acciones {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 72px;
  background: linear-gradient(90deg, rgba(18, 22, 32, 0.88) 0%, rgba(18, 22, 32, 0.98) 18%);
  box-shadow: -10px 0 16px rgba(6, 7, 10, 0.28);
}

.asistencia-sueldos-table thead .asistencia-sueldos-acciones {
  z-index: 3;
  background: #121620;
}

.asistencia-sueldos-acciones-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sueldo-stepper {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  vertical-align: middle;
}

.sueldo-stepper-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-darker);
  color: var(--text-muted);
  font-size: 0.65em;
  line-height: 1;
  cursor: pointer;
}

.sueldo-stepper-btn:hover {
  color: var(--text-light);
  border-color: var(--primary);
}

.sueldo-stepper-val {
  min-width: 20px;
  font-weight: 600;
  font-size: 0.85em;
  line-height: 1.2;
  color: var(--text-muted);
}

.sueldo-stepper-estado {
  display: block;
  margin-top: 2px;
  font-size: 0.68em;
  line-height: 1.2;
}

@media (max-width: 1200px) {
  .asistencia-sueldos-table {
    font-size: calc(0.88em - 1pt);
  }

  .asistencia-sueldos-table .asistencia-sueldos-empleado {
    min-width: 150px;
  }

  .asistencia-sueldos-table .asistencia-sueldos-nota {
    width: 118px;
    min-width: 118px;
    max-width: 118px;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88em;
}

thead th {
  text-align: left;
  padding: 13px 16px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-light);
}

tbody tr:hover { background: rgba(143,163,255,0.04); }
tbody tr:last-child td { border-bottom: none; }

/* ================================================================
   ALERTA CENTRADA GLOBAL
   ================================================================ */
.alerta-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 10, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.alerta-box {
  background: linear-gradient(160deg, #131826 0%, #10141f 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: alertaPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes alertaPop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.alerta-box.alerta-error { border-color: var(--danger); }
.alerta-box.alerta-warning { border-color: var(--warning); }
.alerta-box.alerta-success { border-color: var(--success); }
.alerta-box.alerta-info { border-color: var(--primary); }
.alerta-icono {
  font-size: 2.5rem;
  margin-bottom: 10px;
}
.alerta-mensaje {
  color: var(--text-light);
  font-size: .95rem;
  margin-bottom: 22px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.alerta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  border-radius: 9px;
  border: none;
  font-family: 'Manrope', sans-serif;
  font-size: .88em;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.alerta-btn:hover { filter: brightness(1.1); }

/* ================================================================
   MODALES
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 10, 0.8);
  display: flex;
  align-items: safe center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  overflow-y: auto;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hide { display: none; }

.modal-card {
  background: linear-gradient(160deg, #131826 0%, #10141f 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0 0 28px;
  width: 100%;
  max-width: 500px;
  max-height: min(90vh, 900px);
  overflow: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 6;
  margin: 0 0 18px;
  padding: 16px 22px;
  background: linear-gradient(160deg, #171c2c 0%, #121722 100%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
}

.modal-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2em;
  color: #dbe2ff;
}

.modal-card > *:not(.modal-header) {
  padding-left: 22px;
  padding-right: 22px;
}

.modal-close {
  background: rgba(255,255,255,.08);
  border: 1px solid var(--border);
  color: #fff;
  font-size: 1.25em;
  line-height: 1;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: var(--transition);
  flex: 0 0 auto;
}

.modal-close:hover { color: #fff; background: rgba(255,107,107,0.4); border-color: rgba(255,107,107,.55); }

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 25px;
}

/* ── Modal calendario sueldos ──────────────────────────────── */
.sueldo-cal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 10, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2100;
  padding: 10px;
  animation: fadeIn 0.15s ease;
}
.sueldo-cal-overlay.hide { display: none; }

.sueldo-cal-card {
  background: linear-gradient(160deg, #131826 0%, #10141f 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 820px;
  max-height: 98vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.sueldo-cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sueldo-cal-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05em;
  color: #dbe2ff;
  margin: 0;
}
.sueldo-cal-header small {
  display: block;
  font-size: 0.72em;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}
.sueldo-cal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3em;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: var(--transition);
  line-height: 1;
}
.sueldo-cal-close:hover { color: var(--danger); background: rgba(255,107,107,0.1); }

.sueldo-cal-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px 18px 8px;
  position: relative;
  max-height: 60vh;
}

/* ── Grilla del calendario ── */
.sueldo-cal-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.sueldo-cal-grid th {
  padding: 4px 2px;
  text-align: center;
  font-size: 0.72em;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.sueldo-cal-grid td {
  border: 1px solid var(--border-soft);
  vertical-align: top;
  padding: 4px 3px;
  height: 70px;
  width: 14.28%;
  transition: background 0.15s;
  font-size: 0.68em;
}
.sueldo-cal-grid td.sueldo-cal-futuro {
  opacity: 0.35;
}
.sueldo-cal-grid td.sueldo-cal-fuera {
  opacity: 0.2;
  pointer-events: none;
}
.sueldo-cal-grid td.sueldo-cal-descanso {
  background: rgba(47, 133, 90, 0.15);
}
.sueldo-cal-grid td.sueldo-cal-falta {
  background: rgba(197, 48, 48, 0.1);
}
.sueldo-cal-grid td.sueldo-cal-hoy {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.sueldo-cal-grid td.sueldo-cal-corte {
  border-bottom: 3px solid var(--warning);
}

.sueldo-cal-num {
  font-size: 0.78em;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 2px;
  line-height: 1.2;
}
.sueldo-cal-hora {
  font-size: 0.68em;
  line-height: 1.3;
  color: var(--text-muted);
  white-space: nowrap;
}
.sueldo-cal-hora.sueldo-cal-tarde {
  color: var(--danger);
  font-weight: 700;
}
.sueldo-cal-estado {
  font-size: 0.65em;
  font-weight: 700;
  margin-top: 2px;
  line-height: 1.3;
}
.sueldo-cal-estado.ok { color: var(--success); }
.sueldo-cal-estado.tarde { color: var(--warning); }
.sueldo-cal-estado.descanso { color: #2f855a; }
.sueldo-cal-estado.falta { color: var(--danger); }
.sueldo-cal-estado.parcial {
  color: var(--info);
  font-size: 0.58em;
}

/* ── Separador de quincenas ── */
.sueldo-cal-quincena-label {
  font-size: 0.72em;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 0 4px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
  margin-top: 8px;
}
.sueldo-cal-quincena-label:first-child {
  margin-top: 0;
}

/* ── Editable fields ── */
.sueldo-cal-editor {
  border-top: 1px solid var(--border);
  padding: 14px 18px 16px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.15);
}
.sueldo-cal-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px 16px;
  margin-bottom: 12px;
}
.sueldo-cal-editor-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sueldo-cal-editor-item label {
  font-size: 0.7em;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.sueldo-cal-editor-item input,
.sueldo-cal-editor-item select {
  width: 100%;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-input);
  color: var(--text-light);
  font-size: 0.82em;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.sueldo-cal-editor-item input:focus,
.sueldo-cal-editor-item select:focus {
  border-color: var(--primary);
}
.sueldo-cal-editor-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin-top: 4px;
}
.sueldo-cal-editor-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 6px;
}

/* ── Mini modal para marcar descanso/falta ── */
.sueldo-cal-mini-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6,7,10,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 0 0 14px 14px;
}
.sueldo-cal-mini-overlay.hide { display: none; }
.sueldo-cal-mini-card {
  background: linear-gradient(160deg, #1a2035 0%, #131826 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.asist-aviso-foto-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  width: min(96px, 22vmin);
  height: min(96px, 22vmin);
  max-width: 96px;
  max-height: 96px;
  overflow: hidden;
  flex-shrink: 0;
}

.asist-aviso-foto {
  display: block;
  width: min(96px, 22vmin) !important;
  height: min(96px, 22vmin) !important;
  max-width: 96px !important;
  max-height: 96px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 3px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  background: rgba(0, 0, 0, 0.2);
}

.asist-aviso-foto-ph {
  width: min(96px, 22vmin);
  height: min(96px, 22vmin);
  max-width: 96px;
  max-height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  background: rgba(255, 255, 255, 0.08);
  border: 3px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.75);
  flex-shrink: 0;
}

.asist-marca-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(5, 7, 12, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.asist-marca-modal-box {
  width: min(92vw, 760px);
  border-radius: 20px;
  border: 2px solid transparent;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  text-align: center;
  padding: 28px 26px;
  animation: asistBlinkModal .55s steps(2, start) infinite;
}

.asist-marca-modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.4rem, 3.5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.asist-marca-modal-subtitle {
  font-size: clamp(1rem, 2.4vw, 1.28rem);
  font-weight: 700;
  line-height: 1.3;
}

.marca-modal-success {
  background: linear-gradient(160deg, rgba(16, 67, 42, 0.96), rgba(13, 48, 33, 0.96));
  border-color: rgba(86, 208, 142, 0.9);
  color: #dcffe9;
}

.marca-modal-danger {
  background: linear-gradient(160deg, rgba(102, 20, 20, 0.96), rgba(77, 13, 13, 0.96));
  border-color: rgba(255, 107, 107, 0.95);
  color: #ffe2e2;
}

@keyframes asistBlinkModal {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.38; transform: scale(0.995); }
}

/* Modal errores al marcar salida */
.asist-errores-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3100;
  background: rgba(5, 7, 12, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.asist-errores-modal-box {
  width: min(92vw, 500px);
  height: min(85vh, 700px);
  max-height: 700px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, rgba(22, 28, 45, 0.98), rgba(14, 18, 30, 0.98));
  border: 1px solid rgba(197, 168, 111, 0.45);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  padding: 24px 22px 20px;
  color: var(--text-primary, #e8ecf4);
}

.asist-errores-modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.1rem, 2.8vw, 1.35rem);
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 6px;
  color: var(--warning, #c5a86f);
  text-align: center;
}

.asist-errores-modal-nombre {
  font-size: 0.88rem;
  color: var(--text-muted, #9aa3b5);
  text-align: center;
  margin: 0 0 14px;
}

.asist-errores-modal-lista {
  list-style: none;
  margin: 0 0 14px;
  padding: 0 4px;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.asist-errores-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.asist-errores-item-head {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  font-size: 0.78rem;
}

.asist-errores-item-hora {
  color: var(--text-muted, #9aa3b5);
  font-weight: 600;
}

.asist-errores-item-seccion {
  background: rgba(197, 168, 111, 0.15);
  color: var(--warning, #c5a86f);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.asist-errores-item-desc {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.asist-errores-item-solucion {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted, #9aa3b5);
  font-style: italic;
}

.asist-errores-modal-pie {
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: center;
  margin: 0 0 14px;
  color: var(--success, #56d08e);
  font-weight: 600;
}

.asist-errores-modal-btn {
  width: 100%;
  font-size: 1rem;
  padding: 0.65rem;
}

/* ================================================================
   UTILIDADES
   ================================================================ */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted   { color: var(--text-muted); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }

.content-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 25px;
  align-items: start;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 10px;
}

.section-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.9em;
  color: #f0f3ff;
}

.section-subtitle { color: var(--text-muted); font-size: 0.9em; }

.placeholder-box {
  background: linear-gradient(160deg, #131826 0%, #10141f 100%);
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 60px 40px;
  text-align: center;
  color: var(--text-muted);
}

.placeholder-box .ph-icon { font-size: 3.5em; margin-bottom: 16px; opacity: 0.4; }
.placeholder-box h3 { font-size: 1.1em; margin-bottom: 8px; color: var(--text-light); opacity: 0.6; }
.placeholder-box p  { font-size: 0.85em; }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-darker); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a4255; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { width: 70px; }
  .sidebar .logo-subtitle,
  .sidebar .nav-text,
  .sidebar .nav-group-label,
  .sidebar .user-name,
  .sidebar .user-rol,
  .sidebar .btn-logout { display: none; }
  .sidebar-header .logo-img { max-height: 44px; }
  .sidebar .nav-link { justify-content: center; padding: 13px; }
  .sidebar .nav-icon { min-width: unset; }
  .main-content { margin-left: 70px; padding: 25px; }
  :root { --sidebar-w: 70px; }
  .content-grid { grid-template-columns: 1fr; }
  .page-header { margin: -25px -25px 25px -25px; padding: 12px 25px; }
}

@media (max-width: 600px) {
  .main-content { padding: 15px; }
  .cards-grid { grid-template-columns: 1fr; }
  .form-group-row { grid-template-columns: 1fr; }
  .page-header { margin: -15px -15px 20px -15px; padding: 10px 15px; }
  .page-header h2 { font-size: 1.05em; }
  #modTabsSlot {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
