:root {
  --fondo: #f6f7f9;
  --tarjeta: #ffffff;
  --texto: #1f2933;
  --suave: #5f6b7a;
  --borde: #dde2e8;
  --ok: #15803d;
  --ok-fondo: #e7f6ec;
  --mal: #b42318;
  --mal-fondo: #fdecea;
  --sin: #5f6b7a;
  --sin-fondo: #eef0f3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #111418;
    --tarjeta: #1a1f25;
    --texto: #e6e9ed;
    --suave: #9aa5b1;
    --borde: #2c333b;
    --ok: #4ade80;
    --ok-fondo: #12301f;
    --mal: #f87171;
    --mal-fondo: #3a1715;
    --sin: #9aa5b1;
    --sin-fondo: #232a31;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
}

.cliente {
  margin: 0;
  color: var(--suave);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

h1 {
  margin: 0.15rem 0 1rem;
  font-size: 1.6rem;
  line-height: 1.2;
}

.resumen {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  font-weight: 600;
}

.productos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.producto {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0.9rem 1rem;
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: 0.75rem;
}

.producto .nombre {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.producto .detalle {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.estado {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.estado::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: currentColor;
}

.desde {
  color: var(--suave);
  font-size: 0.85rem;
}

.ok {
  color: var(--ok);
  background: var(--ok-fondo);
}

.mal {
  color: var(--mal);
  background: var(--mal-fondo);
}

.sin-datos {
  color: var(--sin);
  background: var(--sin-fondo);
}

footer {
  margin-top: 1.5rem;
  color: var(--suave);
  font-size: 0.85rem;
}

footer p {
  margin: 0 0 0.5rem;
}

.noscript {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (max-width: 26rem) {
  .producto .detalle {
    align-items: flex-start;
    text-align: left;
    width: 100%;
  }
}
