* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
  background: radial-gradient(circle at top left, #eef4ff, #f5f5f5);
  color: #202124;
  font-family: 'Ubuntu', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

h1 {
  text-align: center;
  margin-bottom: 24px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #003366;
}

.card {
  background: #ffffff;
  border-radius: 14px;
  padding: 18px 20px 20px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}

.logo-card {
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: linear-gradient(135deg, #f1f5ff, #ffffff);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.15);
}

.logo-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.logo-preview-wrapper {
  min-width: 220px;
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
}

#logoPreview {
  max-width: 200px;
  max-height: 80px;
  object-fit: contain;
  display: block;
  margin-top: 6px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.align-bottom {
  align-self: flex-end;
}

label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  padding: 7px 12px;
  font-size: 13px;
  outline: none;
  background: #f8fafc;
  transition: all 0.15s ease-in-out;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #ffffff;
}

input[type="file"] {
  font-size: 13px;
}

hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 16px 0;
}

.small-note {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}

.warning {
  font-size: 11px;
  color: #b91c1c;
  margin-top: 6px;
}

.btn {
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease-in-out;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
}

.btn.primary {
  background: linear-gradient(135deg, #0f4c81, #2563eb);
  color: #ffffff;
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.3);
}

.btn.ghost {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  box-shadow: none;
}

.btn.ghost:hover {
  background: #f1f5f9;
}

.btn.ghost.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.card-generate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.card-generate .actions {
  flex-shrink: 0;
}

.discount-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .card-generate {
    flex-direction: column;
    align-items: flex-start;
  }
}


.standalone-ac {
  margin-top: 12px;
}

.standalone-ac h3 {
  margin-top: 4px;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

/* --- Sistema de incendios radio style --- */

.fire-toggle {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 5px;
}

.toggle-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 6px;
  font-size: 14px;
  color: #0f172a;
  user-select: none;
}

.toggle-option input[type="radio"] {
  display: none;
}

.toggle-option .dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid #0f172a;
  display: inline-block;
  box-sizing: border-box;
  transition: 0.2s;
}

.toggle-option input[type="radio"]:checked + .dot {
  background-color: #0f172a;
}


/* --- Botón para seleccionar archivo Excel --- */
.btn-upload {
  display: inline-block;
  background-color: #0f172a;
  color: white;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: 0.2s;
  user-select: none;
}

.btn-upload:hover {
  background-color: #1e293b;
}

.file-name {
  margin-left: 12px;
  font-size: 13px;
  color: #64748b;
  font-style: italic;
}

/* --- Botón secundario: Cargar Excel por defecto --- */

.btn-secondary {
  background-color: #e2e8f0;
  color: #0f172a;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  margin-top: 10px;
  display: inline-block;
  transition: 0.2s;
}

.btn-secondary:hover {
  background-color: #cbd5e1;
}

.btn-generate {
  background-color: #1d4ed8;
  color: white;
  padding: 12px 26px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  border: none;
  font-weight: 600;
  transition: 0.2s;
}

.btn-generate:hover {
  background-color: #1e40af;
}

/* --- Botones estilo PDF para Excel --- */
.btn-excel {
  background-color: #1d4ed8;   /* igual al btn-generate */
  color: white;
  padding: 12px 26px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  border: none;
  font-weight: 600;
  transition: 0.2s;
  display: inline-block;
  margin-top: 8px;
}

.btn-excel:hover {
  background-color: #1e40af;   /* igual al hover del PDF */
}

.file-name {
  margin-left: 12px;
  font-size: 13px;
  color: #64748b;
  font-style: italic;
}


/* --- Logo superior --- */

.header-logo {
  text-align: center;
  margin-bottom: 10px;
}

.header-logo img {
  width: 220px;      /* Ajusta el tamaño como quieras */
  height: auto;
  display: inline-block;
}

/* Ocultar la vista previa del logo usada solo para el PDF */
.logo-preview-wrapper {
  display: none !important;
}

/* --- Estilo para campos con error --- */
.input-error {
  border: 1px solid #dc2626 !important;
  box-shadow: 0 0 0 1px rgba(220,38,38,0.5);
  animation: shake 0.2s ease-in-out 0s 3;
}

/* Animación tipo "temblor" suave */
@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}


/* --- Stepper para Cantidad de sistemas MDC --- */

.stepper-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Ocultamos el range, pero sigue siendo el valor real */
.stepper-input input[type="range"] {
  display: none;
}

/* Caja principal del stepper */
.stepper-input .custom-input {
  width: 140px;
  height: 36px;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  gap: 8px;
}

/* Botones + y - */
.stepper-input .custom-input button {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  outline: none;
  background: #e2e8f0;
  color: #1d4ed8;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper-input .custom-input button:hover {
  background: #cbd5e1;
}

.stepper-input .custom-input button:active {
  background: #94a3b8;
  transform: scale(0.95);
}

/* Ventana donde se ven los números */
.stepper-input .custom-input .numbers {
  width: 40px;
  height: 28px;
  overflow: hidden;
  position: relative;
}

/* Pila vertical de números */
.stepper-input .custom-input .numbers div {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  transition: transform 220ms ease-in-out;
}

/* Cada número */
.stepper-input .custom-input .numbers div span {
  display: block;
  width: 40px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  font-size: 16px;
  color: #0f172a;
  transform: scale(0.7);
  transition: color 220ms ease-in-out, transform 220ms ease-in-out;
  align-items: center;       /* Centrado vertical perfecto */
  justify-content: center;   /* Centrado horizontal */
}

/* Número activo */
.stepper-input .custom-input .numbers div span.active {
  
  transform: scale(1);
}

.custom-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

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

.modal-content {
  background: white;
  padding: 20px 26px;
  border-radius: 12px;
  width: 360px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  text-align: center;
  font-size: 14px;
}

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

.category-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}


/* =========================
   UPS / Accesorios / Baterías - filas alineadas
   ========================= */
.extras-row{
  display: flex;
  align-items: center;  /* 👈 CLAVE */
  gap: 12px;
}


/* Modelo (más ancho y legible) */
.extras-row select{
  flex: 1;
  min-width: 320px; /* súbelo a 360px si aún no se lee */
}

/* Cantidad */
.extras-row input[type="number"]{
  width: 90px;
  text-align: center;
}

/* Eliminar */
.extras-row .extras-delete{
  width: 44px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.extras-header{
  display: flex;
  align-items: center;   /* 👈 CLAVE */
  gap: 12px;
}

/* Contenedor de filas UPS / Acc / Bat */
#upsList,
#accList,
#batList{
  margin-top: 4px;   /* 👈 ajuste fino */
}

.hidden { display: none !important; }

.memoria-box {
  margin-top: 12px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: linear-gradient(135deg, #f7fbff, #ffffff);
  border-radius: 14px;
  padding: 14px 16px;
}





/* --- V5: Botón Generar+Enviar --- */
.card-generate .actions{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
}
