/* Flex Denim · Stock — estética de taller de denim: índigo, algodón crudo, costura mostaza y el orillo rojo. */
@import url("https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@75..100,500..800&family=Figtree:wght@400..700&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

:root {
  --indigo-900: #0f1b33;
  --indigo-800: #152645;
  --indigo-700: #1d3560;
  --indigo-500: #2f5d93;
  --indigo-300: #8fb0d6;
  --indigo-100: #e4ecf6;
  --crudo: #f3eee5;
  --papel: #fbf8f2;
  --linea: #e2d9c8;
  --linea-fuerte: #cfc3ad;
  --texto: #1a2130;
  --suave: #677085;
  --orillo: #c63a2f;
  --orillo-suave: #fbe7e3;
  --mostaza: #d4a23a;
  --mostaza-suave: #fbf0d6;
  --verde: #2e7a58;
  --verde-suave: #e2f2ea;
  --radio: 10px;
  --sombra: 0 1px 0 rgba(15, 27, 51, .04), 0 6px 18px -12px rgba(15, 27, 51, .35);
  --fuente: "Figtree", system-ui, sans-serif;
  --titular: "Archivo", "Figtree", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--fuente); color: var(--texto); background: var(--crudo); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--indigo-500); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--titular); font-stretch: 85%; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 750; }
h3 { font-size: 15px; font-weight: 700; }
.mono { font-family: var(--mono); font-size: .92em; }
.num { font-family: var(--titular); font-stretch: 90%; font-variant-numeric: tabular-nums; font-weight: 650; }
.suave { color: var(--suave); }
.chico { font-size: 13px; }

/* ── Estructura ─────────────────────────────────────────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.lateral {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; color: #dfe7f3; padding: 22px 14px 28px;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, var(--indigo-800), var(--indigo-900));
  box-shadow: inset -3px 0 0 #f4f1ea, inset -5px 0 0 var(--orillo);  /* el orillo: blanco y rojo */
}
.marca { display: flex; align-items: baseline; gap: 8px; padding: 0 10px 18px; margin-bottom: 8px;
  border-bottom: 1.5px dashed rgba(212, 162, 58, .55); }
.marca b { font-family: var(--titular); font-stretch: 75%; font-weight: 800; font-size: 25px; letter-spacing: .02em; color: #fff; }
.marca span { font-family: var(--mono); font-size: 11.5px; color: var(--mostaza); text-transform: uppercase; letter-spacing: .12em; }
.grupo { margin: 16px 0 4px; padding: 0 10px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--indigo-300); }
.lateral a, .lateral .apagado {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: #dfe7f3; font-weight: 500;
}
.lateral a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.lateral a.activo { background: #f4f1ea; color: var(--indigo-900); font-weight: 650; }
.lateral .apagado { color: rgba(223, 231, 243, .38); cursor: default; }
.lateral .apagado small { margin-left: auto; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.icono { width: 18px; text-align: center; opacity: .9; }
.burbuja { margin-left: auto; min-width: 21px; padding: 1px 7px; border-radius: 999px; background: var(--orillo); color: #fff;
  font-family: var(--titular); font-weight: 800; font-size: 12.5px; text-align: center; }

.principal { min-width: 0; }
.barra {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 14px 32px;
  background: rgba(243, 238, 229, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--linea);
}
.barra .titulo { font-family: var(--titular); font-stretch: 85%; font-weight: 750; font-size: 17px; }
.barra .espacio { flex: 1; }
.exclamacion {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px;
  background: var(--papel); border: 1px solid var(--linea); color: var(--texto); font-weight: 650;
}
.exclamacion i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-style: normal;
  font-family: var(--titular); font-weight: 900; background: var(--linea); color: var(--suave); }
.exclamacion.hay { border-color: var(--orillo); color: var(--orillo); background: var(--orillo-suave); }
.exclamacion.hay i { background: var(--orillo); color: #fff; animation: latido 1.6s ease-in-out infinite; }
@keyframes latido { 0%, 100% { box-shadow: 0 0 0 0 rgba(198, 58, 47, .45); } 50% { box-shadow: 0 0 0 7px rgba(198, 58, 47, 0); } }
.quien { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.rol { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 2px 7px;
  border-radius: 5px; background: var(--indigo-100); color: var(--indigo-700); }
.contenido { padding: 26px 32px 60px; max-width: 1280px; }
.franja-prueba { background: repeating-linear-gradient(135deg, var(--mostaza-suave) 0 14px, #f7e6bd 14px 28px);
  color: #6b4e0f; font-size: 13px; padding: 6px 32px; border-bottom: 1px solid #ecd9a8; }

/* ── Piezas ─────────────────────────────────────────────────────────────────────────────────────────────── */
.encabezado { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.encabezado p { margin: 6px 0 0; color: var(--suave); max-width: 720px; }
.tarjeta { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); }
.tarjeta > .cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px;
  border-bottom: 1.5px dashed rgba(212, 162, 58, .45); }
.tarjeta > .cuerpo { padding: 16px 18px; }
.rejilla { display: grid; gap: 16px; }
.r2 { grid-template-columns: 1.35fr 1fr; }
.r3 { grid-template-columns: repeat(3, 1fr); }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 14px 16px; }
.kpi .v { font-family: var(--titular); font-stretch: 80%; font-weight: 800; font-size: 34px; line-height: 1.05; }
.kpi .l { font-size: 12.5px; color: var(--suave); margin-top: 4px; }
.kpi.alerta { background: var(--orillo-suave); border-color: #efb9b1; }
.kpi.alerta .v { color: var(--orillo); }
.kpi.espera .v { color: #9a6c10; }

.boton { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 8px; border: 1px solid var(--indigo-700);
  background: var(--indigo-700); color: #fff; font: 600 14px var(--fuente); cursor: pointer; text-decoration: none; }
.boton:hover { background: var(--indigo-800); text-decoration: none; }
.boton.claro { background: var(--papel); color: var(--indigo-700); border-color: var(--linea-fuerte); }
.boton.claro:hover { background: var(--indigo-100); }
.boton.rojo { background: var(--orillo); border-color: var(--orillo); }
.boton.chico { padding: 6px 11px; font-size: 13px; }
.boton[disabled] { opacity: .5; cursor: wait; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--suave);
  font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--linea-fuerte); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(228, 236, 246, .45); }
td.n, th.n { text-align: right; }
.vacio { padding: 26px; text-align: center; color: var(--suave); }

.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap;
  background: var(--indigo-100); color: var(--indigo-700); }
.chip.rojo { background: var(--orillo-suave); color: var(--orillo); }
.chip.verde { background: var(--verde-suave); color: var(--verde); }
.chip.mostaza { background: var(--mostaza-suave); color: #8a610c; }
.chip.gris { background: #ece7de; color: var(--suave); }
.etiqueta-talle { display: inline-grid; place-items: center; min-width: 42px; height: 30px; padding: 0 8px; border-radius: 6px;
  background: var(--indigo-800); color: #fff; font-family: var(--titular); font-weight: 800; font-stretch: 85%; font-size: 15px;
  box-shadow: inset 0 0 0 1.5px rgba(212, 162, 58, .55), inset 0 0 0 3px var(--indigo-800), inset 0 0 0 4px rgba(212,162,58,.35); }
.negativo { color: var(--orillo); font-weight: 750; }

form.linea { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
input[type=text], input[type=search], input[type=email], input[type=number], select, textarea {
  font: 15px var(--fuente); color: var(--texto); background: #fff; border: 1px solid var(--linea-fuerte); border-radius: 8px;
  padding: 8px 11px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--indigo-500); box-shadow: 0 0 0 3px rgba(47, 93, 147, .15); }
input[type=number] { width: 86px; text-align: right; font-family: var(--titular); font-weight: 700; font-size: 16px; }
input.cargado { background: var(--mostaza-suave); border-color: var(--mostaza); }
input.grande { border-color: var(--orillo); background: var(--orillo-suave); }
label { font-size: 13px; color: var(--suave); display: block; margin-bottom: 4px; }
.campo { margin-bottom: 14px; }

.aviso { padding: 11px 16px; border-radius: 9px; margin-bottom: 16px; font-weight: 550; border: 1px solid; }
.aviso.ok { background: var(--verde-suave); border-color: #b8dcc9; color: #1f5a40; }
.aviso.error { background: var(--orillo-suave); border-color: #efb9b1; color: #8f241c; }

/* ── El mapa ────────────────────────────────────────────────────────────────────────────────────────────── */
.mapa { display: grid; grid-template-columns: 1fr auto 1.2fr auto 1fr; align-items: center; gap: 10px; }
.nodo { border: 1px solid var(--linea-fuerte); border-radius: 9px; padding: 10px 12px; background: #fff; font-size: 13px; }
.nodo b { display: block; font-family: var(--titular); font-stretch: 85%; font-size: 14.5px; }
.nodo.central { background: var(--indigo-800); color: #fff; border: 0; text-align: center;
  box-shadow: inset 0 0 0 2px rgba(212, 162, 58, .5); }
.nodo.central b { font-size: 17px; }
.flecha { font-family: var(--mono); color: var(--mostaza); font-weight: 600; }
.estado-canal { margin-top: 6px; font-size: 12px; }

/* ── Alertas ────────────────────────────────────────────────────────────────────────────────────────────── */
.alerta-urgente { border: 1.5px solid #ecaaa1; border-left: 6px solid var(--orillo); }
.alerta-urgente .cab { background: linear-gradient(90deg, var(--orillo-suave), transparent); border-bottom-color: #ecaaa1; }
.signo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--orillo);
  color: #fff; font-family: var(--titular); font-weight: 900; font-size: 19px; flex: none; }
.pedido-opcion { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--linea); }
.pedido-opcion:last-child { border-bottom: 0; }
.pedido-opcion .datos { flex: 1; }

/* ── Venta ──────────────────────────────────────────────────────────────────────────────────────────────── */
.buscador { position: relative; }
.buscador input { width: 100%; font-size: 17px; padding: 12px 14px; }
.resultados { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--linea-fuerte);
  border-radius: 9px; box-shadow: 0 14px 30px -14px rgba(15,27,51,.4); max-height: 340px; overflow-y: auto; }
.resultados button { display: flex; width: 100%; align-items: center; gap: 12px; padding: 10px 14px; border: 0; background: none;
  font: inherit; text-align: left; cursor: pointer; border-bottom: 1px solid var(--linea); }
.resultados button:hover, .resultados button:focus { background: var(--indigo-100); outline: none; }
.resultados .stock-r { margin-left: auto; font-size: 12.5px; color: var(--suave); white-space: nowrap; }
.total-venta { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-top: 1.5px dashed rgba(212,162,58,.45); }

.pasos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.paso { padding: 14px; border-radius: 9px; border: 1px dashed var(--linea-fuerte); }
.paso.ahora { border: 1.5px solid var(--indigo-500); background: var(--indigo-100); }
.paso .nro { font-family: var(--titular); font-weight: 800; font-size: 13px; color: var(--mostaza); letter-spacing: .1em; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 2px, transparent 2px 6px), linear-gradient(160deg, var(--indigo-700), var(--indigo-900)); }
.login .tarjeta { width: min(420px, 100%); padding: 30px; }
.login .marca { border-color: rgba(212,162,58,.5); padding: 0 0 16px; margin-bottom: 18px; }
.login .marca b { color: var(--indigo-900); }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .r2, .r3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: static; height: auto; }
  .contenido, .barra { padding-left: 16px; padding-right: 16px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .mapa { grid-template-columns: 1fr; }
  .flecha { transform: rotate(90deg); justify-self: center; }
  .tabla-scroll { overflow-x: auto; }
}

/* ── Utilidades (la CSP no deja estilos en línea) ───────────────────────────────────────────────────────── */
.mt { margin-top: 16px; } .mt2 { margin-top: 26px; } .mb { margin-bottom: 16px; } .m0 { margin: 0; }
.flex { display: flex; align-items: center; gap: 10px; } .entre { justify-content: space-between; } .envolver { flex-wrap: wrap; }
.der { text-align: right; } .centro { text-align: center; } .ancho { width: 100%; } .oculto { display: none !important; }
.sin-borde td { border-bottom: 0; } .sin-relleno { padding: 0; } .negrita { font-weight: 700; }

/* ── Venta: panel de talles (SKU madre → cantidad por talle) ────────────────────────────────────────────── */
.panel-talles { margin-top: 16px; padding: 16px; border: 1.5px solid var(--indigo-300); border-radius: var(--radio);
  background: linear-gradient(180deg, var(--indigo-100), var(--papel) 90px); }
/* Una sola columna, del talle más chico arriba al más grande abajo, compacta: talle → cantidad → stock (23/11). */
.talles-grid { display: grid; grid-template-columns: 1fr; gap: 4px; max-width: 440px; }
.talle-fila { display: flex; align-items: center; gap: 12px; padding: 5px 10px 5px 6px; border: 1px solid var(--linea);
  border-radius: 7px; background: #fff; transition: background .15s, border-color .15s; }
.talle-fila .etiqueta-talle { min-width: 46px; height: 30px; }
.talle-fila .info { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.talle-fila.con-cantidad { border-color: var(--mostaza); background: var(--mostaza-suave); }
.talle-fila.sin-stock { opacity: .5; }
.contador { display: flex; align-items: center; gap: 4px; }
.contador button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--indigo-800); color: #fff;
  font: 800 16px var(--titular); cursor: pointer; display: grid; place-items: center; }
.contador button:hover { background: var(--indigo-500); }
.contador button:disabled { background: var(--linea-fuerte); cursor: not-allowed; }
.contador input[type=number] { width: 48px; height: 30px; padding: 2px 4px; text-align: center; -moz-appearance: textfield; }
.contador input::-webkit-outer-spin-button, .contador input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.grupo-res { padding: 7px 14px 4px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--suave);
  background: var(--crudo); border-bottom: 1px solid var(--linea); }
.etiqueta-talle.modelo { background: var(--mostaza); color: var(--indigo-900); box-shadow: none; }
.panel-talles > .flex.mt { max-width: 440px; }   /* botones alineados con la lista de talles */
