/* NexusERP V2 — estilos base. Pensado para tablet en cocina: botones grandes, alto contraste. */
:root {
  --fondo: #f6f3ec;
  --panel: #ffffff;
  --panel-2: #f1ede4;
  --borde: #ded7c8;
  --texto: #2a2620;
  --texto-2: #6b6255;
  --verde: #2f6b3f;        /* hoja de plátano */
  --verde-suave: #e3efe2;
  --maiz: #d9a320;
  --maiz-suave: #fbf0d2;
  --rojo: #b3402f;
  --rojo-suave: #f8e2dd;
  --azul: #2f5d8a;
  --azul-suave: #e2ebf4;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(40, 30, 10, .06), 0 2px 8px rgba(40, 30, 10, .05);
  --fuente: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--fondo); color: var(--texto); font-family: var(--fuente); font-size: 17px; line-height: 1.4; }
button, input, select, textarea { font: inherit; color: inherit; }
.oculto { display: none !important; }

/* ── Barra superior ── */
.barra { position: sticky; top: 0; z-index: 20; background: var(--verde); color: #fff;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.barra .marca { font-weight: 700; font-size: 19px; letter-spacing: .3px; }
.barra .marca small { font-weight: 400; opacity: .8; margin-left: 6px; }
.barra .usuario { margin-left: auto; font-size: 15px; opacity: .95; }
.barra button { background: rgba(255,255,255,.15); border: 0; color: #fff; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.menu { display: flex; gap: 6px; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--borde); overflow-x: auto; }
.menu a { text-decoration: none; color: var(--texto-2); padding: 8px 12px; border-radius: 10px; white-space: nowrap; font-size: 15px; }
.menu a.activo { background: var(--verde-suave); color: var(--verde); font-weight: 600; }

/* ── Pestañas grandes ── */
.pestanas { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; padding: 14px 16px 4px; }
.pestana { position: relative; background: var(--panel); border: 2px solid var(--borde); border-radius: var(--radio);
  padding: 14px 10px; text-align: center; cursor: pointer; font-weight: 600; min-height: 64px; box-shadow: var(--sombra); }
.pestana .ico { display: block; font-size: 24px; margin-bottom: 2px; }
.pestana.activa { border-color: var(--verde); background: var(--verde-suave); color: var(--verde); }
.globo { position: absolute; top: -8px; right: -6px; background: var(--rojo); color: #fff; border-radius: 99px;
  min-width: 26px; height: 26px; padding: 0 7px; font-size: 14px; display: grid; place-items: center; }

/* ── Contenido ── */
main { padding: 12px 16px 120px; max-width: 1100px; margin: 0 auto; }
h2 { font-size: 22px; margin: 6px 0 12px; }
h3 { font-size: 17px; margin: 0 0 8px; }
.ayuda { color: var(--texto-2); font-size: 15px; margin-bottom: 12px; }
.tarjeta { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px; margin-bottom: 12px; box-shadow: var(--sombra); }
.fila { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fila > .crece { flex: 1; min-width: 160px; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.separa { height: 1px; background: var(--borde); margin: 10px 0; }
.dato { color: var(--texto-2); font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
.fuerte { font-weight: 700; }

/* ── Controles ── */
label.campo { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--texto-2); }
input[type=text], input[type=number], input[type=date], input[type=email], input[type=password], select, textarea {
  background: #fff; border: 2px solid var(--borde); border-radius: 12px; padding: 10px 12px; min-height: 48px; font-size: 18px; color: var(--texto); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--verde); }
.btn { border: 0; border-radius: 12px; padding: 12px 18px; min-height: 52px; font-weight: 700; cursor: pointer; font-size: 17px; }
.btn-primario { background: var(--verde); color: #fff; }
.btn-secundario { background: var(--panel-2); color: var(--texto); border: 2px solid var(--borde); }
.btn-peligro { background: var(--rojo); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ancho { width: 100%; }

/* Contador grande +/- */
.contador { display: flex; align-items: center; gap: 6px; }
.contador button { width: 52px; height: 52px; border-radius: 12px; border: 2px solid var(--borde); background: var(--panel-2);
  font-size: 24px; font-weight: 700; cursor: pointer; }
.contador input { width: 92px; text-align: center; font-weight: 700; font-size: 22px; }

/* Botones de elección (motivos, plataformas) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2px solid var(--borde); background: #fff; border-radius: 99px; padding: 10px 16px; cursor: pointer; font-weight: 600; min-height: 48px; }
.chip.sel { border-color: var(--verde); background: var(--verde-suave); color: var(--verde); }

/* Producto para vender */
.prod { background: #fff; border: 2px solid var(--borde); border-radius: var(--radio); padding: 12px; cursor: pointer; text-align: left; min-height: 92px; }
.prod:active { transform: scale(.98); }
.prod .nombre { font-weight: 700; }
.prod .precio { color: var(--verde); font-weight: 700; margin-top: 4px; }
.prod .stock { font-size: 13px; color: var(--texto-2); }
.prod.agotado { opacity: .45; cursor: not-allowed; }
.prod.paquete { border-style: dashed; border-color: var(--maiz); background: var(--maiz-suave); }

/* Etiquetas */
.tag { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; }
.tag-verde { background: var(--verde-suave); color: var(--verde); }
.tag-maiz { background: var(--maiz-suave); color: #7a5a06; }
.tag-rojo { background: var(--rojo-suave); color: var(--rojo); }
.tag-azul { background: var(--azul-suave); color: var(--azul); }

/* Tablas simples */
table.tabla { width: 100%; border-collapse: collapse; font-size: 16px; }
.tabla th { text-align: left; font-size: 13px; color: var(--texto-2); font-weight: 600; padding: 8px; border-bottom: 2px solid var(--borde); }
.tabla td { padding: 10px 8px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tabla td.der, .tabla th.der { text-align: right; }

/* Barra fija inferior para confirmar */
.pie { position: fixed; left: 0; right: 0; bottom: 0; background: var(--panel); border-top: 2px solid var(--borde);
  padding: 12px 16px; display: flex; align-items: center; gap: 12px; z-index: 15; box-shadow: 0 -4px 12px rgba(0,0,0,.05); }
.pie .total { font-size: 22px; font-weight: 800; }
.pie .total small { display: block; font-size: 13px; font-weight: 400; color: var(--texto-2); }
.pie .btn { margin-left: auto; min-width: 220px; }

/* Avisos */
.aviso { position: fixed; left: 50%; top: 76px; transform: translateX(-50%); z-index: 50; padding: 14px 20px; border-radius: 12px;
  font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.18); max-width: 92vw; }
.aviso.ok { background: var(--verde); color: #fff; }
.aviso.error { background: var(--rojo); color: #fff; }
.banda { padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; font-size: 15px; }
.banda.alerta { background: var(--rojo-suave); color: var(--rojo); }
.banda.info { background: var(--azul-suave); color: var(--azul); }
.banda.maiz { background: var(--maiz-suave); color: #7a5a06; }

/* Ventana modal */
.velo { position: fixed; inset: 0; background: rgba(30, 25, 15, .45); z-index: 40; display: grid; place-items: center; padding: 16px; }
.ventana { background: var(--panel); border-radius: 18px; padding: 18px; width: min(640px, 100%); max-height: 90vh; overflow: auto; }
.ventana .acciones { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* Entrada */
.entrada { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.entrada .caja { width: min(420px, 100%); background: var(--panel); border-radius: 20px; padding: 28px; box-shadow: var(--sombra); }
.entrada h1 { color: var(--verde); font-size: 28px; }
.entrada .sub { color: var(--texto-2); margin-bottom: 20px; }
.entrada form { display: flex; flex-direction: column; gap: 14px; }
.pin { letter-spacing: 10px; text-align: center; font-size: 26px !important; }

/* Renglones de compra */
.linea { display: grid; grid-template-columns: minmax(200px, 2fr) 1fr 1fr 1fr auto; gap: 10px; align-items: end;
  padding: 10px 0; border-bottom: 1px solid var(--borde); }
.linea input, .linea select { width: 100%; }
.linea .l-quitar { min-height: 48px; }
.linea .l-info { grid-column: 1 / -1; }
.linea .l-info:empty { display: none; }
@media (max-width: 760px) { .tarjeta { overflow-x: auto; } .tabla { font-size: 14px; } .tabla td, .tabla th { padding: 8px 5px; } }
.tarjeta.error, tr.error td { background: var(--rojo-suave); }

@media (max-width: 760px) {
  .linea { grid-template-columns: 1fr 1fr; }
  .linea .l-art { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  html, body { font-size: 16px; }
  .pie { flex-wrap: wrap; }
  .pie .btn { width: 100%; margin-left: 0; }
}
