/* ══════════════════════════════════════════════════════════════
   BRAINE.AI — Portal del Trabajador
   Diseño profesional mobile-first
   ══════════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f0f2f5;
  color: #1f2937;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}
a { color: #1A7AF8; text-decoration: none; cursor: pointer; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, textarea, select { font: inherit; }
.hidden { display: none !important; }
.page { display: none; }
.page.active { display: block; }

/* ═══════════════════════════════════════════════════════
   LOGIN
   Mobile: pantalla completa, logo + form directo
   Desktop: card centrada con 2 columnas (form | branding+mascota)
   ═══════════════════════════════════════════════════════ */

/* ── Background ── */
.login-bg {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: #f5f7fa;
  padding: 0;
}

/* ── Card container ── */
.login-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #fff;
  overflow: hidden;
}

/* ── Form column ── */
.login-col-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 36px;
  flex: 1;
}
.login-form-inner {
  width: 100%;
  max-width: 380px;
}
.login-logo {
  height: 54px;
  width: auto;
  max-width: 260px;
  margin-bottom: 32px;
  object-fit: contain;
}
.login-col-form h1 {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}
.login-subtitle {
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 28px;
}
.login-footer {
  margin-top: 28px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.login-footer svg { stroke: #16a34a; }

/* ── Brand column (HIDDEN on mobile) ── */
.login-col-brand {
  display: none;
}
.login-brand-inner {
  position: relative;
  z-index: 2;
}
.login-brand-logo {
  height: 80px;
  width: auto;
  filter: brightness(0) invert(1);
  margin-bottom: 8px;
}
.login-brand-tagline {
  font-size: 14px;
  font-weight: 300;
  color: rgba(255,255,255,0.5);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 40px;
}
.login-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  color: rgba(255,255,255,0.8);
  line-height: 1.4;
}
.login-feature svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  opacity: 0.6;
}
.login-mascota {
  position: absolute;
  bottom: 0;
  right: -10px;
  width: 400px;
  filter: drop-shadow(-20px -10px 50px rgba(0,0,0,0.4));
  z-index: 1;
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* ── Form elements ── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.input-icon-wrap {
  position: relative;
}
.input-icon-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #9ca3af;
  transition: color 0.2s;
}
.input-icon-wrap input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  font-size: 16px;
  background: #f9fafb;
  transition: all 0.2s;
}
.input-icon-wrap input:focus {
  border-color: #1A7AF8;
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(26,122,248,0.1);
}
.input-icon-wrap input:focus ~ svg,
.input-icon-wrap:focus-within svg {
  color: #1A7AF8;
}
.otp-input-wrap input {
  width: 100%;
  padding: 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  font-size: 28px;
  letter-spacing: 12px;
  text-align: center;
  background: #f9fafb;
  font-weight: 600;
  transition: all 0.2s;
}
.otp-input-wrap input:focus {
  border-color: #1A7AF8;
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(26,122,248,0.1);
}

/* WhatsApp green accent for the OTP send button */
.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #1A7AF8 0%, #1565D8 100%);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s;
  box-shadow: 0 4px 14px rgba(26,122,248,0.3);
  position: relative;
  overflow: hidden;
}
.btn-login::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s;
}
.btn-login:hover::after { left: 100%; }
.btn-login:hover {
  box-shadow: 0 6px 20px rgba(26,122,248,0.4);
  transform: translateY(-1px);
}
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-login:disabled::after { display: none; }

/* WhatsApp-branded variant */
.btn-login.btn-whatsapp {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  box-shadow: 0 4px 14px rgba(37,211,102,0.3);
}
.btn-login.btn-whatsapp:hover {
  box-shadow: 0 6px 20px rgba(37,211,102,0.4);
}

.form-error { color: #dc2626; font-size: 13px; margin-top: 8px; padding: 8px 12px; background: #fef2f2; border-radius: 8px; }

.otp-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border-radius: 12px;
  border: 1px solid #bbf7d0;
  margin-bottom: 20px;
}
.otp-info { font-size: 14px; font-weight: 600; color: #166534; }
.otp-phone { font-size: 13px; color: #15803d; }

.btn-link-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  padding: 12px;
  font-size: 14px;
  color: #6b7280;
  margin-top: 12px;
  border-radius: 8px;
  transition: all 0.2s;
}
.btn-link-back:hover { color: #1A7AF8; background: #f0f7ff; }

/* login-footer is defined in the LOGIN section above */

/* ═══════════════════════════════════════════════════════
   APP SHELL — Header + Content + Bottom Nav
   ═══════════════════════════════════════════════════════ */

/* App Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-logo { width: 36px; height: 36px; border-radius: 10px; }
.header-titles { display: flex; flex-direction: column; }
.header-company { font-size: 14px; font-weight: 700; color: #111827; line-height: 1.2; }
.header-portal { font-size: 11px; color: #6b7280; }
.header-right { display: flex; align-items: center; gap: 10px; }
.header-user { display: none; font-size: 13px; color: #6b7280; }
.btn-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #1A7AF8, #3B82F6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(26,122,248,0.25);
}

/* Page inner layout */
#page-container {
  padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
}
.page-inner { display: none; }
.page-inner.active { display: block; }
.page-inner-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
.page-inner-header h2 { font-size: 18px; font-weight: 600; }
.content-area { padding: 16px; }

/* Back button */
.btn-back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background 0.2s;
}
.btn-back:hover { background: #f3f4f6; }

/* ═══════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════ */
.welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px;
  margin: 16px;
  background: linear-gradient(135deg, #1A7AF8 0%, #3B82F6 50%, #60A5FA 100%);
  border-radius: 20px;
  color: #fff;
  overflow: hidden;
  position: relative;
}
.welcome-banner::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}
.welcome-text h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.welcome-sub { font-size: 14px; opacity: 0.85; }
.welcome-company-name {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  text-align: right;
  max-width: 40%;
}
/* When banner image is loaded */
.welcome-banner.has-banner {
  background: none; /* override the gradient — JS sets background-image */
  min-height: 140px;
}
.welcome-banner.has-banner .welcome-text h2,
.welcome-banner.has-banner .welcome-sub,
.welcome-banner.has-banner .welcome-company-name {
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 16px 16px;
}
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  border: 1px solid #f3f4f6;
}
.stat-card .stat-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  margin-bottom: 10px;
}
.stat-card .stat-icon.si-blue { background: #eff6ff; color: #1A7AF8; }
.stat-card .stat-icon.si-green { background: #f0fdf4; color: #16a34a; }
.stat-card .stat-icon.si-orange { background: #fff7ed; color: #ea580c; }
.stat-card .stat-icon.si-purple { background: #faf5ff; color: #9333ea; }
.stat-card .stat-value { font-size: 24px; font-weight: 700; color: #111827; line-height: 1; }
.stat-card .stat-label { font-size: 12px; color: #6b7280; margin-top: 4px; }

/* Quick access grid */
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 16px 10px;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 16px 20px;
}
.quick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 8px 14px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  border: 1px solid #f3f4f6;
  transition: all 0.2s;
  text-align: center;
}
.quick-card:active { transform: scale(0.97); }
.quick-card span { font-size: 13px; font-weight: 600; color: #374151; margin-top: 4px; }
.quick-card .quick-desc { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.quick-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}
.qi-blue { background: #eff6ff; color: #1A7AF8; }
.qi-green { background: #f0fdf4; color: #16a34a; }
.qi-pink { background: #fdf2f8; color: #ec4899; }
.qi-purple { background: #faf5ff; color: #9333ea; }
.qi-orange { background: #fff7ed; color: #ea580c; }
.quick-icon svg { stroke: currentColor; }

/* ═══════════════════════════════════════════════════════
   ATTENDANCE
   ═══════════════════════════════════════════════════════ */
.month-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 14px;
  background: #fff;
  font-weight: 600;
  font-size: 15px;
  border-bottom: 1px solid #f3f4f6;
}
.month-selector button {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s;
}
.month-selector button:hover { background: #f3f4f6; }

.summary-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 14px 16px;
}
.summary-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  border: 1px solid #f3f4f6;
}
.summary-card .val { font-size: 22px; font-weight: 700; color: #1A7AF8; }
.summary-card .lbl { font-size: 11px; color: #6b7280; margin-top: 2px; }

/* Tables */
.table-wrap { padding: 0 16px 20px; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  border: 1px solid #f3f4f6;
  font-size: 13px;
}
.data-table th {
  background: #f9fafb;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #6b7280;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.data-table td {
  padding: 10px 12px;
  border-top: 1px solid #f3f4f6;
  color: #374151;
}
.data-table tr:hover td { background: #f9fafb; }

/* ═══════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-green { background: #dcfce7; color: #166534; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f3f4f6; color: #6b7280; }

/* ═══════════════════════════════════════════════════════
   PAYROLL
   ═══════════════════════════════════════════════════════ */
.payroll-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid #f3f4f6;
  cursor: pointer;
  transition: all 0.2s;
}
.payroll-card:active { transform: scale(0.99); }
.payroll-card .period { font-size: 14px; font-weight: 600; color: #111827; margin-bottom: 4px; }
.payroll-card .project { font-size: 12px; color: #6b7280; }
.payroll-card .total { font-size: 22px; font-weight: 700; color: #16a34a; margin-top: 10px; }
.payroll-card .details { font-size: 12px; color: #9ca3af; margin-top: 4px; }

.payroll-detail {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid #f3f4f6;
}
.payroll-detail h3 { font-size: 16px; margin-bottom: 16px; color: #111827; }
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row .label { color: #6b7280; }
.detail-row .value { font-weight: 600; color: #111827; }
.detail-row.total {
  font-size: 16px;
  color: #16a34a;
  border-top: 2px solid #16a34a;
  border-bottom: none;
  margin-top: 8px;
  padding-top: 14px;
}
.detail-row.total .label, .detail-row.total .value { color: #16a34a; }

/* ═══════════════════════════════════════════════════════
   BENEFITS
   ═══════════════════════════════════════════════════════ */
.tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 0 16px;
}
.tab {
  flex: 1;
  padding: 14px 8px;
  font-weight: 500;
  font-size: 14px;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  text-align: center;
  transition: all 0.2s;
}
.tab.active { color: #1A7AF8; border-bottom-color: #1A7AF8; font-weight: 600; }

.benefit-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid #f3f4f6;
}
.benefit-card .cat {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
}
.cat-legal { background: #ede9fe; color: #6d28d9; }
.cat-financiero { background: #fef3c7; color: #92400e; }
.cat-salud { background: #dcfce7; color: #166534; }
.cat-transporte { background: #dbeafe; color: #1e40af; }
.cat-educacion { background: #fce7f3; color: #9d174d; }
.cat-otro { background: #f3f4f6; color: #6b7280; }
.benefit-icon { margin-bottom: 10px; }
.benefit-card h4 { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: #111827; }
.benefit-card p { font-size: 13px; color: #6b7280; margin-bottom: 14px; line-height: 1.4; }

.btn-primary {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #1A7AF8 0%, #1565D8 100%);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(26,122,248,0.2);
}
.btn-primary:hover { box-shadow: 0 4px 12px rgba(26,122,248,0.3); }
.btn-sm {
  padding: 8px 16px;
  background: #1A7AF8;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  width: auto;
}
.btn-outline {
  padding: 8px 16px;
  border: 1.5px solid #d1d5db;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  background: #fff;
}
.btn-outline:hover { border-color: #1A7AF8; color: #1A7AF8; }

.request-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid #f3f4f6;
}
.request-card .req-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.request-card h4 { font-size: 14px; font-weight: 600; color: #111827; }
.request-card .req-date { font-size: 12px; color: #9ca3af; }
.request-card .req-notes { font-size: 13px; color: #6b7280; margin-top: 8px; }

/* ═══════════════════════════════════════════════════════
   CERTIFICATE
   ═══════════════════════════════════════════════════════ */
.cert-container {
  display: flex;
  justify-content: center;
  padding: 40px 16px;
}
.cert-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px 24px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  border: 1px solid #f3f4f6;
  max-width: 420px;
  width: 100%;
}
.cert-icon-wrap {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  border-radius: 20px;
  margin: 0 auto 20px;
}
.cert-card h3 { font-size: 20px; font-weight: 700; color: #111827; margin-bottom: 10px; }
.cert-card p { font-size: 14px; color: #6b7280; margin-bottom: 28px; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════
   PROFILE
   ═══════════════════════════════════════════════════════ */
.profile-section {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid #f3f4f6;
}
.profile-section h3 {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  font-weight: 600;
}
.profile-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
}
.profile-row:last-child { border-bottom: none; }
.profile-row .label { color: #6b7280; }
.profile-row .value { font-weight: 500; text-align: right; max-width: 60%; word-break: break-all; color: #111827; }

.profile-edit { margin-top: 16px; }
.profile-edit label { display: block; font-size: 13px; color: #6b7280; margin-bottom: 4px; font-weight: 500; }
.profile-edit input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 14px;
  background: #f9fafb;
  transition: all 0.2s;
}
.profile-edit input:focus { border-color: #1A7AF8; outline: none; background: #fff; }

/* ═══════════════════════════════════════════════════════
   MENU OVERLAY
   ═══════════════════════════════════════════════════════ */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  backdrop-filter: blur(2px);
}
.menu-overlay.hidden { display: none; }
.menu-panel {
  width: 300px;
  background: #fff;
  height: 100%;
  box-shadow: -8px 0 30px rgba(0,0,0,0.15);
  animation: slideIn 0.25s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.menu-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: linear-gradient(135deg, #1A7AF8 0%, #3B82F6 100%);
  color: #fff;
}
.menu-avatar {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}
.menu-user-name { font-weight: 600; font-size: 15px; }
.menu-user-company { font-size: 12px; opacity: 0.8; }
.menu-close {
  margin-left: auto;
  padding: 4px;
  border-radius: 6px;
  opacity: 0.8;
}
.menu-close:hover { opacity: 1; background: rgba(255,255,255,0.15); }

.menu-nav { padding: 8px 0; }
.menu-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  font-size: 15px;
  color: #374151;
  transition: background 0.15s;
}
.menu-nav a:hover { background: #f9fafb; }
.menu-nav a svg { color: #6b7280; flex-shrink: 0; }
.menu-divider { height: 1px; background: #e5e7eb; margin: 8px 16px; }
.menu-logout { color: #dc2626 !important; }
.menu-logout svg { color: #dc2626 !important; }

/* ═══════════════════════════════════════════════════════
   BOTTOM NAV
   ═══════════════════════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}
.bottom-nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 0 8px;
  font-size: 11px;
  color: #9ca3af;
  font-weight: 500;
  transition: color 0.2s;
}
.bottom-nav button.active { color: #1A7AF8; }
.bottom-nav button svg { stroke: currentColor; }

/* ═══════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-content {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-content h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: #111827; }
.modal-content label { display: block; font-size: 13px; color: #6b7280; margin-bottom: 6px; font-weight: 500; }
.modal-content input, .modal-content textarea, .modal-content select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 14px;
  background: #f9fafb;
  transition: all 0.2s;
}
.modal-content input:focus, .modal-content textarea:focus, .modal-content select:focus {
  border-color: #1A7AF8;
  outline: none;
  background: #fff;
}
.modal-content textarea { min-height: 80px; resize: vertical; }
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions button { flex: 1; }

/* ═══════════════════════════════════════════════════════
   EMPTY STATE, SPINNER, TOAST
   ═══════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #9ca3af;
}
.empty-state svg { margin-bottom: 14px; opacity: 0.4; }
.empty-state p { font-size: 14px; line-height: 1.5; }

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-center {
  display: flex;
  justify-content: center;
  padding: 40px;
}
.loading-center .spinner {
  border-color: rgba(26,122,248,0.15);
  border-top-color: #1A7AF8;
  width: 28px;
  height: 28px;
}

#toastContainer {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  background: #1f2937;
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  animation: fadeInUp 0.3s ease;
  white-space: nowrap;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .quick-grid { grid-template-columns: repeat(5, 1fr); }
  .summary-cards { grid-template-columns: repeat(4, 1fr); }
  .header-user { display: block; }
}

@media (min-width: 768px) {
  #page-container { max-width: 960px; margin: 0 auto; }
  .bottom-nav { max-width: 960px; left: 50%; transform: translateX(-50%); border-radius: 16px 16px 0 0; }

  /* Dashboard desktop enhancements */
  .welcome-banner { padding: 32px 36px; margin: 20px 20px 16px; border-radius: 24px; }
  .welcome-text h2 { font-size: 26px; }
  .welcome-sub { font-size: 15px; }
  .welcome-company-name { font-size: 14px; }
  .welcome-banner.has-banner { min-height: 160px; }
  .stats-grid { gap: 14px; padding: 0 20px 20px; }
  .stat-card { padding: 20px; border-radius: 16px; }
  .stat-card .stat-value { font-size: 28px; }
  .stat-card .stat-label { font-size: 13px; }
  .stat-card .stat-icon { width: 42px; height: 42px; border-radius: 12px; }
  .section-title { padding: 0 20px 12px; font-size: 13px; }
  .quick-grid { gap: 14px; padding: 0 20px 24px; }
  .quick-card { padding: 22px 12px 18px; border-radius: 18px; }
  .quick-card span { font-size: 14px; }
  .quick-icon { width: 50px; height: 50px; border-radius: 16px; }
  .content-area { padding: 20px; }
  .table-wrap { padding: 0 20px 24px; }
  .page-inner-header { padding: 18px 20px; }
  .page-inner-header h2 { font-size: 20px; }
}

@media (min-width: 1100px) {
  #page-container { max-width: 1200px; padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .bottom-nav { max-width: 1200px; }

  .welcome-banner { padding: 36px 44px; margin: 24px 24px 20px; }
  .welcome-text h2 { font-size: 30px; }
  .welcome-company-name { font-size: 15px; }
  .welcome-banner.has-banner { min-height: 180px; }
  .stats-grid { gap: 16px; padding: 0 24px 24px; }
  .stat-card { padding: 24px; }
  .stat-card .stat-value { font-size: 32px; }
  .stat-card .stat-label { font-size: 14px; }
  .section-title { padding: 0 24px 14px; font-size: 14px; }
  .quick-grid { grid-template-columns: repeat(5, 1fr); gap: 16px; padding: 0 24px 28px; }
  .quick-card { padding: 24px 14px 20px; }
  .quick-card span { font-size: 15px; }
  .quick-card .quick-desc { font-size: 12px; }
  .quick-icon { width: 56px; height: 56px; }
  .content-area { padding: 24px; }
  .table-wrap { padding: 0 24px 28px; }
  .data-table { font-size: 14px; }
  .data-table th { padding: 12px 16px; font-size: 12px; }
  .data-table td { padding: 12px 16px; }
  .summary-cards { gap: 14px; padding: 16px 24px; }
  .summary-card { padding: 18px; border-radius: 14px; }
  .summary-card .val { font-size: 26px; }
  .summary-card .lbl { font-size: 12px; }
  .page-inner-header { padding: 20px 24px; }
  .page-inner-header h2 { font-size: 22px; }

  /* Payroll cards wider */
  .payroll-card { padding: 22px; border-radius: 16px; }
  .payroll-card .period { font-size: 16px; }
  .payroll-card .total { font-size: 26px; }
  .payroll-detail { padding: 28px; border-radius: 16px; }
  .detail-row { padding: 12px 0; font-size: 15px; }

  /* Benefits */
  .benefit-card { padding: 22px; border-radius: 16px; }
  .benefit-card h4 { font-size: 16px; }
  .benefit-card p { font-size: 14px; }

  /* Profile */
  .profile-section { padding: 22px; border-radius: 16px; }
  .profile-row { font-size: 15px; padding: 12px 0; }

  /* Header desktop */
  .app-header { padding: 14px 24px; }
  .header-logo { width: 42px; height: 42px; border-radius: 12px; }
  .header-company { font-size: 16px; }
  .header-portal { font-size: 12px; }
  .btn-avatar { width: 40px; height: 40px; font-size: 16px; }

  /* Bottom nav desktop */
  .bottom-nav button { padding: 12px 0 10px; font-size: 12px; }
}

/* ═══════════════════════════════════════════════════════
   LOGIN — DESKTOP (900px+)
   Card centrada: formulario izquierda | branding+mascota derecha
   ═══════════════════════════════════════════════════════ */
@media (min-width: 900px) {
  .login-bg {
    align-items: center;
    padding: 32px;
    background:
      radial-gradient(ellipse at 20% 50%, rgba(26,122,248,0.08) 0%, transparent 50%),
      radial-gradient(ellipse at 80% 80%, rgba(59,130,246,0.06) 0%, transparent 50%),
      linear-gradient(135deg, #eef2f7 0%, #e8ecf4 50%, #f0f4f9 100%);
  }
  .login-card {
    flex-direction: row;
    max-width: 1100px;
    width: 100%;
    min-height: 640px;
    border-radius: 28px;
    box-shadow:
      0 25px 80px rgba(0,0,0,0.12),
      0 8px 24px rgba(0,0,0,0.06),
      0 0 0 1px rgba(0,0,0,0.03);
  }
  .login-col-form {
    width: 45%;
    padding: 56px 48px;
    flex: none;
  }
  .login-form-inner { max-width: 360px; }
  .login-logo { height: 56px; max-width: 280px; margin-bottom: 36px; }
  .login-col-form h1 { font-size: 28px; margin-bottom: 10px; }
  .login-subtitle { font-size: 15px; margin-bottom: 32px; }
  .login-footer { margin-top: 40px; }

  /* ── Mostrar columna branding en desktop ── */
  .login-col-brand {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 55%;
    background: linear-gradient(160deg, #040c1a 0%, #0a1e40 30%, #0f3072 60%, #1A7AF8 100%);
    color: #fff;
    padding: 56px 48px 0;
    position: relative;
    overflow: hidden;
    border-radius: 0 28px 28px 0;
  }
  /* Glow orbs */
  .login-col-brand::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -60px;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(26,122,248,0.35) 0%, transparent 65%);
    border-radius: 50%;
    pointer-events: none;
  }
  .login-col-brand::after {
    content: '';
    position: absolute;
    bottom: 60px;
    left: -40px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(96,165,250,0.2) 0%, transparent 65%);
    border-radius: 50%;
    pointer-events: none;
  }
  .login-brand-logo { height: 80px; }
  .login-mascota {
    width: 380px;
    right: 0;
    bottom: 0;
    animation: float 5s ease-in-out infinite;
  }
}

/* ── Desktop grande ── */
@media (min-width: 1200px) {
  .login-card { max-width: 1200px; min-height: 700px; }
  .login-col-form { padding: 64px 56px; }
  .login-col-brand { padding: 64px 56px 0; }
  .login-logo { height: 64px; max-width: 320px; }
  .login-col-form h1 { font-size: 30px; }
  .login-brand-logo { height: 90px; }
  .login-brand-tagline { font-size: 15px; letter-spacing: 4px; }
  .login-feature { font-size: 16px; }
  .login-mascota { width: 440px; right: 10px; }
}

@media (min-width: 1500px) {
  .login-card { max-width: 1360px; min-height: 760px; }
  .login-col-form { padding: 72px 64px; }
  .login-col-brand { padding: 72px 64px 0; }
  .login-logo { height: 70px; max-width: 360px; margin-bottom: 44px; }
  .login-col-form h1 { font-size: 34px; }
  .login-subtitle { font-size: 16px; }
  .login-brand-logo { height: 110px; }
  .login-brand-tagline { font-size: 16px; margin-bottom: 48px; }
  .login-feature { font-size: 17px; gap: 16px; }
  .login-feature svg { width: 24px; height: 24px; }
  .login-mascota { width: 520px; right: 20px; }
}

/* ═══════════════════════════════════════════════════════
   CONSENT SCREEN
   ═══════════════════════════════════════════════════════ */
.consent-container {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 50%, #f0f2f5 100%);
}
.consent-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  max-width: 640px;
  width: 100%;
  overflow: hidden;
}
.consent-header {
  text-align: center;
  padding: 28px 24px 20px;
  background: linear-gradient(135deg, #0a1628 0%, #122a4f 40%, #1A7AF8 100%);
  color: #fff;
}
.consent-logo {
  width: auto;
  height: 40px;
  max-width: 180px;
  margin-bottom: 12px;
  border-radius: 0;
  object-fit: contain;
}
.consent-header h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}
.consent-subtitle {
  font-size: 13px;
  opacity: 0.8;
}
.consent-body {
  padding: 24px;
  max-height: 50vh;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.7;
  color: #374151;
}
.consent-body h4 {
  font-size: 14px;
  color: #111827;
  margin: 18px 0 8px;
  font-weight: 700;
}
.consent-body h4:first-child { margin-top: 12px; }
.consent-body p { margin-bottom: 10px; }
.consent-body ul {
  margin: 8px 0 14px 20px;
  padding: 0;
}
.consent-body li {
  margin-bottom: 6px;
  padding-left: 4px;
}
.consent-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid #f3f4f6;
}
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  line-height: 1.4;
}
.consent-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #1A7AF8;
  cursor: pointer;
}
#btn-accept-consent:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* ═══════════════════════════════════════════════════════
   PQR & DENUNCIAS
   ═══════════════════════════════════════════════════════ */
.qi-red { background: #fef2f2; color: #dc2626; }
.qi-red svg { stroke: #dc2626; }

.pqr-form-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid #f3f4f6;
}
.pqr-form-card label {
  display: block;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 6px;
  font-weight: 500;
  margin-top: 14px;
}
.pqr-form-card label:first-of-type { margin-top: 0; }
.pqr-form-card select,
.pqr-form-card input[type="text"],
.pqr-form-card textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  background: #f9fafb;
  transition: all 0.2s;
}
.pqr-form-card select:focus,
.pqr-form-card input:focus,
.pqr-form-card textarea:focus {
  border-color: #1A7AF8;
  outline: none;
  background: #fff;
}
.pqr-form-card textarea { min-height: 100px; resize: vertical; }
.pqr-form-card .btn-primary { margin-top: 18px; }

.form-intro {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #f0f7ff;
  border-radius: 10px;
  border-left: 3px solid #1A7AF8;
}

/* File upload */
.file-upload-wrap {
  margin-top: 2px;
}
.file-upload-wrap input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1.5px dashed #d1d5db;
  border-radius: 10px;
  font-size: 13px;
  color: #6b7280;
  background: #f9fafb;
  cursor: pointer;
}
.file-upload-wrap input[type="file"]:hover {
  border-color: #1A7AF8;
  background: #f0f7ff;
}
.file-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f0fdf4;
  border-radius: 8px;
  margin-top: 8px;
  font-size: 13px;
}
.file-preview .file-name {
  color: #166534;
  font-weight: 500;
  word-break: break-all;
}
.file-preview .file-size {
  color: #6b7280;
  flex-shrink: 0;
}

/* Denuncia mode toggle */
.denuncia-mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.denuncia-mode-toggle .dmode {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  background: #fff;
  transition: all 0.2s;
}
.denuncia-mode-toggle .dmode:hover {
  border-color: #9ca3af;
}
.denuncia-mode-toggle .dmode.active {
  border-color: #1A7AF8;
  color: #1A7AF8;
  background: #f0f7ff;
  font-weight: 600;
}

/* Anonymity banner */
.denuncia-anon-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border-radius: 14px;
  border: 1px solid #bbf7d0;
  margin-bottom: 14px;
}
.denuncia-anon-banner strong {
  display: block;
  font-size: 14px;
  color: #166534;
  margin-bottom: 4px;
}
.denuncia-anon-banner p {
  font-size: 13px;
  color: #15803d;
  line-height: 1.4;
  margin: 0;
}
.denuncia-anon-banner svg { flex-shrink: 0; margin-top: 2px; }

/* Formal banner */
.denuncia-formal-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-radius: 14px;
  border: 1px solid #93c5fd;
  margin-bottom: 14px;
}
.denuncia-formal-banner strong {
  display: block;
  font-size: 14px;
  color: #1e40af;
  margin-bottom: 4px;
}
.denuncia-formal-banner p {
  font-size: 13px;
  color: #1e40af;
  line-height: 1.4;
  margin: 0;
}
.denuncia-formal-banner svg { flex-shrink: 0; margin-top: 2px; }

/* Success card */
.denuncia-success-card {
  text-align: center;
  background: #fff;
  border-radius: 20px;
  padding: 40px 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  border: 1px solid #f3f4f6;
  max-width: 420px;
  margin: 20px auto;
}
.denuncia-success-card .success-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0fdf4;
  border-radius: 50%;
  margin: 0 auto 20px;
}
.denuncia-success-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 10px;
}
.denuncia-success-card p {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 24px;
  line-height: 1.5;
}
