/*
 * Estilos del panel de la red.
 *
 * Mismos tokens que el sitio generado (docs/04-DISENO.md): un solo verde, que es
 * color de acción y de superficie, nunca de texto. Si hace falta un verde más
 * claro o más oscuro para algo, ese algo no lleva verde.
 *
 * Sin tipografía remota: el panel se abre en el celular de quien está entregando
 * un pedido, y una fuente que tarda en llegar es un formulario que salta.
 */

:root {
  --verde: #80BA26;
  --oro: #C9A227;
  --rojo: #B3261E;
  --tinta: #1A1A1A;
  --tinta-suave: #575757;
  --papel: #FBFAF6;
  --papel-suave: #F4F4F2;
  --gris-pie: #2B2B2B;
  --linea: rgb(0 0 0 / 14%);
  --radio: 10px;
  --transicion: 200ms cubic-bezier(.4, 0, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font: 400 16px/1.6 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 900; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }

.envoltorio { width: min(100% - 2rem, 68rem); margin-inline: auto; }
.oculto { display: none !important; }

/* ── Cabecera ─────────────────────────────────────────────────────────────── */

.cabecera {
  background: var(--gris-pie);
  color: var(--papel);
  padding: 1.1rem 0;
  margin-bottom: 1.75rem;
}
.cabecera__fila {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.cabecera__lema { color: #C7C7C2; margin: 0; font-size: .9rem; }

.sesion { display: flex; align-items: center; gap: .75rem; }
.sesion__quien { font-size: .88rem; color: #E4E4E1; }
.sesion .boton--fantasma { border-color: rgb(255 255 255 / 35%); color: var(--papel); }
.sesion .boton--fantasma:hover { background: var(--papel); color: var(--tinta); }

/* ── Pestañas ─────────────────────────────────────────────────────────────── */

.pestanas {
  display: flex;
  gap: .35rem;
  border-bottom: 1px solid var(--linea);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.pestana {
  font: inherit;
  font-weight: 700;
  font-size: .9rem;
  padding: .6rem 1rem;
  min-height: 2.75rem;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--tinta-suave);
  cursor: pointer;
  white-space: nowrap;
}
.pestana--activa { color: var(--tinta); border-bottom-color: var(--verde); }

/* ── Tarjetas y formulario ────────────────────────────────────────────────── */

.tarjeta {
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  background: #fff;
  padding: 1.35rem;
  margin-bottom: 1.5rem;
}
.tarjeta--entrar { max-width: 26rem; margin-inline: auto; margin-top: 2rem; }

fieldset {
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  background: #fff;
  padding: 1.15rem 1.3rem 1.4rem;
  margin: 0 0 1.25rem;
}
legend {
  font-weight: 900;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--tinta-suave);
  padding: 0 .4rem;
}

.campo { margin-bottom: 1rem; }
.campo:last-child { margin-bottom: 0; }
.campos { display: grid; gap: 1rem; }
@media (min-width: 34rem) { .campos.dos { grid-template-columns: 1fr 1fr; } }

label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: .3rem; }
.obligatorio { color: var(--rojo); }
.ayuda { font-weight: 400; color: var(--tinta-suave); font-size: .82rem; }

input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=file], textarea, select {
  width: 100%;
  font: inherit;
  padding: .6rem .75rem;
  border: 1.5px solid var(--linea);
  border-radius: 8px;
  background: var(--papel);
  color: inherit;
  transition: border-color var(--transicion);
}
input:focus-visible, textarea:focus-visible, select:focus-visible,
button:focus-visible, .chip:focus-within {
  outline: 3px solid var(--oro);
  outline-offset: 2px;
}
input:hover, textarea:hover { border-color: var(--verde); }
textarea { resize: vertical; min-height: 5rem; }

.error { display: none; color: var(--rojo); font-size: .82rem; font-weight: 700; margin: .3rem 0 0; }
.campo--invalido input, .campo--invalido textarea { border-color: var(--rojo); }
.campo--invalido .error { display: block; }

/* Un rechazo de la guardia no es un error de formulario: se pinta distinto porque
   lo que hay que hacer es reescribir la frase, no llenar un hueco. */
.campo--copy input, .campo--copy textarea { border-color: var(--oro); }
.campo--copy .error { display: block; color: #7A5F00; }

.miniatura {
  display: block;
  margin-top: .6rem;
  width: 8rem;
  height: 8rem;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--linea);
}

/* ── Chips ────────────────────────────────────────────────────────────────── */

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 2.5rem;
  padding: .35rem .85rem;
  border: 1.5px solid var(--linea);
  border-radius: 999px;
  background: var(--papel);
  font-size: .88rem;
  cursor: pointer;
}
.chip:hover { border-color: var(--verde); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { background: var(--verde); border-color: var(--verde); font-weight: 700; }
.chip__precio { color: var(--tinta-suave); font-size: .8rem; }
.chip:has(input:checked) .chip__precio { color: var(--tinta); }

.acciones-lista { display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }

/* ── Listas editables ─────────────────────────────────────────────────────── */

.lista { display: grid; gap: .6rem; margin-bottom: .75rem; }
.fila { display: flex; gap: .5rem; align-items: start; }
.fila input { flex: 1; }

.caja {
  border: 1px solid var(--linea);
  border-radius: 8px;
  padding: .85rem;
  background: var(--papel);
  display: grid;
  gap: .6rem;
}

.experiencias { display: grid; gap: .6rem; }
.experiencia {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid var(--linea);
  border-radius: 8px;
  padding: .6rem .75rem;
  background: var(--papel);
}
.experiencia .chip { margin: 0; }
.experiencia input[type=file] { flex: 1 1 14rem; font-size: .8rem; }

/* ── Botones ──────────────────────────────────────────────────────────────── */

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 2.75rem;
  padding: .5rem 1.25rem;
  font: inherit;
  font-weight: 700;
  font-size: .9rem;
  border-radius: 999px;
  border: 1.5px solid var(--verde);
  background: var(--verde);
  color: var(--tinta);
  cursor: pointer;
  transition: box-shadow var(--transicion), background-color var(--transicion),
    border-color var(--transicion), color var(--transicion);
}
/* El hover no aclara el verde: aclararlo sería un segundo verde en la paleta. */
.boton:hover { box-shadow: 0 2px 10px rgb(0 0 0 / 18%); }
.boton--fantasma { background: transparent; border-color: var(--linea); }
.boton--fantasma:hover { background: var(--tinta); border-color: var(--tinta); color: var(--papel); }
.boton--chico { min-height: 2.25rem; padding: .3rem .8rem; font-size: .82rem; }
.boton[disabled] { opacity: .45; cursor: not-allowed; }

/* ── Avisos ───────────────────────────────────────────────────────────────── */

.aviso {
  border-radius: 8px;
  padding: .8rem .9rem;
  font-size: .88rem;
  margin-bottom: 1rem;
}
.aviso--error { background: rgb(179 38 30 / 8%); border: 1px solid rgb(179 38 30 / 35%); }
.aviso--ok { background: rgb(128 186 38 / 12%); border: 1px solid rgb(128 186 38 / 40%); }
.aviso--cofepris { background: rgb(201 162 39 / 12%); border: 1px solid rgb(201 162 39 / 45%); }
.aviso ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.aviso li { margin-bottom: .3rem; }
.aviso strong { font-weight: 900; }

/* ── Barra de guardado ────────────────────────────────────────────────────── */

.barra-ficha {
  display: flex;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.barra-ficha__acciones { display: flex; align-items: center; gap: .75rem; }
.campo--enlinea { margin: 0; min-width: 16rem; }
.estado { font-size: .84rem; color: var(--tinta-suave); }

/* ── Vista previa ─────────────────────────────────────────────────────────── */

.vista-previa {
  width: 100%;
  height: min(70vh, 44rem);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  background: #fff;
}

/* ── Bandeja ──────────────────────────────────────────────────────────────── */

.tabla-envoltorio { overflow-x: auto; margin-bottom: 1.75rem; }
.tabla {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: var(--radio);
}
.tabla th, .tabla td {
  text-align: left;
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--linea);
  font-size: .9rem;
  vertical-align: middle;
}
.tabla th { font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--tinta-suave); }
.tabla tr:last-child td { border-bottom: 0; }
.tabla td .acciones-lista { margin-top: 0; }

.sello {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  border: 1.5px solid var(--linea);
}
.sello--activa { border-color: var(--verde); background: var(--verde); }
.sello--pausada { border-color: var(--oro); background: rgb(201 162 39 / 18%); }
.sello--baja { border-color: var(--linea); background: var(--papel-suave); color: var(--tinta-suave); }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 1ms !important; }
}
