:root {
  --azul: #2563eb;
  --azul-oscuro: #1d4ed8;
  --verde: #16a34a;
  --rojo: #dc2626;
  --gris-fondo: #f3f4f6;
  --gris-borde: #d1d5db;
  --texto: #111827;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--gris-fondo);
  color: var(--texto);
  margin: 0;
  padding-bottom: 3rem;
}

.contenedor {
  max-width: 880px;
  margin: 0 auto;
  padding: 1rem;
}

nav.principal {
  background: white;
  border-bottom: 1px solid var(--gris-borde);
  position: sticky;
  top: 0;
  z-index: 10;
}

nav.principal .barra {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  padding: 0.75rem 1rem;
}

nav.principal a {
  text-decoration: none;
  color: var(--texto);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
}

nav.principal a.marca {
  color: var(--azul);
  margin-right: auto;
}

nav.principal a:hover { background: var(--gris-fondo); }

.tarjeta {
  background: white;
  border: 1px solid var(--gris-borde);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

h1 { font-size: 1.4rem; }
h2 { font-size: 1.15rem; }

.boton {
  display: inline-block;
  background: var(--azul);
  color: white;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.boton:hover { background: var(--azul-oscuro); }
.boton.secundario { background: white; color: var(--azul); border: 1px solid var(--azul); }
.boton.peligro { background: var(--rojo); }
.boton.grande { width: 100%; padding: 1rem; font-size: 1.1rem; text-align: center; }

.grupo-campo { margin-bottom: 0.9rem; }
.grupo-campo label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.9rem; }
.grupo-campo input, .grupo-campo select {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--gris-borde);
  border-radius: 6px;
  font-size: 1rem;
}

table { width: 100%; border-collapse: collapse; }
table th, table td {
  text-align: left;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--gris-borde);
  font-size: 0.92rem;
}
table th { color: #6b7280; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }

.tabla-scroll { overflow-x: auto; }

.opciones-nueva { display: flex; gap: 1rem; flex-wrap: wrap; }
.opciones-nueva a {
  flex: 1;
  min-width: 220px;
  text-align: center;
  padding: 1.5rem;
  border: 2px dashed var(--azul);
  border-radius: 10px;
  text-decoration: none;
  color: var(--azul);
  font-weight: 700;
  font-size: 1.05rem;
  background: white;
}

.renglon-producto {
  border: 1px solid var(--gris-borde);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.5rem;
}
.renglon-producto label { font-size: 0.75rem; color: #6b7280; }

.error { color: var(--rojo); font-weight: 600; margin-bottom: 0.8rem; }
.ayuda { color: #6b7280; font-size: 0.85rem; margin-top: 0.25rem; }

.chip { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.chip.bloqueado { background: #fee2e2; color: var(--rojo); }
.chip.activo { background: #dcfce7; color: var(--verde); }

.barra-horizontal { background: var(--gris-fondo); border-radius: 6px; overflow: hidden; height: 1.4rem; margin: 0.25rem 0; }
.barra-horizontal > div { background: var(--azul); height: 100%; }

.fila-stat { display: flex; gap: 1rem; flex-wrap: wrap; }
.fila-stat .tarjeta { flex: 1; min-width: 150px; text-align: center; }
.fila-stat .valor { font-size: 1.6rem; font-weight: 800; color: var(--azul); }
.fila-stat .etiqueta { color: #6b7280; font-size: 0.85rem; }
