/* Portal de compras — La Fabrik. Misma base visual que el portal OP: azul noche y dorado del logo, fondo claro para el celular. */
:root {
  --azul: #12203a;
  --azul-2: #1d3157;
  --oro: #b8913a;
  --oro-claro: #f4ead2;
  --fondo: #f5f4f0;
  --tarjeta: #ffffff;
  --texto: #1b1f27;
  --sutil: #5d6573;
  --borde: #dedbd2;
  --verde: #2f7a4d;   --verde-f: #e3f2e8;
  --ambar: #9a6a00;   --ambar-f: #fff3cf;
  --rojo: #b3261e;    --rojo-f: #fbe6e4;
  --azul-f: #e6ecf7;
  --gris-f: #ecebe7;
  --radio: 10px;
  --sombra: 0 1px 2px rgba(18, 32, 58, .06), 0 2px 8px rgba(18, 32, 58, .05);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
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, sans-serif;
}
a { color: var(--azul-2); }
h1 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 .25rem; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--sutil); margin: .75rem 0 .35rem; }
code { background: var(--gris-f); padding: .05rem .35rem; border-radius: 4px; font-size: .92em; }
code.grande { font-size: 1.2rem; padding: .2rem .6rem; letter-spacing: .04em; }
small { color: var(--sutil); font-size: .82rem; }
.sutil { color: var(--sutil); margin: 0; }
.req { color: var(--rojo); }
.pre { white-space: pre-wrap; margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.inline { display: inline; }

/* Navegación */
.nav {
  background: var(--azul); color: #fff; display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; padding: .55rem 16px; position: sticky; top: 0; z-index: 5; flex-wrap: wrap;
}
.nav a, .nav .link { color: #e8e3d6; text-decoration: none; font-size: .95rem; }
.nav a:hover, .nav .link:hover { color: #fff; }
.marca { display: flex; align-items: center; gap: .55rem; font-weight: 600; }
.marca img { border-radius: 6px; }
.marca span { color: var(--oro); letter-spacing: .02em; }
.nav-links { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
@media (max-width: 560px) {
  .nav { position: static; flex-wrap: nowrap; padding: .45rem 12px; }
  .marca span { display: none; }
  .nav-links { gap: .7rem; flex-wrap: nowrap; }
  .nav a, .nav .link { font-size: .85rem; }
  .nav .btn-sm { padding: .25rem .6rem; min-height: 34px; }
}
@media (max-width: 380px) { .nav-cuenta { display: none; } }

.contenedor { max-width: 1080px; margin: 0 auto; padding: 1.25rem 16px 4rem; }
.cabecera { margin-bottom: 1rem; }
.fila-entre { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.volver { display: inline-block; margin-bottom: .5rem; text-decoration: none; color: var(--sutil); }

/* Tarjetas y formularios */
.tarjeta {
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 1rem 1.1rem; margin: 0 0 1rem; box-shadow: var(--sombra); min-width: 0;
}
fieldset.tarjeta { margin-bottom: 1rem; }
legend { font-weight: 700; padding: 0 .35rem; margin-left: -.35rem; color: var(--azul); }
label { display: block; font-weight: 600; font-size: .93rem; margin-bottom: .85rem; }
label > input, label > select, label > textarea { display: block; margin-top: .3rem; }
label small { font-weight: 400; }
label > input + small, label > select + small, label > textarea + small { display: block; margin-top: .3rem; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--texto); background: #fff; width: 100%;
  border: 1px solid #c9c5ba; border-radius: 8px; padding: .62rem .7rem; min-height: 44px;
}
textarea { resize: vertical; }
input[type="file"] { padding: .5rem; background: var(--fondo); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--oro); outline-offset: 1px; border-color: var(--oro); }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; }
.check input { width: 1.2rem; height: 1.2rem; min-height: 0; accent-color: var(--azul); flex: none; }
.fila2 { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .fila2 { grid-template-columns: 1fr 1fr; } }
.pila { display: grid; gap: .25rem; }
.pila label { margin-bottom: .6rem; }

.opciones { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .9rem; }
.opcion {
  display: flex; align-items: center; gap: .45rem; margin: 0; font-weight: 500; cursor: pointer;
  border: 1px solid #c9c5ba; border-radius: 999px; padding: .45rem .9rem; background: #fff; min-height: 44px;
}
.opcion input { width: auto; min-height: 0; accent-color: var(--azul); }
.opcion:has(input:checked) { border-color: var(--azul); background: var(--azul-f); }

.estimado { margin: 0; font-weight: 600; padding: .55rem .75rem; border-radius: 8px; }
.estimado:empty { display: none; }
.estimado-ok { background: var(--verde-f); color: var(--verde); }
.estimado-justo { background: var(--ambar-f); color: var(--ambar); }
.estimado-vencido { background: var(--rojo-f); color: var(--rojo); }

.acciones-form { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; min-height: 44px;
  padding: .55rem 1.05rem; border-radius: 8px; border: 1px solid #c9c5ba; background: #fff; color: var(--texto);
}
.btn:hover { border-color: var(--azul-2); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primario { background: var(--azul); border-color: var(--azul); color: #fff; }
.btn-primario:hover { background: var(--azul-2); }
.btn-oro { background: var(--oro); border-color: var(--oro); color: #fff !important; }
.btn-peligro { color: var(--rojo); border-color: #e3b6b2; }
.btn-fantasma { background: transparent; }
.btn-sm { min-height: 36px; padding: .3rem .8rem; font-size: .9rem; }
.btn-grande { padding: .75rem 1.6rem; font-size: 1.05rem; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--azul-2); cursor: pointer; text-decoration: underline; }

/* Avisos */
.aviso { border-radius: var(--radio); padding: .8rem 1rem; margin-bottom: 1rem; border: 1px solid; }
.aviso p { margin: .35rem 0 0; }
.aviso ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.aviso-ok { background: var(--verde-f); border-color: #b9dcc6; color: #1f5435; }
.aviso-error { background: var(--rojo-f); border-color: #efc1bc; color: #7d1a14; }
.aviso-datos { background: var(--ambar-f); border-color: #ecd58e; color: #5c4100; }

/* Chips y plazos */
.chip { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; }
.chip-cola { background: var(--azul-f); color: var(--azul-2); }
.chip-datos { background: var(--ambar-f); color: var(--ambar); }
.chip-emitida { background: var(--oro-claro); color: #7a5a14; }
.chip-entregada { background: var(--verde-f); color: var(--verde); }
.chip-desestimada { background: var(--gris-f); color: var(--sutil); }
.chip-urgente { background: var(--rojo); color: #fff; }
.plazo { font-size: .85rem; font-weight: 600; white-space: nowrap; }
.plazo-ok { color: var(--verde); }
.plazo-justo { color: var(--ambar); }
.plazo-vencido { color: var(--rojo); }
.plazo-neutro { color: var(--sutil); }

/* Listas de ventas */
.pestanas { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--borde); margin-bottom: 1rem; scrollbar-width: none; }
.pestanas a { padding: .55rem .85rem; text-decoration: none; color: var(--sutil); white-space: nowrap; border-bottom: 2px solid transparent; font-weight: 600; font-size: .93rem; }
.pestanas a.activa { color: var(--azul); border-bottom-color: var(--oro); }
.cuenta { background: var(--azul); color: #fff; border-radius: 999px; font-size: .72rem; padding: .05rem .45rem; margin-left: .2rem; }
.filtros { display: flex; gap: .5rem; flex-wrap: wrap; }
.filtros input { width: 190px; } .filtros select { width: auto; }
@media (max-width: 560px) { .filtros, .filtros input { width: 100%; } .filtros select { flex: 1; } }

.lista { display: grid; gap: .5rem; }
.fila-pedido {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: .8rem 1rem; text-decoration: none; color: inherit; box-shadow: var(--sombra);
}
.fila-pedido:hover { border-color: var(--oro); }
.fila-pedido.es-urgente { border-left: 4px solid var(--rojo); }
.fp-principal { display: grid; min-width: 0; }
.fp-empresa { font-weight: 700; overflow-wrap: anywhere; }
.fp-meta { color: var(--sutil); font-size: .85rem; }
.fp-lado { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.bloque { margin-bottom: 1.5rem; }
.bloque h2 { color: var(--sutil); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.bloque-alerta h2 { color: var(--ambar); }
.vacio { color: var(--sutil); text-align: center; padding: 1.5rem; margin: 0; }
.vacio-grande { text-align: center; padding: 2.5rem 1rem; }

/* Detalle */
.columnas { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .columnas { grid-template-columns: 1.15fr 1fr; align-items: start; } }
.datos { margin: 0; display: grid; gap: .55rem; }
.dato { display: grid; grid-template-columns: 8.5rem 1fr; gap: .5rem; }
.dato dt { color: var(--sutil); font-size: .88rem; }
.dato dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .dato { grid-template-columns: 1fr; gap: 0; } }
.archivo {
  display: flex; justify-content: space-between; gap: .5rem; padding: .5rem .7rem; margin-bottom: .35rem;
  border: 1px solid var(--borde); border-radius: 8px; text-decoration: none; overflow-wrap: anywhere;
}
.archivo:hover { border-color: var(--oro); background: #fffdf7; }
.destacado-op { border-color: var(--oro); background: #fffcf3; }
.archivo-op { font-weight: 700; font-size: 1.05rem; border-color: var(--oro); background: #fff; }

.historial { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .55rem; max-height: 520px; overflow-y: auto; }
.historial li { border-radius: 8px; padding: .5rem .7rem; font-size: .93rem; }
.ev-cab { display: flex; justify-content: space-between; gap: .5rem; font-size: .82rem; color: var(--sutil); }
.ev-cab b { color: var(--texto); }
.ev-sistema { background: var(--gris-f); }
.ev-mensaje { background: var(--azul-f); }
.ev-solicitud { background: var(--ambar-f); }
.adjuntar { font-weight: 500; font-size: .88rem; }

.panel-admin { border-top: 3px solid var(--oro); }
.accion { border-top: 1px solid var(--borde); padding: .65rem 0; }
.accion:first-of-type { border-top: 0; }
.accion summary { cursor: pointer; font-weight: 700; color: var(--azul); }
.accion[open] summary { margin-bottom: .65rem; }
.copiable { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; background: var(--fondo); margin-bottom: .5rem; }

/* Acceso */
.acceso { max-width: 420px; margin: 3rem auto; text-align: center; }
.acceso form { text-align: left; margin-top: 1.25rem; }
.logo-acceso { border-radius: 14px; margin-bottom: .75rem; }

/* Tabla de usuarios */
.tabla { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tabla th, .tabla td { text-align: left; padding: .55rem .4rem; border-bottom: 1px solid var(--borde); vertical-align: top; }
.tabla th { font-size: .78rem; text-transform: uppercase; color: var(--sutil); letter-spacing: .04em; }
.tabla tr.inactivo td { color: var(--sutil); }
.acciones-tabla { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
  .tabla thead { display: none; }
  .tabla tr { display: grid; padding: .5rem 0; border-bottom: 1px solid var(--borde); }
  .tabla td { border: 0; padding: .1rem 0; }
  .acciones-tabla { justify-content: flex-start; }
}

/* ===== Portal de compras ===== */
.fila3 { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .fila3 { grid-template-columns: 1.3fr .8fr 1fr; } }
.fp-cant { font-weight: 500; color: var(--sutil); font-size: .92em; white-space: nowrap; }
h1 .fp-cant { font-size: .8em; }

.chip-elegir { background: #ede4fb; color: #5b3a9a; }
.chip-aprobada { background: var(--verde-f); color: var(--verde); }
.chip-comprada { background: var(--oro-claro); color: #7a5a14; }
.chip-review { background: #e0f1f4; color: #1e6170; }
.chip-cerrada { background: var(--gris-f); color: var(--sutil); }
.chip-cancelada { background: var(--gris-f); color: var(--sutil); text-decoration: line-through; }
.chip-recomendada { background: var(--azul); color: #fff; }
.chip-barata { background: var(--verde-f); color: var(--verde); }
.chip-volver-si { background: var(--verde-f); color: var(--verde); }
.chip-volver-cond { background: var(--ambar-f); color: var(--ambar); }
.chip-volver-no { background: var(--rojo-f); color: var(--rojo); }

.estrellas { color: var(--oro); letter-spacing: .05em; white-space: nowrap; }
.estrellas .apagadas { color: #d9d4c6; }
.estrellas-grande { font-size: 1.35rem; }

.aviso-elegir { background: #f3eefc; border-color: #d3c3f0; color: #42296f; }
.aviso-review { background: #e6f4f6; border-color: #b6dbe2; color: #164a55; }
.aviso-info { background: var(--azul-f); border-color: #c6d3ea; color: var(--azul-2); }
.bloque-review h2 { color: #1e6170; }
.ev-eleccion { background: var(--verde-f); }

/* Recorrido */
.pasos { list-style: none; display: flex; gap: .3rem; padding: 0; margin: 0 0 1rem; overflow-x: auto; scrollbar-width: none; counter-reset: paso; }
.pasos li { flex: 1; min-width: 4.6rem; text-align: center; font-size: .78rem; font-weight: 600; color: var(--sutil);
  padding: .35rem .3rem; border-top: 4px solid var(--borde); counter-increment: paso; white-space: nowrap; }
.pasos li.hecho { border-top-color: var(--oro); color: var(--texto); }
.pasos li.actual { border-top-color: var(--azul); color: var(--azul); }

/* Comparador de opciones */
.bloque-opciones { margin-bottom: 1rem; }
.bloque-opciones > h2 small { font-weight: 400; color: var(--sutil); }
.opciones-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); margin-bottom: 1rem; }
.opcion-card {
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra);
  padding: 1rem; display: flex; flex-direction: column; gap: .5rem; min-width: 0; position: relative;
}
.opcion-card.recomendada { border: 2px solid var(--azul); }
.opcion-card.elegida { border: 2px solid var(--verde); background: #fbfefc; }
.opcion-card.descartada { opacity: .6; }
.oc-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.letra { display: inline-grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 8px; background: var(--azul); color: var(--oro); font-weight: 800; font-size: 1.2rem; flex: none; }
.oc-tags { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.oc-producto { font-size: 1.05rem; color: var(--texto); text-transform: none; letter-spacing: 0; margin: .1rem 0 0; overflow-wrap: anywhere; }
.oc-proveedor { margin: 0; color: var(--sutil); font-weight: 600; }
.oc-total { margin: .25rem 0 0; font-size: 1.6rem; font-weight: 800; color: var(--azul); line-height: 1.1; }
.oc-total small { font-size: .78rem; font-weight: 500; }
.oc-unit { font-size: .88rem; }
.oc-datos { margin: .25rem 0 0; display: grid; gap: .35rem; font-size: .9rem; }
.oc-datos div { display: grid; grid-template-columns: 6.5rem 1fr; gap: .4rem; }
.oc-datos dt { color: var(--sutil); }
.oc-datos dd { margin: 0; overflow-wrap: anywhere; }
.cumple { font-weight: 600; }
.cumple-si { color: var(--verde); } .cumple-parcial { color: var(--ambar); } .cumple-no { color: var(--rojo); }
.aviso-inline { color: var(--rojo); font-weight: 700; font-size: .85rem; margin: 0; }

.pc h4 { margin: .2rem 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.pc ul { margin: 0; padding-left: 1.1rem; font-size: .9rem; }
.pc-pro h4 { color: var(--verde); } .pc-pro li::marker { content: "+  "; color: var(--verde); font-weight: 700; }
.pc-contra h4 { color: var(--rojo); } .pc-contra li::marker { content: "−  "; color: var(--rojo); font-weight: 700; }
.pros-contras { display: grid; gap: .5rem 1rem; grid-template-columns: 1fr; margin: .5rem 0; }
@media (min-width: 640px) { .pros-contras { grid-template-columns: 1fr 1fr; } }

.historial-op { font-size: .85rem; padding: .45rem .6rem; border-radius: 8px; }
.hist-bien { background: var(--verde-f); color: #1f5435; }
.hist-mal { background: var(--rojo-f); color: #7d1a14; }
.hist-neutro { background: var(--gris-f); color: var(--sutil); }
.oc-archivos .archivo { font-size: .88rem; }
.oc-elegir { display: grid; gap: .45rem; margin-top: auto; padding-top: .5rem; border-top: 1px solid var(--borde); }
.oc-elegir input { min-height: 40px; font-size: .9rem; }
.oc-borrar { margin-top: auto; text-align: right; }
.link.peligro { color: var(--rojo); font-size: .88rem; }

.publicar { border-top: 3px solid var(--oro); }
.accion-suelta summary, .form-opcion > summary { cursor: pointer; font-weight: 700; color: var(--azul); }
.form-opcion[open] > summary, .accion-suelta[open] summary { margin-bottom: .8rem; }
.form-opcion { border-style: dashed; border-color: var(--oro); }
.sin-borde { border: 0; padding: 0; margin: 0 0 .5rem; min-width: 0; }
legend.mini { font-weight: 600; font-size: .93rem; color: var(--texto); margin: 0 0 .4rem; padding: 0; }
.check-abajo { align-self: end; margin-bottom: 1.1rem; }
.estimado:empty { display: none; }

/* Review */
.form-review { border-top: 3px solid #1e6170; }
.selector-estrellas { display: inline-flex; flex-direction: row-reverse; gap: .15rem; }
.selector-estrellas input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.selector-estrellas label { display: inline; margin: 0; font-size: 2.1rem; line-height: 1; color: #d9d4c6; cursor: pointer; padding: 0 .1rem; }
.selector-estrellas input:checked ~ label, .selector-estrellas label:hover, .selector-estrellas label:hover ~ label { color: var(--oro); }
.selector-estrellas input:focus-visible + label { outline: 2px solid var(--azul); border-radius: 4px; }
.opcion-si:has(input:checked) { border-color: var(--verde); background: var(--verde-f); }
.opcion-condiciones:has(input:checked) { border-color: var(--ambar); background: var(--ambar-f); }
.opcion-no:has(input:checked) { border-color: var(--rojo); background: var(--rojo-f); }
.tarjeta-review { border-top: 3px solid var(--oro); }
.resumen-producto { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.nav .btn-sm { white-space: nowrap; }
.nav-links { flex: 1 1 0; min-width: 0; justify-content: flex-end; row-gap: .3rem; }
@media (max-width: 400px) { .nav-links { column-gap: .6rem; } .nav-links a, .nav .link { font-size: .88rem; } .nav .btn-sm { padding: .3rem .6rem; } }
.marca { flex: none; }

/* Pedido rápido vs. material de proyecto */
.tipo-pedido { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.tipo-pedido a {
  display: grid; gap: .15rem; padding: .7rem .85rem; border: 1px solid var(--borde); border-radius: var(--radio);
  background: var(--tarjeta); text-decoration: none; color: var(--texto);
}
.tipo-pedido a small { font-size: .8rem; line-height: 1.3; }
.tipo-pedido a.activa { border: 2px solid var(--azul); background: var(--azul-f); }
.chip-rapido { background: #fff1d6; color: #8a5a00; }
.mas-detalles { border-top: 1px solid var(--borde); padding-top: .7rem; margin-top: .3rem; }
.mas-detalles summary { cursor: pointer; font-weight: 600; color: var(--azul); margin-bottom: .2rem; }
.mas-detalles[open] summary { margin-bottom: .8rem; }
.lista-items { border-collapse: collapse; }
.lista-items td { padding: .15rem .6rem .15rem 0; vertical-align: top; }
.li-cant { font-weight: 700; white-space: nowrap; color: var(--azul); }

/* Filas Producto | Cantidad del pedido rápido */
.items { margin-bottom: .9rem; }
.fila-item { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: .5rem; margin-bottom: .45rem; }
.cab-items { font-weight: 600; font-size: .93rem; margin-bottom: .3rem; }
[data-agregar] { margin-top: .1rem; }
.nota-pie { margin-top: .75rem; }
@media (max-width: 639px) { .fila3 { grid-template-columns: 1fr 1fr; } .fila3 > :first-child { grid-column: 1 / -1; } }

/* ===== v2: producto por producto, aprobación y facturas ===== */
.fila-item-3 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.6fr); }
@media (max-width: 639px) {
  .fila-item-3 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .fila-item-3 > :nth-child(3) { grid-column: 1 / -1; }
  .solo-escritorio { display: none; }
  .fila-item-3[data-fila] { padding-bottom: .45rem; border-bottom: 1px dashed var(--borde); }
}
.chip-rechazada { background: var(--rojo-f); color: var(--rojo); }
.chip-datos { background: var(--ambar-f); color: var(--ambar); }

.item-card { border-left: 4px solid var(--borde); }
.item-card.estado-elegir { border-left-color: #8a6bc9; }
.item-card.estado-aprobada { border-left-color: var(--verde); }
.item-card.estado-comprada { border-left-color: var(--oro); }
.item-card.estado-rechazada { border-left-color: var(--rojo); }
.item-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-bottom: .6rem; }
.item-cab h2 { margin: 0; font-size: 1.1rem; }
.item-cab p { margin: .1rem 0 0; }
.propuesta-final { max-width: 460px; margin-bottom: .6rem; }
.opcion-grande .oc-total { font-size: 1.9rem; }
.descartadas { margin: .4rem 0 .8rem; }
.descartadas > summary { cursor: pointer; font-weight: 600; color: var(--azul); margin-bottom: .6rem; }
.descartadas .opcion-card { opacity: .8; }
.acciones-aprobar { display: flex; gap: .6rem; align-items: flex-start; flex-wrap: wrap; margin-top: .4rem; }
.rechazar > summary { list-style: none; }
.rechazar > summary::-webkit-details-marker { display: none; }
.rechazar[open] > summary { margin-bottom: .5rem; }
.default-disponible { background: #fffcf3; border-color: var(--oro); }
.default-disponible p { margin: 0 0 .6rem; }
.enviar-aprobacion { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: .4rem; }
.recepcion { background: var(--fondo); margin-top: .6rem; }
.review-mini { margin-top: .6rem; padding: .6rem .7rem; background: var(--fondo); border-radius: 8px; }
.accion-mini { margin-top: .6rem; font-size: .88rem; }
.accion-mini summary { cursor: pointer; color: var(--sutil); }
.accion-mini form { margin-top: .4rem; gap: .5rem; flex-wrap: nowrap; }
.enlace-aviso { display: block; text-decoration: none; }
.en-linea { display: flex; align-items: center; gap: .5rem; margin: 0; font-weight: 600; }
.en-linea input { width: auto; }
.num { text-align: right; white-space: nowrap; }
.grande { font-size: 1.3rem; }
.tarjeta-default { border: 2px solid var(--oro); }

.grupo-proveedor h2 { margin: 0; }
.tabla-compra td { vertical-align: middle; }
.tabla-compra input[type="checkbox"] { width: 1.2rem; height: 1.2rem; min-height: 0; accent-color: var(--azul); }
@media (max-width: 640px) { .tabla-compra tr { grid-template-columns: auto 1fr; column-gap: .6rem; } .tabla-compra td:first-child { grid-row: span 3; } }

.subir-factura h2 { margin-bottom: .4rem; }
.ayuda { margin: 0 0 .8rem; padding-left: 1.1rem; font-size: .9rem; }
.ayuda li { margin-bottom: .25rem; }
.tabla-scroll { overflow-x: auto; }
.tabla-factura { min-width: 760px; }
.tabla-factura td { padding: .3rem .25rem; }
.tabla-factura input, .tabla-factura select { min-height: 38px; padding: .4rem .5rem; font-size: .9rem; }
.tabla-factura .corto { width: 5.5rem; }
.tabla-factura td:first-child input { min-width: 15rem; }
.tabla-factura select { max-width: 16rem; }
.tabla-factura thead { display: table-header-group !important; }
.tabla-factura tr { display: table-row !important; }
.tabla-factura td { display: table-cell !important; }

/* Avisos al celular */
.aviso-push { background: var(--oro-claro); border-color: #e4cf9a; color: #5c4510; display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.aviso-push p { margin: 0; flex: 1 1 16rem; }
.dispositivos { list-style: none; padding: 0; margin: 0 0 1rem; }
.dispositivos li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid #eee; flex-wrap: wrap; }

/* Datos bancarios del proveedor y cotización adjunta */
.banco { margin-top: .7rem; padding: .6rem .75rem; border-radius: var(--radio); background: #f3f6f9; border: 1px solid #dbe3ea; }
.banco-falta { background: #fbf6ea; border-color: #ecd9a8; }
.banco-tit { margin: 0 0 .3rem; font-weight: 600; font-size: .92rem; }
.banco-datos { display: grid; gap: .15rem; margin: 0 0 .3rem; font-size: .9rem; }
.banco-datos div { display: flex; gap: .5rem; }
.banco-datos dt { color: #667; min-width: 4.5rem; }
.banco-datos dd { margin: 0; }
.cuenta-num { font-size: 1rem; letter-spacing: .04em; user-select: all; }
.banco-editar summary, .oc-adjuntar summary { cursor: pointer; font-size: .88rem; color: var(--azul); }
.banco-editar form, .oc-adjuntar form { margin-top: .5rem; }
.oc-adjuntar { margin-top: .5rem; }
.banco-en-opcion summary { cursor: pointer; font-weight: 600; }
.banco-en-opcion[open] { padding-bottom: .5rem; }

/* ¿Para cuándo? → Otra fecha */
.otra-fecha { margin-top: .6rem; max-width: 16rem; }

/* Un producto a la vez */
.foco-producto { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin: 0 0 .6rem; padding: .55rem .9rem; border-radius: var(--radio); background: var(--oro-claro); font-size: .92rem; }
.foco-producto a { font-weight: 600; }
.siguiente-aprobar { display: flex; justify-content: flex-end; margin: -.2rem 0 1rem; }
.fp-propuesta { font-weight: 700; white-space: nowrap; }
.fp-propuesta small { font-weight: 400; color: var(--sutil); }

/* Filas del pedido: Producto | Cantidad | Detalle | ¿Para qué? */
.fila-item-4 { grid-template-columns: minmax(0, 1.7fr) minmax(0, .9fr) minmax(0, 1.3fr) minmax(0, 1.5fr); }
@media (max-width: 639px) {
  .fila-item-4 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .fila-item-4 > :nth-child(3), .fila-item-4 > :nth-child(4) { grid-column: 1 / -1; }
  .fila-item-4[data-fila] { padding-bottom: .45rem; border-bottom: 1px dashed var(--borde); }
}
.para-que { margin: .2rem 0 0; font-size: .92rem; }

/* ===== Control de compras (mismo estilo que el control de OP) ===== */
.contenedor-ancho { max-width: 1800px; }
.tabla-scroll { overflow-x: auto; background: var(--tarjeta, #fff); border: 1px solid var(--borde); border-radius: var(--radio); }
.tabla-control { font-size: .86rem; min-width: 1350px; }
.tabla-control th { background: var(--azul); color: #fff; position: sticky; top: 0; white-space: nowrap; text-transform: uppercase; font-size: .76rem; letter-spacing: .03em; }
.tabla-control td { vertical-align: middle; padding: .4rem .5rem; }
.tabla-control tbody tr:nth-child(even) { background: #faf9f6; }
.tabla-control td.num { color: var(--sutil); text-align: right; width: 2.2rem; }
.tabla-control td.num-der { text-align: right; font-weight: 600; }
.tabla-control input, .tabla-control select { min-height: 34px; padding: .25rem .4rem; font-size: .84rem; margin: 0; }
.tabla-control input[type="date"] { width: 9.3rem; }
.tabla-control td.com { display: flex; gap: .35rem; min-width: 15rem; }
.tabla-control tr.cerrada td { color: #6b6b6b; }
.tabla-control tr.guardando { opacity: .55; pointer-events: none; }
.op-celda { white-space: nowrap; }
.op-celda a { font-weight: 600; }
.nowrap { white-space: nowrap; }
.leyenda { margin-top: .6rem; font-size: .82rem; }
.resumen-control { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 .75rem; }
.resumen-control a.st { text-decoration: none; }
.st { display: inline-block; font-weight: 700; font-size: .75rem; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; }
select.st-sel { font-weight: 700; border-radius: 999px; width: auto; border: 0; max-width: 15rem; }
.st-cotizando { background: var(--azul-f); color: var(--azul-2); }
.st-confirmacion { background: #ede4fb; color: #4b2d86; }
.st-por-pagar { background: #fff1b8; color: #6b5200; }
.st-pagado { background: var(--oro-claro); color: #6b4f10; border: 1px solid #e4cf9a; }
.st-entregado { background: #1e7d45; color: #fff; }
.st-desestimado { background: #b3261e; color: #fff; }
.sem { display: inline-block; font-weight: 700; font-size: .78rem; padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; }
.sem-verde { background: #1e7d45; color: #fff; }
.sem-amarillo { background: #f5c518; color: #3d2f00; }
.sem-rojo { background: var(--rojo); color: #fff; }
.sem-gris { background: var(--gris-f); color: var(--sutil); }
/* En el celular el control sigue siendo tabla (se desliza de lado), no tarjetas apiladas */
@media (max-width: 640px) {
  .tabla-control thead { display: table-header-group; }
  .tabla-control tr { display: table-row; padding: 0; }
  .tabla-control td { display: table-cell; padding: .4rem .5rem; }
}
