:root {
  --naranja: #ff9800;
  --azul: #0f3a6d;
  --azul-claro: #1976d2;
  --verde: #4caf50;
  --gris-claro: #f4f7fb;
  --texto: #333;
  --card-radius: 18px;
  --sombra: 0 10px 25px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #e3f2fd, #fffde7);
  color: var(--texto);
}

.app-container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 16px;
}

.header {
  text-align: center;
  margin-bottom: 24px;
  border-top: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  padding: 12px 0;
}

.header h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  color: var(--azul);
}

.header p {
  margin-top: 8px;
  color: #666;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.card {
  background: #ffffff;
  border-radius: var(--card-radius);
  box-shadow: var(--sombra);
  padding: 20px 22px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

.chip-cliente {
  background: var(--verde);
}

.form-group {
  margin-bottom: 10px;
}

label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: #555;
}

input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #d0d7e2;
  font-size: 14px;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
  background-color: #fbfcff;
}

input:focus {
  border-color: var(--azul-claro);
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

/* Botones genéricos */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.2s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--azul-claro), var(--naranja));
  color: #fff;
}

/* Botón consultar más pequeño y centrado */
#btn-consultar {
  display: block;
  margin: 0 auto 8px;
  padding: 7px 16px;
  font-size: 13px;
  min-width: 220px;
}

/* BOTÓN "YA RECIBÍ MI PEDIDO" (azul) */
.btn-recibido {
  background: linear-gradient(135deg, #1565c0, #1e88e5);
  color: #fff;
  border: none;
  padding: 6px 14px;
  font-size: 13px;
}

/* Estados / mensajitos */
.small-text {
  font-size: 12px;
  color: #888;
}

.resultado {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #e0e4ec;
}

.mensaje {
  margin-top: 4px;
  font-size: 13px;
}

.mensaje.ok {
  color: var(--verde);
}

.mensaje.error {
  color: #d32f2f;
}

/* Timeline de estados (barra de 6 pasos) */
.timeline-wrapper {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #e0e4ec;
}

.timeline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-bottom: 10px;
}

.timeline-bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  background: #e0e4ec;
  border-radius: 999px;
}

.timeline-step {
  position: relative;
  flex: 1;
  text-align: center;
  z-index: 1;
}

.timeline-step .segment {
  height: 8px;
  margin: 0 3px;
  border-radius: 999px;
  background: transparent;
}

.timeline-step.done .segment {
  background: var(--azul);
}

.timeline-step.active .segment {
  background: linear-gradient(90deg, var(--azul-claro), var(--naranja));
}

.timeline-step .circle-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--azul-claro);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px auto 4px;
  font-size: 18px;
  color: var(--azul-claro);
}

.timeline-step.done .circle-icon {
  background: var(--azul-claro);
  color: #fff;
}

.timeline-step.inactive .circle-icon {
  border-color: #ddd;
  color: #bbb;
}

.timeline-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-label span.estado {
  display: block;
  font-weight: 600;
  color: var(--azul);
}

.timeline-label span.fecha {
  display: block;
  margin-top: 2px;
  color: var(--azul-claro);
}

/* Tarjeta envío en vista cliente */
.envio-item {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f9fbff;
  border: 1px solid #e0e4ec;
}

.envio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.envio-title {
  font-size: 14px;
  font-weight: 600;
}

.tag-destino {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 152, 0, 0.1);
  color: var(--naranja);
}

.envio-extra {
  font-size: 12px;
  color: #777;
}

.envio-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

@media (max-width: 768px) {
  .timeline-bar {
    flex-direction: column;
  }
  .timeline-bar::before {
    display: none;
  }
  .timeline-step {
    width: 100%;
    margin-bottom: 4px;
  }
}
