﻿* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img,
svg,
canvas,
video {
  max-width: 100%;
}

/* Pantalla de Inicio */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow: hidden;
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.splash-screen.hide {
  opacity: 0;
  transform: scale(1.1);
  pointer-events: none;
}

/* Canvas de partículas */
.particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.splash-background-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(14, 165, 233, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
  animation: backgroundPulse 8s ease-in-out infinite;
}

@keyframes backgroundPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

.splash-corner-left,
.splash-corner-right {
  position: absolute;
  top: 25px;
  height: 50px;
  width: auto;
  object-fit: contain;
  opacity: 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.splash-corner-left {
  left: 80px;
  animation: slideInLeft 0.8s ease-out 0.3s forwards;
}

.splash-corner-right {
  right: 80px;
  width: 116px !important;
  height: 56px;
  max-width: none;
  object-fit: contain;
  image-rendering: auto;
  filter: none;
  animation: slideInRight 0.8s ease-out 0.3s forwards;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

.splash-content {
  position: relative;
  z-index: 1;
  text-align: center;
  width: min(1320px, 96vw);
  max-width: 1320px;
  padding: 24px 18px 20px;
}

.splash-logo-container {
  margin-bottom: 30px;
  animation: logoEntrance 1s ease-out 0.2s both;
  perspective: 1000px;
}

@keyframes logoEntrance {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(30px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.splash-logo {
  max-width: 450px;
  max-height: 350px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 25px 70px rgba(14, 165, 233, 0.6));
  animation: logoFloat 4s ease-in-out infinite, logoGlow 3s ease-in-out infinite alternate;
  transition: transform 0.4s ease;
  will-change: transform;
}

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes logoGlow {
  0% {
    filter: drop-shadow(0 25px 70px rgba(14, 165, 233, 0.5)) 
            drop-shadow(0 0 30px rgba(14, 165, 233, 0.3));
  }
  100% {
    filter: drop-shadow(0 30px 80px rgba(59, 130, 246, 0.7)) 
            drop-shadow(0 0 40px rgba(99, 102, 241, 0.5));
  }
}

.splash-logo:hover {
  transform: scale(1.05);
}

.splash-title {
  color: #ffffff;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  margin: 20px 0 10px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

.splash-subtitle {
  color: #cbd5e1;
  font-size: clamp(15px, 1.6vw, 19px);
  margin-bottom: 26px;
  line-height: 1.6;
  animation: fadeInUp 0.8s ease-out 0.8s both;
}

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

.splash-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  justify-content: center;
  animation: fadeInUp 0.8s ease-out 1s both;
  margin: 10px auto 0;
  width: min(1240px, 100%);
}

.splash-button {
  --btn-from: rgba(14, 116, 144, 0.9);
  --btn-to: rgba(15, 23, 42, 0.92);
  --btn-glow: rgba(30, 64, 175, 0.2);
  color: white;
  border: none;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 118px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.24);
  background: linear-gradient(155deg, var(--btn-from) 0%, var(--btn-to) 100%);
  box-shadow: 0 6px 14px var(--btn-glow), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  animation: splashButtonEntrance 0.4s ease-out both;
}

.splash-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 18%, rgba(255, 255, 255, 0.16) 50%, transparent 82%);
  transition: left 0.45s ease;
}

.splash-button:hover::before {
  left: 100%;
}

.splash-button i {
  font-size: 24px;
  text-shadow: 0 2px 6px rgba(15, 23, 42, 0.28);
  transition: transform 0.2s ease;
}

.splash-button span {
  display: block;
  font-size: 13.5px;
  line-height: 1.24;
  text-align: center;
  letter-spacing: 0.012em;
  white-space: normal;
  max-width: 14ch;
  text-wrap: balance;
}

.splash-button:hover {
  transform: translateY(-2px);
  border-color: rgba(226, 232, 240, 0.42);
  box-shadow: 0 10px 20px var(--btn-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.splash-button:hover i {
  transform: translateY(-1px) scale(1.02);
}

.splash-button:active {
  transform: translateY(-1px);
}

.splash-buttons .splash-button:nth-child(1) { animation-delay: 1.02s; }
.splash-buttons .splash-button:nth-child(2) { animation-delay: 1.08s; }
.splash-buttons .splash-button:nth-child(3) { animation-delay: 1.14s; }
.splash-buttons .splash-button:nth-child(4) { animation-delay: 1.20s; }
.splash-buttons .splash-button:nth-child(5) { animation-delay: 1.26s; }
.splash-buttons .splash-button:nth-child(6) { animation-delay: 1.32s; }
.splash-buttons .splash-button:nth-child(7) { animation-delay: 1.38s; }

@keyframes splashButtonEntrance {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.splash-button-primary {
  --btn-from: rgba(2, 132, 199, 0.9);
  --btn-to: rgba(12, 74, 110, 0.94);
  --btn-glow: rgba(2, 132, 199, 0.24);
}

.splash-button-secondary {
  --btn-from: rgba(30, 64, 175, 0.88);
  --btn-to: rgba(23, 37, 84, 0.94);
  --btn-glow: rgba(30, 64, 175, 0.22);
}

.splash-button-tertiary {
  --btn-from: rgba(14, 165, 233, 0.86);
  --btn-to: rgba(3, 105, 161, 0.94);
  --btn-glow: rgba(14, 165, 233, 0.22);
}

.splash-button-backup {
  --btn-from: rgba(13, 148, 136, 0.88);
  --btn-to: rgba(17, 94, 89, 0.94);
  --btn-glow: rgba(13, 148, 136, 0.2);
}

.splash-button-logout {
  --btn-from: rgba(185, 28, 28, 0.88);
  --btn-to: rgba(127, 29, 29, 0.94);
  --btn-glow: rgba(185, 28, 28, 0.2);
}

.splash-button-admin {
  --btn-from: rgba(180, 83, 9, 0.9);
  --btn-to: rgba(120, 53, 15, 0.94);
  --btn-glow: rgba(180, 83, 9, 0.22);
}

.splash-button-actividad {
  --btn-from: rgba(51, 65, 85, 0.9);
  --btn-to: rgba(15, 23, 42, 0.94);
  --btn-glow: rgba(51, 65, 85, 0.22);
}

@media (max-width: 1220px) {
  .splash-buttons {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }
}

@media (max-width: 920px) {
  .splash-content {
    width: min(980px, 96vw);
  }

  .splash-logo {
    max-width: 340px;
    max-height: 250px;
  }

  .splash-buttons {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    gap: 12px;
  }

  .splash-button {
    min-height: 108px;
    padding: 12px 12px;
  }
}

@media (max-width: 640px) {
  .splash-content {
    width: 96vw;
    padding: 14px 10px 14px;
  }

  .splash-title {
    margin-top: 12px;
  }

  .splash-subtitle {
    margin-bottom: 16px;
    line-height: 1.4;
  }

  .splash-buttons {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 10px;
  }

  .splash-button {
    min-height: 96px;
    border-radius: 10px;
  }

  .splash-button i {
    font-size: 20px;
  }

  .splash-button span {
    font-size: 12.5px;
    max-width: 100%;
  }
}

/* Footer del Splash Screen */
.splash-footer {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  animation: fadeInUp 0.8s ease-out 1.2s both;
}

.footer-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  margin: 0 0 10px 0;
  font-weight: 400;
}

.footer-version {
  display: inline-block;
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin: 10px 0 0 0;
  border: 1px solid rgba(34, 197, 94, 0.3);
  text-align: center;
}

.footer-developer {
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  margin: 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.footer-developer i {
  color: #22c55e;
  font-size: 16px;
  animation: codeIconPulse 2s ease-in-out infinite;
}

@keyframes codeIconPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

/* Footer de Secciones (Formulario, Tabla, Gráficos, Backup) */
.section-footer {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  text-align: center;
}

.section-footer .footer-text {
  color: rgba(0, 0, 0, 0.6);
}

.section-footer .footer-developer {
  color: rgba(0, 0, 0, 0.8);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
  min-height: 100vh;
  padding: clamp(8px, 1.6vw, 20px);
  animation: gradientShift 20s ease infinite;
  background-size: 400% 400%;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 1px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out 0.3s, transform 0.5s ease-out 0.3s;
  width: min(100%, 1600px);
}

.container.show {
  opacity: 1;
  transform: translateY(0);
}

header {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  padding: 35px 40px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.15) 50%, transparent 70%);
  animation: shimmer 4s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  flex: 1;
  text-align: center;
}

header h1 i {
  margin-right: 12px;
  font-size: 2rem;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 2;
}

/* Botón de volver al menú */
.btn-back-menu {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.4);
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-back-menu:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-back-menu:active {
  transform: translateY(0);
}

.btn-back-menu i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.btn-back-menu:hover i {
  transform: scale(1.15);
}

.btn-logout {
  background: rgba(220, 38, 38, 0.2);
  color: white;
  border: 2px solid rgba(254, 202, 202, 0.45);
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.95rem;
  font-weight: 700;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-logout:hover {
  background: rgba(220, 38, 38, 0.32);
  border-color: rgba(254, 202, 202, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-logout:active {
  transform: translateY(0);
}

.btn-logout i {
  font-size: 1.1rem;
}


main {
  padding: clamp(16px, 2vw, 30px);
}

/* Formulario */
.form-section {
  margin-bottom: 30px;
  padding: clamp(18px, 2.4vw, 40px);
  background: transparent;
  border-radius: 12px;
  border: none;
  transition: all 0.3s ease;
}

.form-section h2 {
  color: #1e293b;
  margin-bottom: 35px;
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 20px;
  border-bottom: 3px solid #0ea5e9;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-section h2 i {
  color: #0ea5e9;
  font-size: 1.7rem;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

/* Tarjetas de Formulario */
.form-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 25px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  animation: slideInUp 0.5s ease-out;
}

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

.form-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.form-card-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 20px 25px;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 15px;
}

.form-card-header i {
  font-size: 1.5rem;
  color: #0ea5e9;
  background: white;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.form-card-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.3px;
}

.form-card-body {
  padding: clamp(18px, 2vw, 30px) clamp(16px, 1.8vw, 25px);
  background: white;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 10px;
  color: #334155;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.form-group label i {
  color: #0ea5e9;
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.form-group:hover label i {
  transform: scale(1.1);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 14px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f8fafc;
  font-family: inherit;
  color: #1e293b;
  position: relative;
  width: 100%;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230ea5e9' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 50px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #94a3b8;
  font-style: italic;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12), 0 4px 12px rgba(14, 165, 233, 0.1);
  background: #ffffff;
  transform: translateY(-1px);
}

.form-group input[readonly] {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  cursor: not-allowed;
  color: #64748b;
  font-weight: 600;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* Formulario de gestión de efectos en mayúsculas (excepto campos narrativos) */
#efectoForm input,
#efectoForm select,
#efectoForm textarea {
  text-transform: uppercase;
}

#efectoForm select option {
  text-transform: uppercase;
}

#efectoForm #descripcionMuestra,
#efectoForm #observaciones,
#efectoForm #descripcionMuestra::placeholder,
#efectoForm #observaciones::placeholder {
  text-transform: none;
}

.file-input-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.btn-file {
  padding: 16px 32px;
  background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-file::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.btn-file:hover::before {
  left: 100%;
}

.btn-file:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.btn-file:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.btn-file i {
  font-size: 1.3rem;
}

.selected-files {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px;
  min-height: 80px;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border-radius: 12px;
  border: 2px dashed #cbd5e1;
  transition: all 0.3s ease;
  align-items: flex-start;
  justify-content: flex-start;
}

.selected-files:empty::before {
  content: 'No hay archivos seleccionados';
  color: #94a3b8;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
}

.selected-files:hover {
  border-color: #0ea5e9;
  background: #ffffff;
}

.file-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  color: white;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
  transition: all 0.3s ease;
  animation: slideInFile 0.4s ease-out;
}

@keyframes slideInFile {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.file-tag:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
}

.file-tag i {
  font-size: 1.1rem;
}

.file-tag button {
  background: rgba(255, 255, 255, 0.25);
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.file-tag button:hover {
  background: #ef4444;
  border-color: #ef4444;
  transform: scale(1.15) rotate(90deg);
}

/* Botones del formulario */
.form-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}

.btn {
  padding: 16px 40px;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 400px;
  height: 400px;
}

.btn i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.btn:hover i {
  transform: scale(1.15);
}

.btn-primary {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  box-shadow: 0 6px 25px rgba(34, 197, 94, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  transform: translateY(-3px);
  box-shadow: 0 10px 35px rgba(34, 197, 94, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  color: white;
  box-shadow: 0 6px 25px rgba(14, 165, 233, 0.3);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  transform: translateY(-3px);
  box-shadow: 0 10px 35px rgba(14, 165, 233, 0.4);
}

.btn-reset {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  box-shadow: 0 6px 25px rgba(249, 115, 22, 0.3);
}

.btn-reset:hover {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  transform: translateY(-3px);
  box-shadow: 0 10px 35px rgba(249, 115, 22, 0.4);
}

.btn:active {
  transform: translateY(-1px);
}

.btn-reset {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  color: white;
}

.btn-reset:hover {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(71, 85, 105, 0.3);
}

.btn-cancel {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.btn-cancel:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

/* Estilos para dispositivos electrónicos */
.dispositivo-item {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.dispositivo-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.dispositivo-content {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.dispositivo-field {
  flex: 1;
}

.dispositivo-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.dispositivo-field label i {
  margin-right: 6px;
  color: #3b82f6;
}

.dispositivo-select,
.dispositivo-cantidad-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: white;
}

.dispositivo-select:focus,
.dispositivo-cantidad-input:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dispositivo-cantidad {
  max-width: 120px;
}

.btn-eliminar-dispositivo {
  padding: 10px 16px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
}

.btn-eliminar-dispositivo:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-agregar-dispositivo {
  padding: 12px 24px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.btn-agregar-dispositivo:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.btn-agregar-dispositivo i {
  font-size: 16px;
}

/* Tabla */
.table-section {
  padding: clamp(18px, 2.4vw, 40px);
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.table-section h2 {
  color: #1e293b;
  margin-bottom: 30px;
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 15px;
  border-bottom: 3px solid #0ea5e9;
}

.table-section h2 i {
  color: #0ea5e9;
  font-size: 1.5rem;
}

/* Botones de Exportación */
.export-buttons-container {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 0 5px;
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.btn-export i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.btn-export:hover i {
  transform: scale(1.15) translateY(-2px);
}

.btn-export::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}

.btn-export:hover::before {
  width: 300px;
  height: 300px;
}

.btn-export:active {
  transform: scale(0.98);
}

.btn-export-pdf {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.btn-export-pdf:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

.btn-export-excel {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.btn-export-excel:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
}

.btn-export-multi-delete {
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
  color: white;
}

.btn-export-multi-delete:hover {
  background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
  box-shadow: 0 6px 20px rgba(127, 29, 29, 0.35);
  transform: translateY(-2px);
}

.btn-export-multi-delete:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

@media (max-width: 768px) {
  .export-buttons-container {
    flex-direction: column;
  }
  
  .btn-export {
    width: 100%;
    justify-content: center;
  }
}

/* Paginación */
.paginacion-wrapper {
  margin-top: 25px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  transition: all 0.3s ease;
  max-width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.paginacion-wrapper:hover {
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.2);
}

.paginacion-info-simple {
  text-align: center;
  margin-top: 25px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.1);
  color: #334155;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  max-width: fit-content;
  margin-left: auto;
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.paginacion-info-simple::before {
  content: '📄';
  font-size: 1rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

.paginacion-info-simple:hover {
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.2);
}

.paginacion-info {
  color: #475569;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

.paginacion-info::before {
  content: '📄';
  font-size: 1rem;
}

.paginacion-controles {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-paginacion {
  padding: 8px 14px;
  border: 1px solid rgba(226, 232, 240, 0.6);
  background: rgba(255, 255, 255, 0.9);
  color: #475569;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  letter-spacing: 0.2px;
  min-width: 38px;
  justify-content: center;
}

.btn-paginacion:hover:not(:disabled):not(.active) {
  background: rgba(240, 249, 255, 0.95);
  border-color: rgba(14, 165, 233, 0.4);
  color: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(14, 165, 233, 0.15);
}

.btn-paginacion.active {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(14, 165, 233, 0.35);
  transform: scale(1.02);
}

.btn-paginacion:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-paginacion:disabled:hover {
  transform: none;
  border-color: rgba(226, 232, 240, 0.6);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.paginacion-ellipsis {
  padding: 8px 6px;
  color: #94a3b8;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 1px;
}

@media (max-width: 768px) {
  .paginacion-wrapper {
    flex-direction: column;
    gap: 15px;
  }
  
  .paginacion-controles {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .btn-paginacion {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
}


/* Panel de Filtros */
.filter-panel {
  background: white;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  animation: slideInUp 0.4s ease-out;
}

.filter-global {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid #cbd5e1;
}

.filter-global-item {
  width: 100%;
  max-width: 100%;
}

.filter-global-item input {
  font-size: 1.05rem;
  padding: 16px 20px;
  border: 2px solid #0ea5e9;
  background: white;
  font-weight: 500;
}

.filter-global-item input::placeholder {
  color: #94a3b8;
  font-weight: normal;
}

.filter-global-item input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15), 0 6px 16px rgba(14, 165, 233, 0.2);
}

.filter-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e0f2fe;
  flex-wrap: wrap;
}

.filter-header i {
  color: #0ea5e9;
  font-size: 1.3rem;
}

.filter-header span {
  color: #1e293b;
  font-size: 1.1rem;
  font-weight: 700;
  flex: 1;
}

.filter-header-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-clear-filters {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(100, 116, 139, 0.3);
}

.btn-clear-filters:hover {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(100, 116, 139, 0.4);
}

.btn-clear-filters i {
  font-size: 1rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 20px;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-item label {
  color: #475569;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-item label i {
  color: #0ea5e9;
  font-size: 1rem;
}

.filter-item input {
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: #f8fafc;
}

.filter-item input:focus {
  outline: none;
  border-color: #0ea5e9;
  background: white;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.filter-item input::placeholder {
  color: #94a3b8;
}

.table-container {
  overflow-x: auto;
  overflow-y: visible;
  background: white;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  max-width: 100%;
  max-height: none;
  position: relative;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 0;
}

#efectosTable {
  width: 100%;
  min-width: 0;
}

thead {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
}

thead th {
  padding: 18px 20px;
  text-align: left;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  border-right: none;
  position: relative;
  overflow-wrap: anywhere;
  word-break: break-word;
}

thead th::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 1px;
  height: 62%;
  background: #ffffff;
  opacity: 0.95;
}

thead th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

thead th.sortable:hover {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

thead th.sortable i {
  margin-left: 6px;
  opacity: 0.7;
  font-size: 0.75rem;
  transition: opacity 0.2s ease;
}

thead th.sortable:hover i {
  opacity: 1;
}

thead th:last-child {
  border-right: none;
}

thead th:last-child::after {
  display: none;
}

#efectosTable thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #0284c7;
  background-image: none;
}

#efectosTable thead th:last-child {
  position: sticky;
  right: 0;
  z-index: 24;
  background: #0284c7;
  background-image: none;
}

.bulk-select-column {
  display: none;
  width: 52px;
  min-width: 52px;
  text-align: center;
}

body.admin-mode .bulk-select-column {
  display: table-cell;
}

.bulk-select-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #1e3a5f;
}

.tiempo-deposito-cell {
  color: #1e3a5f;
  background: linear-gradient(135deg, #f8f1df 0%, #efe3bd 100%);
  border: 1px solid #d6c38a;
  border-radius: 10px;
  display: inline-block;
  padding: 6px 10px;
  font-weight: 800;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.2;
}

.dias-dep-cell {
  text-align: center;
  font-size: 0.85rem;
}

tbody tr {
  border-bottom: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

tbody tr:hover {
  background: #f1f5f9;
  box-shadow: inset 0 0 0 2px #e0f2fe;
}

tbody tr:nth-child(even) {
  background: #f8fafc;
}

tbody tr:nth-child(even):hover {
  background: #f1f5f9;
}

tbody td {
  padding: 18px 20px;
  font-size: 0.9rem;
  vertical-align: middle;
  color: #475569;
  border-right: 1px solid #f1f5f9;
  text-transform: uppercase;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

tbody td:last-child {
  border-right: none;
}

tbody td.efecto-cell {
  max-width: none;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.archivo-link {
  display: inline-block;
  margin: 4px 4px 4px 0;
  padding: 6px 12px;
  background: #0ea5e9;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.archivo-link:hover {
  background: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.situacion-badge {
  display: inline-block;
  padding: 6px 12px;
  background: #22c55e;
  color: white;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Mensajes de notificación */
.notification {
  position: fixed;
  top: 30px;
  right: 30px;
  padding: 20px 32px;
  border-radius: 14px;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.25);
  animation: slideInNotification 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 10001;
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 320px;
  max-width: 500px;
}

.notification.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 12px 50px rgba(16, 185, 129, 0.4);
}

.notification.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 12px 50px rgba(239, 68, 68, 0.4);
}

.notification.info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 12px 50px rgba(59, 130, 246, 0.4);
}

.notification i {
  font-size: 1.5rem;
  animation: iconPulse 0.6s ease-in-out;
}

@keyframes slideInNotification {
  from {
    transform: translateX(500px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* Estado vacío */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-state p {
  font-size: 1.2rem;
  margin-top: 15px;
  font-weight: 600;
}

/* Botón de carpeta */
.folder-icon-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.folder-icon-btn:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.folder-icon-btn .file-count {
  background: rgba(255, 255, 255, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  border-radius: 16px;
  width: 95%;
  max-width: 1400px;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.3s ease;
  border: 1px solid #e5e7eb;
}

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

.modal-header {
  background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  color: white;
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.modal-body {
  padding: 25px;
  max-height: calc(80vh - 80px);
  overflow-y: auto;
}

.archivos-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 4px;
}

.archivo-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.archivo-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.archivo-card:hover {
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

.archivo-card:hover::before {
  transform: scaleX(1);
}

.archivo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 12px;
  margin: 0 auto;
}

.archivo-icon i {
  font-size: 32px;
}

.archivo-info {
  text-align: center;
  flex: 1;
}

.archivo-nombre {
  font-size: 14px;
  font-weight: 500;
  color: #e2e8f0;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
}

.archivo-extension {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.archivo-acciones {
  display: flex;
  gap: 8px;
}

.btn-archivo {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-ver {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
}

.btn-ver:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-abrir {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.btn-abrir:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.archivos-vacio {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
}

.archivos-vacio i {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.archivos-vacio p {
  font-size: 16px;
  margin: 0;
}

.archivos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 4px;
}

.archivo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.archivo-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateX(5px);
}

.archivo-item i {
  font-size: 24px;
  color: #0ea5e9;
}

.archivo-name {
  flex: 1;
  font-weight: 500;
  color: #334155;
  word-break: break-word;
}

.btn-abrir-archivo {
  background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-abrir-archivo:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* Modal Grande para Detalles */
.modal-large {
  max-width: 900px;
}

/* Grid de Detalles */
.detalles-grid {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.detalle-section {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border-radius: 12px;
  padding: 20px 25px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.detalle-section h4 {
  color: #0ea5e9;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e0f2fe;
}

.detalle-section h4 i {
  font-size: 1.2rem;
}

.detalle-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 15px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  align-items: start;
}

.detalle-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detalle-item.full-width {
  grid-template-columns: 1fr;
}

.detalle-label {
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.detalle-label i {
  color: #0ea5e9;
  font-size: 1rem;
}

.detalle-value {
  color: #1e293b;
  font-weight: 500;
  line-height: 1.6;
  word-break: break-word;
}

.detalle-item.full-width .detalle-value {
  margin-top: 8px;
  padding: 12px;
  background: white;
  border-radius: 8px;
  border-left: 3px solid #0ea5e9;
}

/* Responsive */
@media (max-width: 1024px) {
  .form-card-body {
    padding: 25px 20px;
  }
  
  .form-section {
    padding: 30px 20px;
  }
  
  .modal-large {
    max-width: 95%;
  }
  
  .detalle-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .container {
    border-radius: 12px;
  }
  
  header {
    padding: 25px 20px;
    flex-direction: column;
    gap: 12px;
  }
  
  header h1 {
    font-size: 1.6rem;
    line-height: 1.3;
  }
  
  header h1 i {
    font-size: 1.5rem;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
    margin-top: 12px;
    flex-wrap: wrap;
  }

  .btn-back-menu,
  .btn-logout {
    width: 100%;
    justify-content: center;
  }
  
  main {
    padding: 20px;
  }
  
  .form-section {
    padding: 20px 15px;
  }
  
  .form-section h2 {
    font-size: 1.4rem;
    gap: 10px;
  }
  
  .form-section h2 i {
    font-size: 1.3rem;
    padding: 10px;
  }
  
  .form-card {
    margin-bottom: 20px;
  }
  
  .form-card-header {
    padding: 15px 18px;
  }
  
  .form-card-header h3 {
    font-size: 1.05rem;
  }
  
  .form-card-header i {
    font-size: 1.3rem;
    padding: 10px;
  }
  
  .form-card-body {
    padding: 20px 18px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  
  .form-group.full-width {
    grid-column: 1;
  }
  
  .form-actions {
    flex-direction: column;
    gap: 12px;
  }
  
  .btn {
    width: 100%;
    padding: 14px 24px;
    justify-content: center;
  }
  
  .btn-file {
    width: 100%;
    justify-content: center;
  }
  
  .notification {
    top: 20px;
    right: 20px;
    left: 20px;
    min-width: auto;
  }
  
  .modal-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .modal-large {
    width: 98%;
    max-width: none;
  }
  
  .detalle-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .detalle-label {
    font-size: 0.9rem;
  }
  
  .detalle-value {
    font-size: 0.95rem;
  }
  
  .detalle-section {
    padding: 18px 20px;
  }
  
  .detalle-section h4 {
    font-size: 1rem;
  }
  
  .archivo-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .btn-abrir-archivo {
    width: 100%;
    justify-content: center;
  }

  .table-section {
    padding: 18px 10px;
  }

  .table-container {
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
  }

  #efectosTable {
    min-width: 0;
  }
}

/* Columna de acciones */
.actions-column {
  text-align: center !important;
  vertical-align: middle !important;
  min-width: 148px !important;
  position: sticky;
  right: 0;
  z-index: 6;
  background: #ffffff;
  box-shadow: -6px 0 8px -8px rgba(15, 23, 42, 0.45);
}

#efectosTable tbody tr:nth-child(even) .actions-column {
  background: #f8fafc;
}

#efectosTable tbody tr:hover .actions-column {
  background: #f1f5f9;
}

/* Botones de acción en tabla */
.action-buttons {
  display: inline-flex !important;
  flex-direction: row !important;
  gap: 6px;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap !important;
  white-space: nowrap;
  margin: 0 auto;
}

.btn-expand,
.btn-details,
.btn-pdf {
  display: inline-block !important;
  vertical-align: middle;
  flex-shrink: 0;
}

.btn-pdf {
  color: white;
  border: none;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  min-width: 40px;
}

.btn-pdf-download {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-pdf-download:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-pdf-view {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.btn-pdf-view:hover {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

.btn-expand {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  border: none;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
  min-width: 40px;
}

.btn-expand:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-details {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  border: none;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
  min-width: 40px;
}

.btn-details:hover {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.btn-edit {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  min-width: 36px;
}

.btn-edit:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-delete {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  min-width: 36px;
}

.btn-delete:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Fila de detalles expandida */
.details-row {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.details-row td {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
  padding: 0 !important;
  border-top: 2px solid #0ea5e9;
  border-bottom: 2px solid #0ea5e9;
}

.details-inline {
  padding: 20px 30px;
}

.details-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.details-column-full {
  grid-column: 1 / -1;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  padding: 12px;
  background: white;
  border-radius: 8px;
  border-left: 3px solid #0ea5e9;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-label i {
  color: #0ea5e9;
  font-size: 0.85rem;
}

.detail-value {
  font-size: 0.95rem;
  color: #1e293b;
  font-weight: 500;
  line-height: 1.5;
}

/* Botones de acción en vista expandida */
.details-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 2px solid rgba(14, 165, 233, 0.2);
}

.btn-action {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-action-edit {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.btn-action-edit:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-action-delete {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.btn-action-delete:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-action-pdf {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  color: white;
}

.btn-action-pdf:hover {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-action-pdf-download {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
}

.btn-action-pdf-download:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Botones de acción en modal */
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 20px 30px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* Modal de Confirmación */
.modal-confirm {
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.7);
}

.modal-confirm .modal-confirm-content {
  max-width: 500px;
  padding: 0;
  animation: scaleIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  border: none;
  overflow: hidden;
}

@keyframes scaleIn {
  0% {
    transform: scale(0.5) translateY(50px);
    opacity: 0;
  }
  70% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.confirm-icon {
  text-align: center;
  font-size: 5rem;
  margin-bottom: 25px;
  animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
}

.confirm-icon i {
  color: #f59e0b;
  filter: drop-shadow(0 10px 20px rgba(245, 158, 11, 0.4));
  animation: pulse 2s ease-in-out infinite;
}

@keyframes bounceIn {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

#confirmModalBody {
  padding: 45px 35px 35px 35px;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

#confirmModalBody h3 {
  color: #1e293b;
  font-size: 1.6rem;
  margin-bottom: 25px;
  font-weight: 800;
  line-height: 1.3;
  animation: fadeInDown 0.5s ease 0.2s both;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.confirm-info {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-left: 4px solid #0ea5e9;
  padding: 20px 25px;
  margin: 25px 0;
  text-align: left;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.15);
  animation: fadeIn 0.5s ease 0.3s both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.confirm-info p {
  margin: 10px 0;
  color: #475569;
  font-size: 1rem;
  line-height: 1.6;
}

.confirm-info strong {
  color: #0f172a;
  font-weight: 700;
  display: inline-block;
  min-width: 80px;
}

.confirm-warning {
  color: #dc2626;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 20px 0 30px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: fadeIn 0.5s ease 0.4s both;
}

.confirm-warning::before {
  content: "⚠";
  font-size: 1.2rem;
  animation: shake 0.5s ease infinite;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.confirm-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
  animation: fadeInUp 0.5s ease 0.5s both;
}

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

.btn-confirm-cancel,
.btn-confirm-delete {
  padding: 14px 35px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.btn-confirm-cancel::before,
.btn-confirm-delete::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-confirm-cancel:hover::before,
.btn-confirm-delete:hover::before {
  width: 300px;
  height: 300px;
}

.btn-confirm-cancel {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  color: white;
}

.btn-confirm-cancel:hover {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(100, 116, 139, 0.4);
}

.btn-confirm-cancel:active {
  transform: translateY(-1px);
}

.btn-confirm-delete {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  animation: dangerPulse 2s ease-in-out infinite;
}

@keyframes dangerPulse {
  0%, 100% {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.15);
  }
  50% {
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.4);
  }
}

.btn-confirm-delete:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 35px rgba(239, 68, 68, 0.5);
  animation: none;
}

.btn-confirm-delete:active {
  transform: translateY(-1px) scale(1.02);
}

.btn-confirm-cancel i,
.btn-confirm-delete i {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.btn-confirm-cancel:hover i {
  transform: rotate(-15deg);
}

.btn-confirm-delete:hover i {
  transform: rotate(15deg) scale(1.2);
}

.logout-confirm-info {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-left: 4px solid #2563eb;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.16);
}

.logout-confirm-button {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.logout-confirm-button:hover {
  background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
  box-shadow: 0 12px 35px rgba(37, 99, 235, 0.35);
}

/* Variante verde para acciones de desbloqueo (sin animación de peligro) */
.btn-confirm-unlock {
  background: rgba(34, 197, 94, 0.18) !important;
  color: #4ade80 !important;
  border: 1px solid rgba(34, 197, 94, 0.35) !important;
  animation: none !important;
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.12) !important;
}
.btn-confirm-unlock:hover {
  background: rgba(34, 197, 94, 0.30) !important;
  color: #86efac !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(34, 197, 94, 0.25) !important;
  animation: none !important;
}

.logout-confirm-button.btn-confirm-delete {
  animation: none;
}

.admin-user-protected {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 700;
}

#lugarFisico.campo-bloqueado-confirmable {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border: 1.5px dashed #2563eb;
  color: #334155;
  cursor: not-allowed;
  box-shadow: inset 0 1px 3px rgba(148, 163, 184, 0.2);
}

#lugarFisico.campo-bloqueado-confirmable:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* Estilos para Historial de Ubicaciones */
.historial-ubicacion-container,
.historial-modal-container {
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px;
  border: 2px solid #e2e8f0;
}

.historial-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #cbd5e1;
}

.historial-header-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.historial-header i {
  color: #0ea5e9;
  font-size: 1.3rem;
}

.btn-toggle-historial {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.btn-toggle-historial:hover {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

.btn-toggle-historial:active {
  transform: translateY(0);
}

.btn-toggle-historial i {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.historial-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.historial-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: white;
  border-radius: 10px;
  border-left: 4px solid #0ea5e9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.historial-item:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-left-color: #0284c7;
}

.historial-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  width: fit-content;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.3);
}

.historial-date-badge i {
  font-size: 0.9rem;
}

.historial-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.historial-change {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 200px;
}

.historial-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
}

.historial-old {
  padding: 8px 12px;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: #991b1b;
  font-weight: 500;
  font-size: 0.9rem;
}

.historial-new {
  padding: 8px 12px;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border: 1px solid #6ee7b7;
  border-radius: 8px;
  color: #065f46;
  font-weight: 500;
  font-size: 0.9rem;
}

.historial-arrow {
  color: #0ea5e9;
  font-size: 1.5rem;
  flex-shrink: 0;
  animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes arrowPulse {
  0%, 100% {
    transform: translateX(0);
    opacity: 1;
  }
  50% {
    transform: translateX(5px);
    opacity: 0.7;
  }
}

.historial-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f1f5f9;
  border-radius: 20px;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 500;
  width: fit-content;
}

.historial-user i {
  color: #64748b;
  font-size: 0.9rem;
}

.historial-empty {
  text-align: center;
  padding: 30px 20px;
  color: #64748b;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.historial-empty i {
  color: #94a3b8;
  font-size: 1.2rem;
}

.historial-loading {
  text-align: center;
  padding: 30px 20px;
  color: #64748b;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.historial-loading i {
  color: #0ea5e9;
  font-size: 1.2rem;
}

.historial-error {
  text-align: center;
  padding: 20px;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 8px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.historial-error i {
  font-size: 1.2rem;
}

/* Responsivo para historial */
@media (max-width: 768px) {
  .historial-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .historial-change {
    min-width: 100%;
  }
  
  .historial-arrow {
    transform: rotate(90deg);
    align-self: center;
  }
}

/* Notificaciones de exportación */
.notificacion {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 24px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  z-index: 10000;
  transform: translateX(400px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 4px solid;
}

.notificacion.show {
  transform: translateX(0);
}

.notificacion-success {
  border-left-color: #10b981;
  color: #047857;
}

.notificacion-success i {
  color: #10b981;
  font-size: 1.3rem;
}

.notificacion-error {
  border-left-color: #ef4444;
  color: #b91c1c;
}

.notificacion-error i {
  color: #ef4444;
  font-size: 1.3rem;
}

.notificacion-info {
  border-left-color: #0ea5e9;
  color: #0369a1;
}

.notificacion-info i {
  color: #0ea5e9;
  font-size: 1.3rem;
}

/* ===========================================
   SECCIÓN DE GRÁFICOS
   =========================================== */

.graficos-section {
  display: none;
  padding: 30px;
  animation: fadeIn 0.5s ease;
}

.graficos-section h2 {
  font-size: 1.8rem;
  color: #0f172a;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.graficos-section h2 i {
  color: #0ea5e9;
  font-size: 1.6rem;
}

.btn-export-graphs {
  padding: 8px 18px;
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.btn-export-graphs:hover {
  background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.btn-export-graphs:active {
  transform: translateY(0);
}

.btn-export-graphs i {
  font-size: 0.95rem;
}

/* Tarjetas de Estadísticas */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 25px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(135deg, currentColor 0%, currentColor 100%);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.stat-card-blue::before {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.stat-card-green::before {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-card-purple::before {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.stat-card-orange::before {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-card-red::before {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.stat-card-blue .stat-icon {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  color: #0284c7;
}

.stat-card-green .stat-icon {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #059669;
}

.stat-card-purple .stat-icon {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  color: #7c3aed;
}

.stat-card-orange .stat-icon {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #d97706;
}

.stat-card-red .stat-icon {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #dc2626;
}

.stat-info {
  flex: 1;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Grid de Gráficos */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.chart-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.chart-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-3px);
}

.chart-card-header {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  padding: 18px 25px;
  border-bottom: 1px solid #e2e8f0;
}

.chart-card-header h3 {
  font-size: 1rem;
  color: white;
  margin: 0;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chart-card-header h3 i {
  font-size: 1.1rem;
  opacity: 0.9;
}

.chart-card-body {
  padding: 25px;
  min-height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-card-body canvas {
  max-height: 320px;
}

/* Responsive para gráficos */
@media (max-width: 1400px) {
  .charts-grid {
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  }
}

@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-cards {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* Carta ancha para ranking */
.chart-card-wide {
  grid-column: span 2;
}

.chart-card-wide .chart-card-body {
  min-height: 250px;
}

.chart-card-wide .chart-card-body canvas {
  max-height: 250px;
  height: 250px !important;
}

/* Carta grande para gráfico de torta */
.chart-card-large {
  grid-column: span 2;
  grid-row: span 2;
}

.chart-card-large .chart-card-body {
  min-height: 500px;
}

/* Estilos del ranking de dispositivos */
.ranking-container {
  max-height: 600px;
  overflow-y: auto;
  padding: 5px;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ranking-item:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.3);
}

.ranking-position {
  font-size: 1.5rem;
  font-weight: bold;
  color: #0ea5e9;
  min-width: 45px;
  text-align: center;
}

.ranking-info {
  flex: 1;
  display: flex;
  align-items: center;
}

.ranking-dispositivo {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
}

.ranking-cantidad {
  font-size: 1.5rem;
  font-weight: bold;
  color: #0ea5e9;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(14, 165, 233, 0.05) 100%);
  padding: 8px 16px;
  border-radius: 8px;
  min-width: 60px;
  text-align: center;
}

.ranking-container::-webkit-scrollbar {
  width: 8px;
}

.ranking-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.ranking-container::-webkit-scrollbar-thumb {
  background: rgba(14, 165, 233, 0.3);
  border-radius: 4px;
}

.ranking-container::-webkit-scrollbar-thumb:hover {
  background: rgba(14, 165, 233, 0.5);
}

@media (max-width: 768px) {
  .graficos-section {
    padding: 15px;
  }
  
  .chart-card-wide {
    grid-column: span 1;
  }
  
  .stats-cards {
    grid-template-columns: 1fr;
  }
  
  .stat-card {
    padding: 20px;
  }
  
  .stat-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
  
  .stat-value {
    font-size: 1.8rem;
  }
  
  .chart-card-body {
    padding: 15px;
    min-height: 300px;
  }
}

/* Estilos para la sección de Backup */
.backup-section {
  margin: 30px 0;
  animation: fadeIn 0.5s ease-in-out;
}

.backup-header {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 25px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Estilos para las instrucciones animadas */
.backup-instructions {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 35px;
  margin-bottom: 25px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

.instructions-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
}

.instructions-header i {
  font-size: 2rem;
  color: #0ea5e9;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(14, 165, 233, 0.05) 100%);
  padding: 15px;
  border-radius: 12px;
}

.instructions-header h3 {
  color: #0f172a;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
}

.instructions-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.instruction-card {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border-radius: 16px;
  padding: 25px;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
  animation: slideInUp 0.6s ease-out;
}

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

.instruction-card:hover {
  border-color: #0ea5e9;
  box-shadow: 0 10px 30px rgba(14, 165, 233, 0.15);
  transform: translateY(-3px);
}

.instruction-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 15px;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.badge-export {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.badge-import {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.instruction-card h4 {
  color: #0f172a;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 20px 0;
}

.instruction-steps {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.instruction-step {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  gap: 15px;
  align-items: start;
  padding: 15px;
  background: white;
  border-radius: 12px;
  border-left: 4px solid transparent;
  transition: all 0.3s ease;
  animation: stepFadeIn 0.6s ease-out backwards;
}

.instruction-step:nth-child(1) { animation-delay: 0.1s; }
.instruction-step:nth-child(2) { animation-delay: 0.2s; }
.instruction-step:nth-child(3) { animation-delay: 0.3s; }
.instruction-step:nth-child(4) { animation-delay: 0.4s; }

@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.instruction-step:hover {
  border-left-color: #0ea5e9;
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.05) 0%, white 100%);
  transform: translateX(5px);
}

.step-number {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content strong {
  display: block;
  color: #0f172a;
  font-size: 1rem;
  margin-bottom: 5px;
  font-weight: 600;
}

.step-content p {
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.step-icon {
  width: 40px;
  height: 40px;
  background: rgba(14, 165, 233, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0ea5e9;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.instruction-step:hover .step-icon {
  background: rgba(14, 165, 233, 0.2);
  transform: rotate(360deg);
}

.instruction-info {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(59, 130, 246, 0.08) 100%);
  border-left: 4px solid #0ea5e9;
  border-radius: 10px;
  padding: 15px;
  display: flex;
  gap: 12px;
  align-items: start;
}

.instruction-info.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.08) 100%);
  border-left-color: #f59e0b;
}

.instruction-info i {
  color: #0ea5e9;
  font-size: 1.3rem;
  margin-top: 2px;
}

.instruction-info.warning i {
  color: #f59e0b;
}

.instruction-info p {
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

.backup-tips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 15px;
  margin-top: 25px;
}

.tip-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(167, 139, 250, 0.05) 100%);
  border-left: 3px solid #8b5cf6;
  border-radius: 10px;
  padding: 15px;
  display: flex;
  align-items: start;
  gap: 12px;
  transition: all 0.3s ease;
  animation: tipFloat 3s ease-in-out infinite;
}

.tip-card:nth-child(1) { animation-delay: 0s; }
.tip-card:nth-child(2) { animation-delay: 1s; }
.tip-card:nth-child(3) { animation-delay: 2s; }

@keyframes tipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.tip-card:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(167, 139, 250, 0.1) 100%);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(139, 92, 246, 0.2);
}

.tip-card i {
  color: #8b5cf6;
  font-size: 1.3rem;
  margin-top: 2px;
}

.tip-card div {
  flex: 1;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.5;
}

.tip-card strong {
  color: #0f172a;
  display: block;
  margin-bottom: 3px;
}

@media (max-width: 1024px) {
  .instructions-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .backup-instructions {
    padding: 20px;
  }
  
  .instruction-step {
    grid-template-columns: 35px 1fr;
    gap: 12px;
  }
  
  .step-icon {
    display: none;
  }
  
  .backup-tips {
    grid-template-columns: 1fr;
  }
}

.backup-title-container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.backup-title-container > i {
  font-size: 3rem;
  color: #0ea5e9;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(14, 165, 233, 0.05) 100%);
  padding: 20px;
  border-radius: 16px;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.backup-title-container h2 {
  color: #0f172a;
  font-size: 2.2rem;
  margin: 0;
  font-weight: 700;
}

.backup-subtitle {
  color: #64748b;
  font-size: 1rem;
  margin: 5px 0 0 0;
  font-weight: 400;
}

.backup-info-banner {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
  border-left: 4px solid #3b82f6;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  backdrop-filter: blur(10px);
}

.backup-info-banner > i {
  color: #3b82f6;
  font-size: 1.5rem;
  margin-top: 2px;
}

.backup-info-banner div {
  color: #1e293b;
  line-height: 1.6;
  font-size: 0.95rem;
}

.backup-info-banner code {
  background: rgba(255, 255, 255, 0.8);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  color: #0ea5e9;
  font-weight: 600;
}

.backup-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
  align-items: stretch;
}

.backup-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
}

.backup-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #0ea5e9, #3b82f6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.backup-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  border-color: rgba(14, 165, 233, 0.3);
}

.backup-card-icon {
  padding: 40px 40px 20px;
  text-align: center;
}

.backup-card-icon i {
  font-size: 4rem;
  background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.backup-card-export .backup-card-icon i {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.backup-card-import .backup-card-icon i {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.backup-card-full-export .backup-card-icon i {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.backup-card-full-import .backup-card-icon i {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.backup-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  animation: tagFloat 3s ease-in-out infinite;
}

@keyframes tagFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.backup-card-tag i {
  font-size: 0.9rem;
}

.backup-card-content {
  padding: 0 40px 40px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.backup-card-content h3 {
  color: #0f172a;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 15px 0;
}

.backup-card-content > p {
  color: #64748b;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.backup-features {
  list-style: none;
  padding: 0;
  margin: 0 0 25px 0;
  flex: 1;
}

.backup-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  color: #475569;
  font-size: 0.95rem;
}

.backup-features i {
  color: #10b981;
  font-size: 1rem;
}

.backup-card-import .backup-features li:first-child i {
  color: #f59e0b;
}

.btn-backup {
  width: 100%;
  padding: 16px 28px;
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: none;
  position: relative;
  overflow: hidden;
}

.btn-backup::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-backup:hover::before {
  width: 600px;
  height: 600px;
}

.btn-backup i {
  font-size: 1.2rem;
  position: relative;
  z-index: 1;
}

.btn-backup span {
  position: relative;
  z-index: 1;
}

.btn-backup-export {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.btn-backup-export:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
}

.btn-backup-export:active {
  transform: translateY(0);
}

.btn-backup-import {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

.btn-backup-import:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
}

.btn-backup-import:active {
  transform: translateY(0);
}

.btn-backup-full {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.btn-backup-full:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.4);
  transform: translateY(-2px);
}

.btn-backup-full:active {
  transform: translateY(0);
}

.btn-backup-full-import {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(236, 72, 153, 0.3);
}

.btn-backup-full-import:hover {
  background: linear-gradient(135deg, #db2777 0%, #be185d 100%);
  box-shadow: 0 12px 30px rgba(236, 72, 153, 0.4);
  transform: translateY(-2px);
}

.btn-backup-full-import:active {
  transform: translateY(0);
}

.backup-footer {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.backup-tip {
  display: flex;
  align-items: center;
  gap: 15px;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.6;
}

.backup-tip i {
  color: #f59e0b;
  font-size: 1.8rem;
}

@media (max-width: 768px) {
  .backup-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .backup-title-container {
    flex-direction: column;
    text-align: center;
  }
  
  .backup-title-container h2 {
    font-size: 1.8rem;
  }
  
  .backup-card-content {
    padding: 0 25px 25px;
  }
  
  .backup-card-icon {
    padding: 30px 25px 15px;
  }
  
  .backup-info-banner {
    flex-direction: column;
  }
}

/* Estilos para botones del modal de confirmación */
.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: #64748b;
  color: white;
  box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: #475569;
  box-shadow: 0 6px 20px rgba(100, 116, 139, 0.4);
  transform: translateY(-2px);
}

/* Estilos profesionales para modal de confirmación */
.modal-confirm {
  z-index: 10003;
}

.modal-confirm-professional {
  background: white;
  border-radius: 24px;
  padding: 0;
  max-width: 520px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
  overflow: hidden;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-confirm-icon {
  padding: 40px 40px 20px;
  text-align: center;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.modal-icon-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  animation: iconPulse 2s ease-in-out infinite;
}

.modal-icon-warning {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 10px 30px rgba(251, 191, 36, 0.4);
}

.modal-icon-circle i {
  font-size: 2.5rem;
  color: white;
}

.modal-confirm-header {
  text-align: center;
  padding: 20px 40px;
}

.modal-confirm-header h3 {
  color: #0f172a;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.modal-confirm-subtitle {
  color: #64748b;
  font-size: 1rem;
  margin: 0;
}

.modal-confirm-body {
  padding: 0 40px 30px;
}

.modal-warning-box {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(220, 38, 38, 0.08) 100%);
  border-left: 4px solid #ef4444;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
}

.modal-warning-box > i {
  color: #ef4444;
  font-size: 1.5rem;
  margin-top: 2px;
}

.modal-warning-box strong {
  color: #0f172a;
  font-size: 1.05rem;
  display: block;
  margin-bottom: 8px;
}

.modal-warning-box p {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

.modal-info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(14, 165, 233, 0.05);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-info-item:hover {
  background: rgba(14, 165, 233, 0.1);
  transform: translateX(5px);
}

.modal-info-item i {
  color: #0ea5e9;
  font-size: 1.1rem;
}

.modal-info-item span {
  color: #475569;
  font-size: 0.95rem;
}

.modal-confirm-footer {
  display: flex;
  gap: 12px;
  padding: 25px 40px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.btn-modal {
  flex: 1;
  padding: 14px 24px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-modal::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-modal:hover::before {
  width: 300px;
  height: 300px;
}

.btn-modal i,
.btn-modal span {
  position: relative;
  z-index: 1;
}

.btn-modal-cancel {
  background: #e2e8f0;
  color: #475569;
}

.btn-modal-cancel:hover {
  background: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-modal-confirm {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-modal-confirm:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

.btn-modal-confirm:active,
.btn-modal-cancel:active {
  transform: translateY(0);
}

/* Overlay genérico para modales (modalProgresoPDF, adminUsersModal, etc.) */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(5px);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

/* Modal de Progreso */
.modal-progress {
  z-index: 10001;
}

.modal-progress-content {
  background: white;
  border-radius: 20px;
  padding: 50px;
  max-width: 450px;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.progress-icon {
  margin-bottom: 25px;
}

.progress-icon i {
  font-size: 4rem;
  color: #dc2626;
  animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.spinner {
  width: 60px;
  height: 60px;
  border: 5px solid #e2e8f0;
  border-top-color: #0ea5e9;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.modal-progress-content h3 {
  color: #0f172a;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 10px 0;
}

.modal-progress-content p {
  color: #64748b;
  font-size: 1rem;
  margin: 0 0 30px 0;
  min-height: 24px;
}

.progress-bar-container {
  width: 100%;
  background: #e2e8f0;
  border-radius: 10px;
  height: 12px;
  overflow: hidden;
  margin-bottom: 15px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #dc2626, #ef4444, #dc2626);
  background-size: 200% 100%;
  border-radius: 10px;
  width: 0%;
  transition: width 0.4s ease;
  animation: progressShine 2s linear infinite;
}

@keyframes progressShine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.progress-percentage {
  font-size: 2rem;
  font-weight: 700;
  color: #0ea5e9;
  margin-top: 10px;
  font-family: 'Courier New', monospace;
}

@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Modal de Error Profesional */
.modal-error {
  z-index: 10002;
}

.modal-error-content {
  background: linear-gradient(135deg, #fc5c7d 0%, #6a82fb 100%);
  border-radius: 28px;
  padding: 0;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 25px 70px rgba(252, 92, 125, 0.5);
  animation: errorShakeIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
  overflow: hidden;
}

.modal-error-content::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@keyframes errorShakeIn {
  0% { 
    transform: scale(0.8) translateX(-30px);
    opacity: 0;
  }
  50% { 
    transform: scale(1.05) translateX(10px);
  }
  75% { 
    transform: scale(0.98) translateX(-5px);
  }
  100% { 
    transform: scale(1) translateX(0);
    opacity: 1;
  }
}

.modal-error-icon {
  padding: 50px 40px 30px;
  text-align: center;
  background: transparent;
  position: relative;
  z-index: 1;
}

.modal-icon-error {
  background: transparent;
  font-size: 72px;
  color: white;
  display: inline-block;
  animation: errorIconPulse 2s ease-in-out infinite;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
  box-shadow: none;
}

@keyframes errorIconPulse {
  0%, 100% { 
    transform: scale(1) rotate(0deg); 
    opacity: 1; 
  }
  25% { 
    transform: scale(1.15) rotate(-5deg); 
  }
  50% { 
    transform: scale(1.1) rotate(5deg); 
    opacity: 0.9; 
  }
  75% { 
    transform: scale(1.15) rotate(-5deg); 
  }
}

.modal-error-header {
  text-align: center;
  padding: 0 40px 30px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
  position: relative;
  z-index: 1;
}

.modal-error-header h3 {
  color: white;
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 12px 0;
  text-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.5px;
}

.modal-error-subtitle {
  color: rgba(255, 255, 255, 0.95);
  font-size: 17px;
  margin: 0;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-error-body {
  padding: 35px 40px;
  background: white;
  position: relative;
  z-index: 1;
}

.error-message-box {
  background: linear-gradient(135deg, #fff5f5 0%, #ffebee 100%);
  border-left: 5px solid #fc5c7d;
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 28px;
  box-shadow: 0 4px 15px rgba(252, 92, 125, 0.1);
}

.error-code {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 10px 22px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 15px;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  text-transform: uppercase;
  animation: codeFloat 2s ease-in-out infinite;
  font-family: 'Courier New', monospace;
}

@keyframes codeFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

.error-code i {
  margin-right: 8px;
  font-size: 14px;
}

.error-message-box p {
  color: #2c3e50;
  font-size: 17px;
  line-height: 1.7;
  margin: 0;
  font-weight: 500;
}

.error-details {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 18px;
  margin-top: 25px;
  border: 2px solid #e8eaed;
}

.error-details-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #7f8c8d;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.error-details-header::before {
  content: '⚙️';
  font-size: 16px;
}

.error-details pre {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  color: #5a6c7d;
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: 'Consolas', 'Courier New', monospace;
  max-height: 130px;
  overflow-y: auto;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.error-details pre::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.error-details pre::-webkit-scrollbar-track {
  background: #ecf0f1;
  border-radius: 10px;
}

.error-details pre::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
}

.modal-error-footer {
  display: flex;
  gap: 15px;
  padding: 25px 40px 35px;
  background: white;
  border-top: none;
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
  position: relative;
  z-index: 1;
}

.btn-modal-details {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  color: #475569;
  flex: 1;
  padding: 16px 30px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-modal-details:hover {
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-modal-details.active i {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.btn-modal-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  flex: 2;
  padding: 16px 50px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.btn-modal-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-modal-primary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-modal-primary:hover {
  background: linear-gradient(135deg, #5568d3 0%, #6a3e8e 100%);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
}

.btn-modal-primary:active {
  transform: translateY(-1px) scale(1.02);
}

/* Modal de Éxito */
.modal-success {
  z-index: 10002;
}

.modal-success-content {
  background: white;
  border-radius: 24px;
  padding: 0;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
  overflow: visible;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-success-icon {
  padding: 40px 40px 20px;
  text-align: center;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  overflow: hidden;
}

.modal-icon-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
}

.modal-success-header {
  text-align: center;
  padding: 20px 40px;
}

.modal-success-header h3 {
  color: #0f172a;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.modal-success-subtitle {
  color: #64748b;
  font-size: 1rem;
  margin: 0;
}

.modal-success-body {
  padding: 0 40px 30px;
  flex: 1;
  overflow-y: auto;
}

.success-info-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(5, 150, 105, 0.08) 100%);
  border-left: 4px solid #10b981;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.success-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.success-item i {
  color: #10b981;
  font-size: 1.2rem;
  margin-top: 2px;
}

.success-item div {
  flex: 1;
}

.success-item strong {
  display: block;
  color: #0f172a;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.success-item span {
  color: #475569;
  font-size: 0.95rem;
  word-break: break-all;
}

.modal-success-footer {
  display: flex;
  justify-content: center;
  padding: 25px 40px 30px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  flex-shrink: 0;
}

.btn-modal-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  min-width: 150px;
}

.btn-modal-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
}

/* ===== ESTILOS DE LOGIN ===== */

.login-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100dvh;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(0px);
  transition: backdrop-filter 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.login-modal.hidden {
  display: none;
}

.login-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  z-index: -1;
  animation: overlayFadeIn 0.6s ease-out;
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.login-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: clamp(16px, 2vw, 28px);
}

.login-decoration {
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
  pointer-events: none;
}

.login-decoration-left {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #0ea5e9 0%, transparent 70%);
  top: -100px;
  left: -100px;
  animation: float 8s ease-in-out infinite;
}

.login-decoration-right {
  width: 400px;
  height: 400px;
  background: transparent;
  bottom: -100px;
  right: -100px;
  animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(30px);
  }
}

.login-card {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(360px, 0.95fr);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 1px rgba(255, 255, 255, 0.5) inset;
  max-width: 1040px;
  width: min(92vw, 1040px);
  min-height: 620px;
  max-height: calc(100dvh - 32px);
  z-index: 2;
  animation: cardSlideIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: auto;
  position: relative;
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 42px 38px;
  background:
    linear-gradient(160deg, rgba(2, 6, 23, 0.95) 0%, rgba(15, 23, 42, 0.92) 40%, rgba(8, 47, 73, 0.88) 100%),
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18) 0%, transparent 45%);
  color: #fff;
}

.login-brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.05) 32%, transparent 64%);
  animation: brandSweep 8s linear infinite;
  pointer-events: none;
}

@keyframes brandSweep {
  0% {
    transform: translateX(-10%);
  }
  50% {
    transform: translateX(6%);
  }
  100% {
    transform: translateX(-10%);
  }
}

.login-brand-badge,
.login-brand-visual,
.login-brand-copy {
  position: relative;
  z-index: 1;
}

.login-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(186, 230, 253, 0.25);
  color: #e0f2fe;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.login-brand-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
}

.login-brand-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: transparent;
  filter: none;
  animation: none;
}

@keyframes brandGlowPulse {
  0%, 100% {
    transform: scale(0.94);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.login-brand-image {
  position: relative;
  z-index: 1;
  max-width: 320px;
  width: min(100%, 320px);
  height: auto;
  object-fit: contain;
  filter: none;
  animation: brandImageFloat 5s ease-in-out infinite;
}

@keyframes brandImageFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-14px) scale(1.02);
  }
}

.login-brand-copy h1 {
  font-size: 38px;
  line-height: 1.05;
  margin: 0 0 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.login-brand-copy .login-subtitle {
  color: rgba(226, 232, 240, 0.95);
  font-size: 16px;
  margin: 0 0 12px;
  letter-spacing: 0.02em;
}

.login-brand-text {
  margin: 0;
  color: rgba(203, 213, 225, 0.88);
  font-size: 15px;
  line-height: 1.7;
  max-width: 38ch;
}

.login-form-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px 42px 34px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.97) 100%);
  min-width: 0;
}

.login-form-panel::before {
  content: '';
  position: absolute;
  inset: 20px;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  pointer-events: none;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);
  border-radius: 22px;
  margin-bottom: 18px;
  font-size: 34px;
  color: white;
  box-shadow: none;
  animation: logoBounce 0.8s ease-out;
}

@keyframes logoBounce {
  0% {
    transform: translateY(-30px);
    opacity: 0;
  }
  50% {
    transform: translateY(5px);
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.login-header h2 {
  font-size: 30px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 8px;
}

.login-form-subtitle {
  font-size: 14px;
  color: #64748b;
  margin: 0;
  letter-spacing: 0.02em;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: formFadeIn 0.8s ease-out 0.2s both;
  position: relative;
  z-index: 1;
}

@keyframes formFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.form-group-login {
  position: relative;
  display: flex;
  flex-direction: column;
}

.form-group-login label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group-login label i {
  color: #0ea5e9;
  font-size: 16px;
}

.form-group-login input {
  padding: 14px 16px;
  font-size: 15px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group-login input:focus {
  outline: none;
  background: #ffffff;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-group-login input::placeholder {
  color: #94a3b8;
}

.input-border {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #0ea5e9, #3b82f6);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.form-group-login input:focus ~ .input-border,
.form-group-login input:valid ~ .input-border {
  width: 100%;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  width: 100%;
}

.toggle-password {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  font-size: 18px;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.3s ease;
  padding: 5px;
}

.toggle-password:hover {
  color: #0ea5e9;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -6px;
}

.form-checkbox input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #0ea5e9;
}

.form-checkbox label {
  font-size: 14px;
  color: #475569;
  cursor: pointer;
  margin: 0;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}

.login-security-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0369a1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.login-button {
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(14, 165, 233, 0.6);
}

.login-button:active {
  transform: translateY(0);
}

.login-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-error {
  padding: 12px 16px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #991b1b;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  animation: errorShake 0.4s ease;
}

@keyframes errorShake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

.login-error i {
  font-size: 16px;
}

.login-footer {
  margin-top: 6px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  text-align: center;
}

.login-footer p {
  margin: 0;
}

.login-footer-title {
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-footer-meta {
  color: #64748b;
  font-size: 12px;
  margin-top: 6px;
}

.login-footer-developer {
  color: #334155;
  font-size: 12px;
  margin-top: 8px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-content: center;
}

.login-footer-developer i {
  color: #0284c7;
  font-size: 12px;
}

.login-card-accent {
  position: absolute;
  top: 0;
  right: 0;
  width: 160px;
  height: 160px;
  background: transparent;
  pointer-events: none;
}

.login-card-grid {
  position: absolute;
  inset: auto 24px 24px auto;
  width: 110px;
  height: 110px;
  background-image:
    linear-gradient(rgba(14, 165, 233, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.08) 1px, transparent 1px);
  background-size: 14px 14px;
  mask-image: radial-gradient(circle, #000 35%, transparent 85%);
  pointer-events: none;
}

@media (max-width: 980px) {
  .login-container {
    justify-content: flex-start;
  }

  .login-card {
    grid-template-columns: 1fr;
    max-width: 620px;
    min-height: auto;
    max-height: none;
  }

  .login-brand-panel {
    padding: 28px 28px 24px;
    gap: 20px;
  }

  .login-brand-copy h1 {
    font-size: 32px;
  }

  .login-brand-text {
    max-width: none;
  }

  .login-form-panel {
    padding: 30px 28px 24px;
  }
}

@media (max-width: 640px) {
  .login-container {
    padding: 12px;
  }

  .login-card {
    width: 100%;
    border-radius: 22px;
    max-height: none;
  }

  .login-brand-panel,
  .login-form-panel {
    padding: 22px 18px;
  }

  .login-brand-visual {
    min-height: 140px;
  }

  .login-brand-image {
    max-width: 200px;
  }

  .login-brand-copy h1,
  .login-header h2 {
    font-size: 26px;
  }

  .login-brand-copy .login-subtitle,
  .login-brand-text,
  .login-form-subtitle {
    font-size: 13px;
  }

  .login-header {
    margin-bottom: 22px;
  }

  .login-logo {
    width: 62px;
    height: 62px;
    font-size: 28px;
    border-radius: 18px;
    margin-bottom: 14px;
  }

  .login-form {
    gap: 18px;
  }

  .form-group-login input {
    padding: 12px 14px;
    font-size: 14px;
  }

  .form-checkbox-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-security-note {
    white-space: normal;
  }

  .login-card-grid,
  .login-card-accent,
  .login-decoration-left,
  .login-decoration-right {
    display: none;
  }
}

@media (max-height: 820px) {
  .login-container {
    justify-content: flex-start;
  }

  .login-card {
    min-height: auto;
    max-height: none;
  }

  .login-brand-panel,
  .login-form-panel {
    padding-top: 26px;
    padding-bottom: 22px;
  }

  .login-brand-visual {
    min-height: 180px;
  }

  .login-brand-image {
    max-width: 240px;
  }
}

@media (max-height: 700px) {
  .login-card {
    grid-template-columns: 1fr;
    width: min(94vw, 620px);
  }

  .login-brand-panel {
    padding: 20px 22px 18px;
    gap: 14px;
  }

  .login-brand-visual {
    min-height: 112px;
  }

  .login-brand-image {
    max-width: 150px;
  }

  .login-brand-copy h1 {
    font-size: 28px;
  }

  .login-brand-text {
    line-height: 1.45;
  }

  .login-form-panel {
    padding: 20px 22px 18px;
  }

  .login-header {
    margin-bottom: 16px;
  }

  .login-logo {
    width: 56px;
    height: 56px;
    font-size: 24px;
    margin-bottom: 10px;
  }

  .login-form {
    gap: 14px;
  }

  .login-footer {
    padding-top: 14px;
  }
}

/* ===== MODAL ADMINISTRACIÓN DE USUARIOS ===== */
.admin-users-modal-content {
  background: #1a1f2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 96%;
  max-width: 1100px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  animation: fadeInUp 0.3s ease-out;
}

.admin-users-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(30, 36, 50, 0.6) 100%);
  border-radius: 16px 16px 0 0;
  position: sticky;
  top: 0;
  z-index: 1;
}

.admin-users-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-users-modal-title i {
  font-size: 22px;
  color: #f59e0b;
}

.admin-users-modal-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #f1f5f9;
}

.admin-users-modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.2s;
}

.admin-users-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.admin-users-modal-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.admin-users-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #cbd5e1;
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.users-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 14px;
  transition: border-color 0.2s;
}
.users-search-bar:focus-within {
  border-color: rgba(245, 158, 11, 0.45);
}
.users-search-bar i {
  color: #94a3b8;
  font-size: 14px;
  flex-shrink: 0;
}
.users-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e2e8f0;
  font-size: 14px;
}
.users-search-bar input::placeholder {
  color: #64748b;
}
.users-search-clear {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 0 2px;
  font-size: 13px;
  display: none;
  transition: color 0.2s;
}
.users-search-clear.visible {
  display: inline-flex;
}
.users-search-clear:hover {
  color: #e2e8f0;
}
.users-search-empty {
  text-align: center;
  padding: 24px;
  color: #64748b;
  font-size: 14px;
}

.admin-users-section-title i {
  color: #f59e0b;
}

/* Tabla de usuarios */
.admin-users-table-wrapper {
  overflow: auto;
  max-height: 420px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(15, 23, 42, 0.55);
}

.admin-users-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 14px;
  background: transparent;
  table-layout: auto;
}

.admin-users-table thead tr {
  background: rgba(245, 158, 11, 0.12);
}

.admin-users-table th {
  padding: 11px 16px;
  text-align: left;
  font-weight: 600;
  color: #f59e0b;
  font-size: 13px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
  backdrop-filter: blur(6px);
}

.admin-users-table td {
  padding: 12px 16px;
  color: #e2e8f0;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  border-left: none;
  border-right: none;
  vertical-align: middle;
  white-space: nowrap;
  background: transparent;
  box-shadow: none;
}

.users-col-id {
  width: 60px;
}

.users-col-username {
  min-width: 180px;
}

.users-col-password {
  min-width: 220px;
}

.users-col-role {
  min-width: 120px;
}

.users-col-actions {
  min-width: 260px;
  width: 280px;
}

.admin-user-raw {
  text-transform: none !important;
  letter-spacing: normal;
  font-family: 'Consolas', 'Courier New', monospace;
  color: #f8fafc;
}

.admin-users-table tbody tr {
  background: rgba(15, 23, 42, 0.72);
}

.admin-users-table tbody tr td:first-child {
  border-left: none;
}

.admin-users-table tbody tr td:last-child {
  border-right: none;
}

.admin-users-table tbody tr:nth-child(even) {
  background: rgba(30, 41, 59, 0.86);
}

.admin-users-table tbody tr:hover {
  background: rgba(245, 158, 11, 0.10);
}

.admin-users-table tbody tr:last-child td {
  border-bottom: none;
}

/* Badges de rol */
.badge-role {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-role-admin {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-role-standard {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Botones toggle contraseña */
.btn-toggle-pwd {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 3px 6px;
  margin-left: 4px;
  border-radius: 4px;
  transition: color 0.2s;
  font-size: 13px;
  vertical-align: middle;
}

.btn-toggle-pwd:hover {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
}

/* ===== PDF SIMPLE DOWNLOAD MODAL ===== */
.pdf-simple-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.pdf-simple-card {
  background: #ffffff;
  border-radius: 14px;
  width: 440px;
  max-width: 92vw;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.pdf-simple-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px 18px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.pdf-simple-icon {
  font-size: 2rem;
  color: #ef4444;
  flex-shrink: 0;
}

.pdf-simple-title {
  margin: 0;
  font-size: 0.97rem;
  font-weight: 700;
  color: #f1f5f9;
}

.pdf-simple-subtitle {
  margin: 3px 0 0;
  font-size: 0.78rem;
  color: #94a3b8;
}

.pdf-simple-card-body {
  padding: 22px 24px 14px;
}

.pdf-simple-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.pdf-simple-bar-track {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}

.pdf-simple-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9 0%, #ef4444 100%);
  border-radius: 99px;
  transition: width 0.35s ease;
}

.pdf-simple-pct-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  min-width: 36px;
  text-align: right;
}

.pdf-simple-step-text {
  margin: 0;
  font-size: 0.84rem;
  color: #475569;
  min-height: 1.2em;
}

.pdf-simple-path-text {
  margin: 12px 0 0;
  font-size: 0.75rem;
  color: #64748b;
  word-break: break-all;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 10px;
  line-height: 1.5;
}

.pdf-simple-card-footer {
  padding: 12px 24px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid #f1f5f9;
}

.pdf-simple-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}

.pdf-simple-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.pdf-simple-btn-open {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  color: #ffffff;
}

.pdf-simple-btn-close {
  background: #e2e8f0;
  color: #334155;
}

.btn-action-pdf-view {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  color: white;
}

.btn-action-pdf-view:hover {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

/* Botones de acciones en tabla */
.user-actions-cell {
  display: table-cell;
  white-space: normal;
  vertical-align: middle;
  background-color: transparent !important;
}

.admin-users-table tbody tr .user-actions-cell,
.admin-users-table tbody tr .user-actions-cell * {
  background-color: transparent;
}

.user-actions-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  background: transparent;
}

.user-actions-cell .btn-user-edit,
.user-actions-cell .btn-user-delete,
.user-actions-cell .btn-user-unlock {
  margin: 0;
}

.btn-user-edit,
.btn-user-delete,
.btn-user-unlock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 116px;
  flex-shrink: 0;
  padding: 7px 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-user-edit {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-user-edit:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
}

.btn-user-delete {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-user-delete:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.45);
}

.btn-user-delete:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Usuario bloqueado */
.user-row-bloqueado td {
  opacity: 0.75;
}

.badge-bloqueado {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  vertical-align: middle;
}

.badge-cambiar-pwd {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  vertical-align: middle;
}

.btn-user-unlock {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.btn-user-unlock:hover {
  background: rgba(34, 197, 94, 0.28);
  border-color: rgba(34, 197, 94, 0.55);
}

/* Formulario de usuario */
.admin-users-form-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 20px 22px;
}

.admin-user-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-user-form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.admin-user-form-group label {
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-user-form-group label i {
  color: #f59e0b;
  font-size: 13px;
}

.admin-user-form-group input,
.admin-user-form-group select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 9px 13px;
  color: #f1f5f9;
  font-size: 14px;
  transition: border-color 0.2s;
}

.admin-user-form-group input:focus,
.admin-user-form-group select:focus {
  outline: none;
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(255, 255, 255, 0.07);
}

.admin-user-form-group select option {
  background: #1a1f2e;
  color: #f1f5f9;
}

.admin-user-form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-user-submit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1a1208;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-user-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.btn-user-cancel {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-user-cancel:hover {
  background: rgba(100, 116, 139, 0.25);
  color: #cbd5e1;
}

@media (max-width: 640px) {
  .admin-user-form-row {
    grid-template-columns: 1fr;
  }
  .admin-users-modal-content {
    width: 98%;
    max-width: 98%;
    border-radius: 12px;
  }
  .admin-users-modal-header,
  .admin-users-modal-body {
    padding: 16px;
  }
}

/* ============================================================
   PANEL DE ACTIVIDAD
   ============================================================ */

.actividad-section {
  padding: clamp(16px, 2vw, 24px);
  max-width: 1400px;
  margin: 0 auto;
}

.actividad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.actividad-title-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.actividad-title-container > i {
  font-size: 2rem;
  color: #8b5cf6;
  background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(168,85,247,0.1));
  padding: 14px;
  border-radius: 14px;
}

.actividad-title-container h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

.actividad-subtitle {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 0.875rem;
}

.btn-actividad-refresh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-actividad-refresh:hover {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  transform: translateY(-1px);
}

/* Filtros */
.actividad-filtros {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.actividad-filtro-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
  flex: 1;
}

.actividad-filtro-busqueda {
  flex: 2;
  min-width: 220px;
}

.actividad-filtro-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.actividad-input {
  padding: 8px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.2s;
  outline: none;
}

.actividad-input:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
}

.btn-actividad-clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  align-self: flex-end;
}

.btn-actividad-clear:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* Tabla */
.actividad-table-wrapper {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  overflow: auto;
  max-height: 68vh;
  position: relative;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

.actividad-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 880px;
  table-layout: auto;
}

.actividad-table thead tr {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.actividad-table thead th {
  padding: 13px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  background: #6d28d9;
  background-image: none;
  position: sticky;
  top: 0;
  z-index: 6;
  vertical-align: top;
}

.actividad-table thead th::after {
  background: rgba(255, 255, 255, 0.28);
}

.actividad-table thead th i {
  margin-right: 5px;
  opacity: 0.8;
}

.actividad-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}

.actividad-table tbody tr:last-child {
  border-bottom: none;
}

.actividad-table tbody tr:hover {
  background: #faf5ff;
}

.actividad-table td {
  padding: 12px 16px;
  vertical-align: middle;
  color: #334155;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}

.logs-td-fecha {
  white-space: nowrap;
  font-weight: 500;
  color: #475569;
  font-size: 0.82rem;
  min-width: 132px;
}

.logs-hora {
  font-size: 0.75rem;
  color: #94a3b8;
}

.logs-td-usuario {
  font-weight: 600;
  color: #1e293b;
  min-width: 140px;
}

.logs-td-usuario i {
  color: #8b5cf6;
  margin-right: 4px;
}

.logs-td-accion {
  min-width: 170px;
}

.logs-td-detalle {
  color: #64748b;
  font-size: 0.83rem;
  min-width: 280px;
  max-width: 520px;
}

.logs-detalle-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.logs-detalle-wrap > span {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.btn-log-cambios {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-log-cambios:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
}

.log-edit-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10010;
  padding: 24px;
}

.log-edit-modal-card {
  width: min(760px, 96vw);
  max-height: 86vh;
  overflow: hidden;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
}

.splash-content,
.header-actions,
.form-section,
.table-section,
.filter-panel,
.actividad-section,
.actividad-header,
.actividad-title-container,
.actividad-filtros,
.backup-container,
.instructions-container,
.login-card,
.qr-left-panel,
.qr-datos-grid,
.log-edit-modal-card {
  min-width: 0;
}

@media (max-width: 1200px) {
  .splash-content {
    width: min(100%, 1120px);
  }

  .splash-buttons {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .filter-panel,
  .actividad-filtros {
    padding: 14px;
  }

  .btn-export {
    flex: 1 1 220px;
    justify-content: center;
  }
}

@media (max-width: 900px) {
  header {
    padding: 22px 18px;
    flex-direction: column;
    gap: 14px;
  }

  header h1 {
    font-size: clamp(1.3rem, 4.2vw, 1.8rem);
    line-height: 1.3;
    text-align: center;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .btn-back-menu,
  .btn-logout,
  .btn-actividad-refresh {
    width: 100%;
    justify-content: center;
  }

  .actividad-filtros {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .actividad-filtro-busqueda {
    grid-column: 1 / -1;
  }

  .btn-actividad-clear {
    width: 100%;
    justify-content: center;
    align-self: stretch;
  }

  .actividad-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
  }

  .actividad-table {
    min-width: 820px;
  }

  .paginacion-wrapper,
  .paginacion-info-simple {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .splash-content {
    width: min(100%, 98vw);
    padding: 18px 10px 16px;
  }

  .splash-corner-left {
    left: 18px;
  }

  .splash-corner-right {
    right: 18px;
  }

  .splash-logo {
    max-width: 280px;
    max-height: 220px;
  }

  .actividad-title-container {
    align-items: flex-start;
  }

  .actividad-filtros {
    grid-template-columns: 1fr;
  }

  #efectosTable {
    min-width: 1180px;
    table-layout: auto;
  }

  .actividad-table {
    min-width: 720px;
    font-size: 0.82rem;
  }

  .actividad-table thead th,
  .actividad-table td {
    padding: 10px 12px;
  }

  .logs-td-fecha {
    min-width: 118px;
  }

  .logs-td-usuario {
    min-width: 124px;
  }

  .logs-td-accion {
    min-width: 148px;
  }

  .logs-td-detalle {
    min-width: 240px;
    max-width: none;
  }

  .btn-log-cambios {
    width: 100%;
    justify-content: center;
  }

  .log-badge-manual {
    align-items: flex-start;
  }

  .log-badge-manual-text {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    line-height: 1.15;
  }

  .log-badge-manual-text span {
    display: block;
  }

  .admin-users-table {
    min-width: 760px;
  }

  .log-edit-modal-overlay {
    padding: 12px;
  }

  .log-edit-modal-header,
  .log-edit-modal-body,
  .log-edit-modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
}

.log-edit-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}

.log-edit-modal-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #0f172a;
}

.log-edit-modal-header p {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: #475569;
}

.log-edit-modal-close {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
}

.log-edit-modal-body {
  padding: 16px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-edit-item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fafc;
}

.log-edit-label {
  font-size: 0.83rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}

.log-edit-values {
  display: grid;
  gap: 6px;
  font-size: 0.8rem;
}

.log-edit-before {
  color: #7f1d1d;
}

.log-edit-after {
  color: #14532d;
}

.log-edit-empty {
  font-size: 0.86rem;
  color: #475569;
  padding: 8px 0;
}

.log-edit-modal-footer {
  border-top: 1px solid #e2e8f0;
  padding: 12px 22px 16px;
  display: flex;
  justify-content: flex-end;
}

.log-edit-modal-btn {
  border: none;
  background: #0f766e;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

/* Badges de acción */
.log-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: normal;
  line-height: 1.3;
  max-width: 100%;
}

.log-badge-manual-text {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  flex-wrap: wrap;
}

.log-badge-manual-text span {
  display: inline;
}

.log-badge i {
  font-size: 0.75rem;
}

.log-badge-session  { background: #dbeafe; color: #1d4ed8; }
.log-badge-logout   { background: #fef3c7; color: #d97706; }
.log-badge-create   { background: #dcfce7; color: #15803d; }
.log-badge-edit     { background: #e0f2fe; color: #0369a1; }
.log-badge-delete   { background: #fee2e2; color: #dc2626; }
.log-badge-backup   { background: #f3e8ff; color: #7c3aed; }
.log-badge-security { background: #fff7ed; color: #c2410c; }
.log-badge-info     { background: #f1f5f9; color: #475569; }

/* Estado vacío */
.actividad-empty,
.logs-empty-state {
  text-align: center;
  padding: 40px;
  color: #94a3b8;
}

.logs-empty-state i {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 10px;
  opacity: 0.4;
}

/* Contador */
.actividad-count {
  margin-top: 10px;
  font-size: 0.82rem;
  color: #94a3b8;
  text-align: right;
  padding-right: 4px;
}


/* ==================== MODAL QR COMPROBANTE DE CUSTODIA ==================== */
.qr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 45, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  box-sizing: border-box;
}

.qr-modal-content {
  background: #f4f7fc;
  border-radius: 16px;
  width: 100%;
  max-width: 980px;
  max-height: 94vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
}

/* ---- Header ---- */
.qr-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 22px;
  background: linear-gradient(135deg, #0c2461 0%, #1a56db 100%);
  border-radius: 16px 16px 0 0;
  flex-shrink: 0;
  border-bottom: 3px solid rgba(245, 158, 11, 0.65);
}

.qr-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 0.93rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.qr-modal-title i { font-size: 1.15rem; opacity: 0.85; }

.qr-modal-close {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  transition: all 0.2s;
  flex-shrink: 0;
}
.qr-modal-close:hover {
  background: rgba(255,255,255,0.26);
  border-color: rgba(255,255,255,0.4);
}

/* ---- Body ---- */
.qr-modal-body {
  display: flex;
  flex-direction: column;
  align-items: start;
  padding: 12px;
  gap: 10px;
  background: #f4f7fc;
}

/* ---- Left panel ---- */
.qr-left-panel {
  display: grid;
  grid-template-columns: 250px 1fr;
  align-items: stretch;
  gap: 10px;
  position: static;
  width: 100%;
}

.qr-code-wrapper {
  background: #fff;
  padding: 14px;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(12, 36, 97, 0.1);
  border: 1.5px solid #dce5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 220px;
}

.qr-code-img {
  width: 248px;
  height: 248px;
  display: block;
  image-rendering: crisp-edges;
}

.qr-loading-placeholder {
  width: 248px;
  height: 248px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #93c5fd;
}

.qr-meta-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

.qr-codigo-unico-display {
  background: #fff;
  border: 1.5px solid #dce5f5;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(12, 36, 97, 0.06);
}

.qr-codigo-unico-display .qr-label {
  display: block;
  font-size: 0.67rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.qr-codigo-unico-display .qr-value {
  display: block;
  font-size: 0.87rem;
  font-weight: 700;
  color: #0c2461;
  letter-spacing: 0.03em;
  word-break: break-all;
  line-height: 1.45;
}

.qr-hint {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.5;
  text-align: center;
  background: #fff;
  border: 1px solid #dce5f5;
  border-radius: 8px;
  padding: 9px 12px;
  margin: 0;
}

/* ---- Right panel ---- */
.qr-right-panel {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1.5px solid #dce5f5;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(12, 36, 97, 0.07);
  width: 100%;
}

.qr-datos-header {
  background: linear-gradient(135deg, #0c2461, #1a56db);
  color: #fff;
  padding: 11px 16px;
  font-size: 0.77rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.qr-datos-header i { opacity: 0.75; }

.qr-datos-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  grid-auto-rows: minmax(74px, auto);
}

.qr-dato-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  padding: 9px 12px;
  border-bottom: 1px solid #eef2f9;
  border-right: 1px solid #eef2f9;
  min-width: 0;
  min-height: 74px;
  height: 100%;
  box-sizing: border-box;
  transition: background 0.15s;
}

.qr-dato-card:hover {
  background: #f5f8ff;
}

.qr-dato-card:nth-child(even) {
  border-right: none;
}

.qr-datos-grid .qr-tabla-label {
  font-weight: 700;
  color: #000000;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.qr-datos-grid .qr-tabla-val {
  color: #000000;
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  display: block;
}

/* Legacy tabla classes */
.qr-datos-tabla {
  margin: 0;
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.qr-datos-tabla tr:nth-child(even) { background: #f8faff; }

.qr-tabla-label {
  font-weight: 600;
  color: #475569;
  padding: 10px 12px;
  width: 34%;
  vertical-align: top;
  border-bottom: 1px solid #e8edf4;
  word-break: break-word;
  background: rgba(248, 250, 252, 0.8);
  font-size: 0.82rem;
}

.qr-tabla-val {
  color: #1e293b;
  padding: 10px 12px;
  border-bottom: 1px solid #e8edf4;
  word-break: break-word;
  line-height: 1.45;
  font-size: 0.88rem;
}

/* ---- Footer ---- */
.qr-modal-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 13px 18px 15px;
  border-top: 1.5px solid #dce5f5;
  background: #fff;
  border-radius: 0 0 16px 16px;
  flex-shrink: 0;
}

/* Export status bar */
.qr-export-status {
  width: 100%;
  order: -1;
}

.qr-export-status-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #475569;
  margin-bottom: 5px;
  gap: 8px;
  font-weight: 500;
}

.qr-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e8eef8;
  overflow: hidden;
}

.qr-progress-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0c2461, #1a56db);
  transition: width 0.25s ease;
}

.qr-export-path {
  margin-top: 4px;
  font-size: 0.69rem;
  color: #94a3b8;
  word-break: break-all;
}

/* Buttons */
.qr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.qr-btn-pdf  { background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; box-shadow: 0 2px 8px rgba(220,38,38,0.28); }
.qr-btn-pdf:hover  { background: linear-gradient(135deg, #b91c1c, #991b1b); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(220,38,38,0.38); }
.qr-btn-abrir  { background: linear-gradient(135deg, #0d9488, #0f766e); color: #fff; box-shadow: 0 2px 8px rgba(13,148,136,0.28); }
.qr-btn-abrir:hover  { background: linear-gradient(135deg, #0f766e, #115e59); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(13,148,136,0.38); }
.qr-btn-cerrar  { background: #f1f5f9; color: #475569; border: 1.5px solid #dce5f5; }
.qr-btn-cerrar:hover  { background: #e2e8f0; color: #334155; }
.qr-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

@media (max-width: 860px) {
  .qr-modal-content {
    max-width: 98vw;
  }

  .qr-left-panel {
    grid-template-columns: 1fr;
    position: static;
  }

  .qr-code-wrapper {
    min-height: 210px;
  }

  .qr-code-img,
  .qr-loading-placeholder {
    width: 190px;
    height: 190px;
  }

  .qr-datos-grid {
    grid-template-columns: 1fr;
  }

  .qr-dato-card:nth-child(even) {
    border-right: 1px solid #eef2f9;
  }
}

@media (max-width: 640px) {
  .qr-modal-overlay {
    padding: 8px;
  }

  .qr-modal-header,
  .qr-modal-body,
  .qr-modal-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .qr-code-img,
  .qr-loading-placeholder {
    width: 180px;
    height: 180px;
  }
}

.restituido-status-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid rgba(22, 163, 74, 0.28);
  border-radius: 12px;
  background: linear-gradient(135deg, #ecfdf5 0%, #dcfce7 100%);
  color: #166534;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.restituido-status-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(22, 163, 74, 0.18);
}

.restituido-status-title {
  font-size: 0.88rem;
  line-height: 1.1;
}

.restituido-status-subtitle {
  font-size: 0.7rem;
  font-weight: 600;
  color: #15803d;
}

.detalle-status-restituido,
.detalle-status-activo {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.detalle-status-restituido {
  background: rgba(22, 163, 74, 0.14);
  color: #166534;
}

.detalle-status-activo {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

/* =====================================================================
   CORRECCIONES MÓVIL — Dispositivos ≤ 640px (Samsung A15 y similares)
   ===================================================================== */

/* Splash screen: habilitar scroll en móvil para que no se corten botones */
@media (max-width: 640px) {
  .splash-screen {
    overflow-x: hidden;
    overflow-y: auto;
    align-items: flex-start;
  }

  /* Padding superior para que el contenido no quede debajo de los logos */
  .splash-content {
    padding-top: 80px;
    padding-bottom: 20px;
  }
}

/* Teléfonos ≤ 480px: compactar logos, botones y tipografía */
@media (max-width: 480px) {
  /* Logos de esquina: reducir tamaño */
  .splash-corner-left,
  .splash-corner-right {
    height: 36px;
    top: 20px;
  }

  .splash-corner-right {
    width: 82px !important;
    height: 36px;
  }

  /* Logo principal: más pequeño */
  .splash-logo {
    max-width: 180px;
    max-height: 150px;
  }

  .splash-logo-container {
    margin-bottom: 14px;
  }

  /* Título y subtítulo */
  .splash-title {
    font-size: clamp(20px, 5vw, 28px);
    margin: 8px 0 6px;
  }

  .splash-subtitle {
    font-size: clamp(12px, 3.5vw, 15px);
    margin-bottom: 12px;
  }

  /* Botones del splash */
  .splash-button {
    min-height: 80px;
    padding: 9px 7px;
  }

  .splash-button i {
    font-size: 18px;
  }

  .splash-button span {
    font-size: 11px;
  }

  .splash-footer {
    margin-top: 16px;
    padding-top: 12px;
  }

  /* Header de secciones */
  header {
    padding: 15px 14px;
  }

  header h1 {
    font-size: 1.15rem;
  }

  /* Body y contenedor principal */
  body {
    padding: 6px;
  }

  main {
    padding: 12px 10px;
  }

  .table-section {
    padding: 12px 8px;
  }

  .filter-panel {
    padding: 14px 12px;
  }

  /* Botones de exportación: apilar verticalmente */
  .export-buttons-container {
    flex-direction: column;
    gap: 8px;
  }

  .btn-export {
    width: 100%;
    justify-content: center;
  }

  /* Paginación: más compacta */
  .btn-paginacion {
    padding: 5px 8px;
    font-size: 0.78rem;
    min-width: 30px;
  }
}

/* Landscape en teléfonos — viewport muy bajo (≤ 620px altura) */
@media (max-height: 620px) and (max-width: 900px) {
  .splash-screen {
    overflow-x: hidden;
    overflow-y: auto;
    align-items: flex-start;
  }

  .splash-content {
    padding-top: 68px;
    padding-bottom: 16px;
  }

  .splash-corner-left,
  .splash-corner-right {
    height: 30px;
    top: 16px;
  }

  .splash-corner-right {
    width: 72px !important;
    height: 30px;
  }

  .splash-logo {
    max-width: 120px;
    max-height: 100px;
  }

  .splash-logo-container {
    margin-bottom: 10px;
  }

  .splash-title {
    font-size: clamp(17px, 3vw, 24px);
    margin: 6px 0 4px;
  }

  .splash-subtitle {
    font-size: clamp(11px, 1.6vw, 14px);
    margin-bottom: 8px;
  }

  .splash-buttons {
    gap: 7px;
  }

  .splash-button {
    min-height: 68px;
    padding: 7px 6px;
  }

  .splash-button i {
    font-size: 16px;
  }

  .splash-button span {
    font-size: 10px;
  }

  .splash-footer {
    margin-top: 10px;
    padding-top: 8px;
    font-size: 11px;
  }
}
