body {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
#preview {
  width: 390px;
  height: 260px;
  background-color: #000;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: block;
  object-fit: cover;
}

/* Responsive para móviles */
@media (max-width: 768px) {
  #preview {
    width: 100%;
    max-width: 350px;
    height: 230px;
  }
}
/* Scanner visuals */
.scanner-container {
  position: relative;
  display: inline-block;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.scanner-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.scanner-overlay .corner {
  position: absolute;
  width: 36px;
  height: 36px;
  box-sizing: border-box;
}
.scanner-overlay .corner::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}
.scanner-overlay .corner.top-left::after {
  border-top: 4px solid rgba(102,126,234,0.95);
  border-left: 4px solid rgba(102,126,234,0.95);
}
.scanner-overlay .corner.top-right::after {
  border-top: 4px solid rgba(102,126,234,0.95);
  border-right: 4px solid rgba(102,126,234,0.95);
}
.scanner-overlay .corner.bottom-left::after {
  border-bottom: 4px solid rgba(102,126,234,0.95);
  border-left: 4px solid rgba(102,126,234,0.95);
}
.scanner-overlay .corner.bottom-right::after {
  border-bottom: 4px solid rgba(102,126,234,0.95);
  border-right: 4px solid rgba(102,126,234,0.95);
}
.scanner-overlay .corner.top-left { top: 16px; left: 16px; transform: translate(0,0); }
.scanner-overlay .corner.top-right { top: 16px; right: 16px; transform: translate(0,0); }
.scanner-overlay .corner.bottom-left { bottom: 16px; left: 16px; transform: translate(0,0); }
.scanner-overlay .corner.bottom-right { bottom: 16px; right: 16px; transform: translate(0,0); }
.scanline {
  position: absolute;
  left: 20px;
  right: 20px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #28a745, transparent);
  z-index: 4;
  animation: scanLine 1.8s infinite linear;
  opacity: 0.85;
  transform-origin: center;
}
.scanner-container:not(.scanning) .scanline { animation-play-state: paused; opacity: 0; }
.scanner-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 8px;
  z-index: 4;
  background: rgba(0,0,0,0.5);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  pointer-events: none;
}
.scanner-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  color: #fff;
  background: rgba(0,0,0,0.6);
  font-size: 16px;
  border-radius: 15px;
}
.scanner-container.scanning { box-shadow: 0 12px 48px rgba(102, 126, 234, 0.35); }
#fecha {
  font-size: 30px;
  font-weight: bold;
  text-align: center;
  color: #242758;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
  #fecha {
    font-size: 20px;
    padding: 15px;
  }
  #fecha h4 {
    font-size: 18px !important;
  }
  #fecha p {
    font-size: 14px !important;
  }
}
#time {
  display: flex;
  background: linear-gradient(45deg, #ea6666 0%, #a24b59 100%);
  color: #fff;
  justify-content: center;
  align-items: center;
  font-size: 70px;
  font-family: 'Oswald', sans-serif;
  border-radius: 15px;
  height: 120px;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
  transition: transform 0.3s ease;
}

@media (max-width: 768px) {
  #time {
    font-size: 45px;
    height: 100px;
  }
}

@media (max-width: 480px) {
  #time {
    font-size: 35px;
    height: 80px;
  }
}
#time:hover {
  transform: scale(1.02);
}
.row {
  align-items: center;
}
.table-responsive {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  padding: 20px;
}
.table {
  border-radius: 10px;
  overflow: hidden;
}
.btn-outline-success {
  border-radius: 25px;
  transition: all 0.3s ease;
}
.btn-outline-success:hover {
  background-color: #28a745;
  border-color: #28a745;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}
.form-control {
  border-radius: 25px;
  border: 2px solid #ddd;
  transition: border-color 0.3s ease;
}
.form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}
.toast {
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
@keyframes scanLine {
  0% { top: 20px; }
  100% { top: calc(100% - 20px); }
}

/* Responsive general para móviles */
@media (max-width: 768px) {
  .container-fluid {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  .scanner-container {
    margin: 0 auto;
  }
  
  .card-body {
    padding: 10px;
  }
  
  .table {
    font-size: 14px;
  }
  
  .table th,
  .table td {
    padding: 8px 4px;
  }
  
  .badge {
    font-size: 11px;
    padding: 4px 8px;
  }
}

@media (max-width: 480px) {
  .table {
    font-size: 12px;
  }
  
  .table th,
  .table td {
    padding: 6px 2px;
  }
  
  .card-header h5 {
    font-size: 16px;
  }
  
  .form-control {
    font-size: 14px;
  }
  
  .btn {
    font-size: 14px;
    padding: 8px 16px;
  }
}