/* ============================================================
   CONTROL DE ACCESO — Estilos principales
   Premium design — Mobile-first
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ---- Variables ---- */
:root {
  --primary:     #6366F1;
  --primary-d:   #4F46E5;
  --primary-rgb: 99,102,241;
  --success:     #10B981;
  --success-d:   #059669;
  --success-rgb: 16,185,129;
  --danger:      #EF4444;
  --danger-d:    #DC2626;
  --danger-rgb:  239,68,68;
  --warning:     #F59E0B;
  --info:        #0EA5E9;
  --gray-50:     #F8FAFC;
  --gray-100:    #F1F5F9;
  --gray-200:    #E2E8F0;
  --gray-300:    #CBD5E1;
  --gray-400:    #94A3B8;
  --gray-500:    #64748B;
  --gray-600:    #475569;
  --gray-700:    #334155;
  --gray-800:    #1E293B;
  --gray-900:    #0F172A;
  --bg:          #F8FAFC;
  --surface:     #FFFFFF;
  --text:        #0F172A;
  --text-muted:  #64748B;
  --border:      #E2E8F0;
  --radius:      16px;
  --radius-sm:   10px;
  --radius-xs:   6px;
  --shadow-sm:   0 1px 2px rgba(0,0,0,.05);
  --shadow:      0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-md:   0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  --shadow-lg:   0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1);
  --shadow-xl:   0 25px 50px -12px rgba(0,0,0,.25);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

/* ---- Utils ---- */
.hidden        { display: none !important; }
.text-center   { text-align: center; }
.text-muted    { color: var(--text-muted); }
.text-small    { font-size: .8125rem; }
.text-warning  { color: var(--warning); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }


/* ============================================================
   EMPLOYEE APP
   ============================================================ */

#employee-app {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(99,102,241,.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(16,185,129,.12) 0%, transparent 60%),
    linear-gradient(160deg, #0F0C29 0%, #1a1740 35%, #24243e 70%, #0d0d1a 100%);
  position: relative;
}

/* Decorative floating orbs */
#employee-app::before,
#employee-app::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(60px);
  opacity: .5;
}
#employee-app::before {
  width: 400px; height: 400px;
  top: -100px; left: -100px;
  background: radial-gradient(circle, rgba(99,102,241,.3), transparent 70%);
}
#employee-app::after {
  width: 300px; height: 300px;
  bottom: -80px; right: -80px;
  background: radial-gradient(circle, rgba(16,185,129,.25), transparent 70%);
}

.view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 1.5rem 1.25rem;
  position: relative;
  z-index: 1;
  animation: viewIn .35s cubic-bezier(.22,1,.36,1);
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Branding ---- */
.emp-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.emp-brand-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto .75rem;
  box-shadow: 0 8px 24px rgba(99,102,241,.4);
}

.emp-brand-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.01em;
}

.emp-brand-sub {
  font-size: .8rem;
  color: rgba(255,255,255,.5);
  margin-top: .2rem;
}

/* ---- Glass Card ---- */
.glass-card {
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 24px;
  padding: 2rem 1.75rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 48px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.12);
}

/* ---- Loading ---- */
#view-loading .glass-card {
  text-align: center;
  padding: 2.5rem 2rem;
}

.loading-brand {
  margin-bottom: 2rem;
}

.loading-ring {
  width: 56px; height: 56px;
  border: 3px solid rgba(255,255,255,.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  color: rgba(255,255,255,.75);
  font-size: .95rem;
  font-weight: 500;
  min-height: 1.5em;
}

.loading-step {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  padding: .3rem .85rem;
  font-size: .78rem;
  color: rgba(255,255,255,.5);
  margin-top: .75rem;
}

/* ---- Sign In ---- */
#view-signin .glass-card { text-align: center; }

.signin-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: .5rem;
  letter-spacing: -.02em;
}

.signin-sub {
  font-size: .9rem;
  color: rgba(255,255,255,.55);
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

.signin-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
  color: rgba(255,255,255,.3);
  font-size: .8rem;
}
.signin-divider::before, .signin-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.1);
}

#google-btn-container, #admin-google-btn {
  display: flex;
  justify-content: center;
}

.signin-note {
  font-size: .78rem;
  color: rgba(255,255,255,.35);
  margin-top: 1.25rem;
  line-height: 1.5;
}

/* ---- Confirm ---- */
.confirm-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  margin: 0 auto 1.25rem;
  box-shadow: 0 8px 24px rgba(99,102,241,.45);
  letter-spacing: -.02em;
  flex-shrink: 0;
}

.confirm-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  text-align: center;
  letter-spacing: -.02em;
  margin-bottom: .25rem;
}

.confirm-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.confirm-meta-pill {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: .25rem .75rem;
  font-size: .8rem;
  color: rgba(255,255,255,.7);
  font-weight: 500;
}

.estado-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .9rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.estado-badge::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Badges del panel admin (fondos claros — colores sólidos legibles) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .7rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-success   { background: #DCFCE7; color: #15803D; }
.badge-danger    { background: #FEE2E2; color: #B91C1C; }
.badge-warning   { background: #FEF3C7; color: #B45309; }
.badge-info      { background: #E0F2FE; color: #0369A1; }
.badge-secondary { background: var(--gray-100); color: var(--gray-600); }

/* Badges glass para la app del empleado (fondos oscuros) */
.badge-dentro  { background: rgba(16,185,129,.2);  color: #34D399; border: 1px solid rgba(16,185,129,.3); }
.badge-fuera   { background: rgba(251,191,36,.15);  color: #FCD34D; border: 1px solid rgba(251,191,36,.25); }

/* Spinner (panel admin) */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.confirm-live-time {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  color: rgba(255,255,255,.9);
  letter-spacing: -.03em;
  margin-bottom: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* ---- Botones ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  border: none;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 700;
  transition: all .18s cubic-bezier(.22,1,.36,1);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -.01em;
}
.btn:active    { transform: scale(.96); }
.btn:disabled  { opacity: .45; cursor: not-allowed; pointer-events: none; }

.btn-primary  { background: var(--primary); color: #fff; box-shadow: 0 4px 16px rgba(var(--primary-rgb),.45); }
.btn-primary:hover { background: var(--primary-d); box-shadow: 0 6px 20px rgba(var(--primary-rgb),.55); }

.btn-success  {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #fff;
  box-shadow: 0 4px 16px rgba(16,185,129,.45);
}
.btn-success:hover { box-shadow: 0 6px 22px rgba(16,185,129,.55); transform: translateY(-1px); }

.btn-danger   {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #fff;
  box-shadow: 0 4px 16px rgba(239,68,68,.45);
}
.btn-danger:hover { box-shadow: 0 6px 22px rgba(239,68,68,.55); transform: translateY(-1px); }

.btn-ghost  {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.6);
  font-size: .875rem;
  font-weight: 500;
}
.btn-ghost:hover { background: rgba(255,255,255,.12); color: rgba(255,255,255,.85); }

/* Separador de sección en el sidebar del admin */
.nav-section-label {
  margin: 1rem 1.5rem .4rem;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: rgba(255,255,255,.45);
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: .9rem;
}

/* Toggle segmentado (vistas de Asistencias) */
.seg-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.seg-btn {
  border: none;
  background: transparent;
  padding: .45rem .9rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--gray-500, #64748B);
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.seg-btn:hover { background: var(--gray-50); }
.seg-btn.seg-active {
  background: var(--primary, #4F46E5);
  color: #fff;
}

/* Calendario de asistencias (grilla empleado × días) */
.cal-table { border-collapse: collapse; }
.cal-table th,
.cal-table td { border: 1px solid var(--border); }
.cal-day-head {
  min-width: 34px;
  text-align: center;
  font-size: .72rem;
  padding: .3rem .15rem;
  background: #fff;
}
.cal-tot-head {
  min-width: 48px;
  text-align: center;
  font-size: .72rem;
  padding: .3rem .3rem;
  background: #fff;
}
.cal-cell {
  text-align: center;
  font-size: .72rem;
  font-weight: 600;
  padding: .38rem .15rem;
  color: var(--gray-300, #CBD5E1);
}
.cal-we { background: var(--gray-50); }
.cal-on {
  background: #DCFCE7;
  color: #15803D;
}
.cal-open {
  background: #FEF3C7;
  color: #B45309;
}
.cal-tot {
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
  padding: .38rem .3rem;
  background: #fff;
  color: var(--gray-900);
}

/* Celdas de novedades (códigos de la planilla de la empresa) */
.cal-cell.cal-click { cursor: pointer; }
.cal-cell.cal-click:hover { outline: 2px solid #94A3B8; outline-offset: -2px; }
.cal-nov { font-size: .68rem; font-weight: 800; }
.nov-D  { background: #E2E8F0; color: #475569; }   /* Descanso */
.nov-V  { background: #EDE9FE; color: #6D28D9; }   /* Vacaciones */
.nov-LC { background: #DBEAFE; color: #1D4ED8; }   /* Licencia */
.nov-EC { background: #FFEDD5; color: #C2410C; }   /* Extra campamento */
.nov-EB { background: #FEF9C3; color: #A16207; }   /* Extra base */
.nov-PM { background: #FCE7F3; color: #BE185D; }   /* Parte médico */
.nov-AJ { background: #CCFBF1; color: #0F766E; }   /* Ausente justificado */
.nov-AI { background: #FEE2E2; color: #B91C1C; }   /* Ausente injustificado */
.nov-dot {
  display: inline-block;
  width: .6rem;
  height: .6rem;
  border-radius: 3px;
  margin: 0 .1rem;
  vertical-align: middle;
}
/* Badges compactos de novedades en el resumen */
.nov-badge {
  display: inline-block;
  padding: .1rem .35rem;
  margin: 0 .12rem .12rem 0;
  border-radius: 6px;
  font-size: .68rem;
  font-weight: 700;
}

/* Fila expandible de detalle diario */
.reg-det-row > td { border-top: none; }

/* Modal de edición (módulo Operación) */
.op-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.op-modal-overlay.hidden { display: none; }
.op-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .28);
  animation: opModalIn .18s ease-out;
}
@keyframes opModalIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.op-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.05rem 1.4rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  z-index: 1;
}
.op-modal-header h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--gray-900);
}
.op-modal-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--gray-500, #64748B);
  cursor: pointer;
  padding: .2rem .45rem;
  border-radius: 8px;
}
.op-modal-close:hover { background: var(--gray-100, #F1F5F9); }
.op-modal-body { padding: 1.25rem 1.4rem .25rem; }
.op-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: #fff;
  border-radius: 0 0 16px 16px;
}

/* Outline para fondos claros (panel admin) */
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gray-300);
  color: var(--gray-700);
  font-weight: 600;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(var(--primary-rgb),.05); }

/* Warning (botón Reset del admin) */
.btn-warning {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #fff;
}
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }

.btn-sm  { padding: .4rem .875rem; font-size: .825rem; border-radius: 8px; }
.btn-lg  {
  padding: 1rem 1.75rem;
  font-size: 1.075rem;
  border-radius: 14px;
}
.btn-full { width: 100%; }

/* ---- Success ---- */
.success-bg-ingreso {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(16,185,129,.25) 0%, transparent 60%),
    linear-gradient(160deg, #0a2010 0%, #0d2a1e 40%, #0F0C29 100%);
}
.success-bg-egreso {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(99,102,241,.25) 0%, transparent 60%),
    linear-gradient(160deg, #0F0C29 0%, #1a1740 40%, #24243e 100%);
}

.success-icon-wrap {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  margin: 0 auto 1.25rem;
}
.success-icon-ingreso {
  background: linear-gradient(135deg, rgba(16,185,129,.25), rgba(16,185,129,.1));
  border: 2px solid rgba(16,185,129,.4);
  box-shadow: 0 0 30px rgba(16,185,129,.25);
}
.success-icon-egreso {
  background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(99,102,241,.1));
  border: 2px solid rgba(99,102,241,.4);
  box-shadow: 0 0 30px rgba(99,102,241,.25);
}

.success-titulo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  text-align: center;
  letter-spacing: -.02em;
  margin-bottom: .25rem;
}

.success-nombre {
  text-align: center;
  color: rgba(255,255,255,.65);
  font-size: .925rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.success-time-display {
  text-align: center;
  margin-bottom: 1.25rem;
}

.success-hora {
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.success-fecha-dia {
  font-size: .875rem;
  color: rgba(255,255,255,.5);
  margin-top: .4rem;
  font-weight: 500;
}

.success-sector-tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  padding: .3rem .85rem;
  font-size: .8rem;
  color: rgba(255,255,255,.6);
  font-weight: 500;
  margin: 0 auto .75rem;
}

.success-duracion-pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1.25rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, rgba(99,102,241,.3), rgba(168,85,247,.2));
  border: 1px solid rgba(99,102,241,.4);
  color: #c4b5fd;
  box-shadow: 0 4px 16px rgba(99,102,241,.2);
}

/* Progress countdown bar */
.countdown-bar-wrap {
  margin-top: 1.75rem;
}

.countdown-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: rgba(255,255,255,.4);
  font-size: .78rem;
  font-weight: 500;
  margin-bottom: .5rem;
}

.countdown-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  background: rgba(255,255,255,.12);
  border-radius: 50%;
  font-size: .78rem;
  font-weight: 700;
  color: rgba(255,255,255,.6);
  font-variant-numeric: tabular-nums;
}

.countdown-track {
  height: 4px;
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  overflow: hidden;
}

.countdown-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #a855f7);
  transition: width 1s linear;
}
.countdown-fill-green {
  background: linear-gradient(90deg, #10B981, #34D399);
}

/* Compact countdown (for non-success screens) */
.countdown-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: rgba(255,255,255,.4);
  font-size: .8125rem;
  margin-top: 1.25rem;
}
.countdown-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
  font-weight: 700;
  font-size: .8125rem;
  color: rgba(255,255,255,.7);
}

/* ---- Error ---- */
.error-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(239,68,68,.15);
  border: 1.5px solid rgba(239,68,68,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 1rem;
}

.error-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #F87171;
  text-align: center;
  margin-bottom: .5rem;
  letter-spacing: -.01em;
}

.error-msg {
  color: rgba(255,255,255,.55);
  font-size: .9rem;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

/* ---- Goodbye ---- */
.goodbye-view .glass-card { text-align: center; }

/* ============================================================
   ADMIN APP  (sin cambios visuales — sólo preservar)
   ============================================================ */

#admin-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

#admin-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1rem;
}

#admin-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

/* Card light (admin) */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.card-icon  { font-size: 3.5rem; text-align: center; margin-bottom: 1rem; line-height: 1; }
.card-title { font-size: 1.375rem; font-weight: 700; text-align: center; margin-bottom: .5rem; }
.card-subtitle { font-size: .9rem; color: var(--text-muted); text-align: center; margin-bottom: 1.5rem; }

/* Admin layout */
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 240px;
  background: var(--gray-900);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
  transition: transform .3s;
}

.sidebar-logo { padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-logo-icon  { font-size: 1.75rem; }
.sidebar-logo-title { font-weight: 700; font-size: 1rem; margin-top: .25rem; }
.sidebar-logo-sub   { font-size: .75rem; opacity: .6; }

.sidebar-nav { flex: 1; padding: 1rem 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.5rem;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  transition: background .15s, color .15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: .925rem;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.tab-active { background: rgba(99,102,241,.3); color: #fff; border-left-color: var(--primary); }
.nav-item-icon { font-size: 1.1rem; width: 20px; }

.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,.1); }

.sidebar-user { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-user-name  { font-size: .875rem; font-weight: 600; }
.sidebar-user-email { font-size: .75rem; opacity: .6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }

.admin-main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

.admin-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}
.admin-topbar-title { font-size: 1.25rem; font-weight: 700; }

.admin-content { padding: 1.5rem; flex: 1; max-width: 1200px; }

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-value { font-size: 2.25rem; font-weight: 800; line-height: 1; color: var(--primary); }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }

/* Tables */
.table-container { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.table-title { font-weight: 700; font-size: 1rem; }

table { width: 100%; border-collapse: collapse; }
th {
  padding: .75rem 1rem;
  text-align: left;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  background: var(--gray-100);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: .875rem 1rem; border-bottom: 1px solid var(--border); font-size: .9rem; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-100); }

.emp-name     { font-weight: 600; }
.actions-cell { white-space: nowrap; }
.actions-cell .btn + .btn { margin-left: .4rem; }

/* Buttons (admin light theme) */
.btn-primary-light { background: var(--primary); color: #fff; }
.btn-primary-light:hover { background: var(--primary-d); }

/* Filters */
.filters-bar { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }

.form-input, .form-select {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .875rem;
  color: var(--text);
  font-size: .9rem;
  transition: border-color .15s;
  min-width: 0;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.15);
}
.form-group  { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.form-label  { font-size: .875rem; font-weight: 600; }
.form-msg    { padding: .75rem 1rem; border-radius: var(--radius-sm); font-size: .875rem; margin-top: .75rem; }
.form-msg.success { background: #DCFCE7; color: #15803D; }
.form-msg.error   { background: #FEE2E2; color: #B91C1C; }
.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-check  { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }

/* Informe */
.informe-controls {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
#inf-resultado { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

/* Config / Add employee */
.config-form { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); max-width: 600px; }
.add-emp-form { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); max-width: 600px; margin-top: 1.5rem; }

/* Hamburger */
.btn-menu { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text); padding: .25rem; }

/* Admin badge overrides (light) */
.badge-dentro-light  { background: #DCFCE7; color: #15803D; }
.badge-fuera-light   { background: #FEF9C3; color: #854D0E; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .btn-menu { display: block; }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 49; display: none; }
  .sidebar-overlay.open { display: block; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  th:nth-child(n+5), td:nth-child(n+5) { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .informe-controls { flex-direction: column; }
  .admin-content { padding: 1rem; }
  .table-header { flex-direction: column; align-items: flex-start; }

  .glass-card { padding: 1.75rem 1.4rem; }
  .success-hora { font-size: 2.5rem; }
}

@media (max-width: 380px) {
  .glass-card { padding: 1.5rem 1.2rem; border-radius: 20px; }
  .success-hora { font-size: 2.25rem; }
  .confirm-name { font-size: 1.25rem; }
}

/* ---- Print ---- */
@media print {
  .admin-sidebar, .admin-topbar, .btn, .filters-bar { display: none !important; }
  .admin-main { margin-left: 0; }
}
