/* =====================================================================================================
   Formulario de producto (Nuevo / Editar) rediseñado - app/logistica/producto/views/form*OneUnd*.js
   Usa las variables del tema (dark_theme.css): funciona en claro y oscuro.
   ===================================================================================================== */

.gs-pf {
    --pf-surface: #ffffff;
    --pf-bg: var(--g-bg2, #f4f5f9);
    --pf-line: var(--g-border, rgba(0, 0, 0, .06));
    --pf-line2: var(--g-border2, rgba(0, 0, 0, .11));
    --pf-fg: var(--g-text, #1a202c);
    --pf-fg2: var(--g-text2, #4a5568);
    --pf-fg3: var(--g-text3, #a0aec0);
    --pf-accent: var(--g-accent, #4f7ef8);
    --pf-accent-s: var(--g-accent-soft, rgba(79, 126, 248, .10));
    --pf-ok: var(--g-green, #0ab889);
    --pf-ok-s: var(--g-green-soft, rgba(10, 184, 137, .10));
    --pf-warn: var(--g-amber, #d97706);
    --pf-warn-s: var(--g-amber-soft, rgba(217, 119, 6, .10));
    --pf-lot: #8b5cf6;
    --pf-lot-s: rgba(139, 92, 246, .12);
}
body.theme-dark .gs-pf {
    --pf-surface: var(--g-bg3, #1e2535);
    --pf-bg: var(--g-bg2, #161b27);
    --pf-lot: #a78bfa;
    --pf-lot-s: rgba(167, 139, 250, .16);
}

.gs-pf .gs-pf-dialog { width: 1080px; max-width: calc(100vw - 24px); }
.gs-pf .modal-content { border-radius: 16px; overflow: hidden; border: 0; }

/* ---------- cabecera ---------- */
.gs-pf .gs-pf-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--pf-line); }
.gs-pf .gs-pf-head .close { order: 9; margin: 0 0 0 4px; float: none; }
.gs-pf .gs-pf-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--pf-accent-s); color: var(--pf-accent); font-size: 19px; }
.gs-pf .gs-pf-ttl { flex: 1; min-width: 200px; }
.gs-pf .gs-pf-ttl .modal-title { font-size: 18px; font-weight: 800; line-height: 1.2; }
.gs-pf .gs-pf-ttl small { color: var(--pf-fg3); font-size: 12.5px; }
.gs-pf .gs-pf-estado { display: flex; gap: 18px; flex-wrap: wrap; }
.gs-pf .gs-pf-estado .gs-pf-sw { font-weight: 600; font-size: 13px; color: var(--pf-fg2); }

/* ---------- interruptor ---------- */
.gs-pf .gs-pf-sw { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; font-weight: 600; position: relative; }
.gs-pf .gs-pf-sw input { position: absolute; opacity: 0; width: 38px; height: 22px; margin: 0; cursor: pointer; z-index: 1; }
.gs-pf .gs-pf-sw i { position: relative; width: 38px; height: 22px; flex: 0 0 38px; border-radius: 99px; background: var(--pf-line2); transition: background .15s; }
.gs-pf .gs-pf-sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.gs-pf .gs-pf-sw input:checked + i { background: var(--pf-accent); }
.gs-pf .gs-pf-sw input:checked + i::after { transform: translateX(16px); }
.gs-pf .gs-pf-sw input:focus-visible + i { outline: 2px solid var(--pf-accent); outline-offset: 2px; }
.gs-pf .gs-pf-sw.ok input:checked + i { background: var(--pf-ok); }
.gs-pf .gs-pf-sw.lot input:checked + i { background: var(--pf-lot); }

/* ---------- pestañas ---------- */
.gs-pf .gs-pf-body { padding: 0; background: var(--pf-bg); }
.gs-pf .gs-pf-tabs { display: flex; gap: 4px; padding: 8px 20px 0; border-bottom: 1px solid var(--pf-line); background: var(--pf-surface); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.gs-pf .gs-pf-tabs::-webkit-scrollbar { display: none; }
.gs-pf .gs-pf-tabs::before, .gs-pf .gs-pf-tabs::after { display: none; }
.gs-pf .gs-pf-tabs > li { float: none; margin: 0; }
.gs-pf .gs-pf-tabs > li > a { border: 0 !important; border-bottom: 2.5px solid transparent !important; background: transparent !important; color: var(--pf-fg3); font-weight: 700; font-size: 13.5px; padding: 10px 14px 12px; margin: 0 0 -1px; border-radius: 0; }
.gs-pf .gs-pf-tabs > li.active > a, .gs-pf .gs-pf-tabs > li.active > a:hover, .gs-pf .gs-pf-tabs > li.active > a:focus { color: var(--pf-accent); border-bottom-color: var(--pf-accent) !important; }
.gs-pf .gs-pf-tabs > li > a:hover { color: var(--pf-fg2); }
.gs-pf .gs-pf-panes { padding: 18px 20px; }

/* ---------- tarjetas y grillas ---------- */
.gs-pf .gs-pf-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; }
.gs-pf .gs-pf-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gs-pf .gs-pf-card { background: var(--pf-surface); border: 1px solid var(--pf-line); border-radius: 14px; padding: 16px; }
.gs-pf .gs-pf-card.hide, .gs-pf .hide { display: none !important; }
.gs-pf .gs-pf-card > h5 { font-size: 13px; font-weight: 800; color: var(--pf-fg); display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.gs-pf .gs-pf-hint { margin-left: auto; font-weight: 500; color: var(--pf-fg3); font-size: 12px; }
.gs-pf .gs-pf-dot { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; }
.gs-pf .gs-pf-dot.a { background: var(--pf-accent-s); color: var(--pf-accent); }
.gs-pf .gs-pf-dot.b { background: var(--pf-ok-s); color: var(--pf-ok); }
.gs-pf .gs-pf-dot.s { background: var(--pf-warn-s); color: var(--pf-warn); }
.gs-pf .gs-pf-dot.i { background: var(--pf-lot-s); color: var(--pf-lot); }
.gs-pf .gs-pf-inv { border-color: rgba(139, 92, 246, .35); }

.gs-pf .gs-pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.gs-pf .gs-pf-grid .full { grid-column: 1 / -1; }
.gs-pf .gs-pf-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.gs-pf .gs-pf-f > label { font-size: 12px; font-weight: 700; color: var(--pf-fg2); margin: 0; }
.gs-pf .gs-pf-req { color: #e5484d; }
.gs-pf .form-control { height: 38px; border-radius: 9px; border: 1px solid var(--pf-line2); box-shadow: none; }
.gs-pf .form-control:focus { border-color: var(--pf-accent); box-shadow: 0 0 0 3px var(--pf-accent-s); }
.gs-pf .form-control[readonly] { background: var(--pf-bg); color: var(--pf-fg3); }
.gs-pf .gs-pf-big { height: 44px; font-size: 15.5px; font-weight: 600; }
.gs-pf .gs-pf-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.gs-pf .gs-pf-row > input { flex: 1; min-width: 0; }
.gs-pf .gs-pf-grow { flex: 1; min-width: 0; }
.gs-pf .gs-pf-auto { flex: 0 0 auto; font-size: 12.5px; color: var(--pf-fg2); }
.gs-pf .gs-pf-add .btn { height: 38px; border-radius: 9px; }
.gs-pf .chosen-container { width: 100% !important; }
.gs-pf .chosen-container-single .chosen-single { height: 38px; line-height: 36px; border-radius: 9px; }
.gs-pf .error { font-size: 11.5px; }

/* ---------- opciones con interruptor ---------- */
.gs-pf .gs-pf-opt { display: flex; align-items: center; gap: 12px; padding: 11px 0; margin: 0; border-top: 1px solid var(--pf-line); font-weight: 400; cursor: pointer; }
.gs-pf .gs-pf-card > h5 + .gs-pf-opt, .gs-pf .gs-pf-f + .gs-pf-opt { border-top: 0; }
.gs-pf .gs-pf-opt .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gs-pf .gs-pf-opt .t b { font-weight: 700; font-size: 13px; color: var(--pf-fg); }
.gs-pf .gs-pf-opt .t span { color: var(--pf-fg3); font-size: 12px; }
.gs-pf .gs-pf-pct { display: flex; align-items: center; gap: 4px; width: 92px; flex: 0 0 92px; }
.gs-pf .gs-pf-pct input { text-align: right; }
.gs-pf .gs-pf-pct span { color: var(--pf-fg3); font-weight: 700; }
.gs-pf .gs-pf-lotinfo { margin: 4px 0 6px; padding: 10px 12px; border-radius: 10px; background: var(--pf-lot-s); color: var(--pf-fg2); font-size: 12.5px; }

/* ---------- imagen ---------- */
.gs-pf .gs-pf-img { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gs-pf .gs-pf-img #d_img, .gs-pf .gs-pf-img [id$="d_img"] { width: 100%; max-width: 220px; min-height: 140px; border: 1.5px dashed var(--pf-line2); border-radius: 12px; background: var(--pf-bg); display: grid; place-items: center; overflow: hidden; }
.gs-pf .gs-pf-img img { max-width: 100%; max-height: 200px; }
.gs-pf .gs-pf-img .lv-progress { width: 100%; max-width: 220px; }

/* ---------- datos SUNAT ---------- */
.gs-pf .gs-pf-sn-search { position: relative; margin-bottom: 8px; }
.gs-pf .gs-pf-sn-search > .fa { position: absolute; left: 12px; top: 12px; color: var(--pf-fg3); }
.gs-pf .gs-pf-sn-search > input { padding-left: 34px; }
.gs-pf .gs-pf-sn-res { position: absolute; left: 0; right: 0; top: 42px; z-index: 30; background: var(--pf-surface); border: 1px solid var(--pf-line2); border-radius: 12px; box-shadow: 0 16px 34px -14px rgba(0, 0, 0, .35); max-height: 280px; overflow-y: auto; }
.gs-pf .gs-pf-sn-res button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-bottom: 1px solid var(--pf-line); color: var(--pf-fg); }
.gs-pf .gs-pf-sn-res button:last-child { border-bottom: 0; }
.gs-pf .gs-pf-sn-res button:hover, .gs-pf .gs-pf-sn-res button:focus { background: var(--pf-accent-s); outline: 0; }
.gs-pf .gs-pf-sn-res b { font-family: Consolas, "SFMono-Regular", monospace; color: var(--pf-accent); margin-right: 8px; }
.gs-pf .gs-pf-sn-res small { display: block; color: var(--pf-fg3); font-size: 11.5px; margin-top: 2px; }
.gs-pf .gs-pf-sn-res .vacio { padding: 12px; color: var(--pf-fg3); }
.gs-pf .gs-pf-sn-path { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 12px; font-size: 12px; color: var(--pf-fg3); min-height: 22px; }
.gs-pf .gs-pf-sn-path span { background: var(--pf-bg); border-radius: 6px; padding: 2px 8px; }
.gs-pf .gs-pf-sn-path span.fin { background: var(--pf-ok-s); color: var(--pf-ok); font-weight: 700; }
.gs-pf .gs-pf-sn-path i { font-style: normal; opacity: .6; }
.gs-pf .gs-pf-lvl { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 5px; background: var(--pf-warn-s); color: var(--pf-warn); font-size: 10.5px; font-weight: 800; }
.gs-pf .gs-pf-sel:disabled { color: var(--pf-fg3); background: var(--pf-bg); }

/* ---------- sucursales y precios ---------- */
.gs-pf .gs-pf-suc-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.gs-pf .gs-pf-suc-add .btn { height: 38px; border-radius: 9px; font-weight: 700; }
.gs-pf .gs-pf-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.gs-pf .gs-pf-chip { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 99px; background: var(--pf-accent-s); color: var(--pf-accent); }
.gs-pf .gs-pf-chip.ok { background: var(--pf-ok-s); color: var(--pf-ok); }
.gs-pf .gs-pf-sucs { display: flex; flex-direction: column; gap: 8px; }
.gs-pf .gs-pf-suc { display: grid; grid-template-columns: minmax(150px, 1.3fr) repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; align-items: end; padding: 10px 12px; border: 1px solid var(--pf-line); border-radius: 12px; background: var(--pf-bg); }
.gs-pf .gs-pf-suc > div { min-width: 0; }
.gs-pf .gs-pf-suc .note { display: block; font-size: 11px; font-weight: 700; color: var(--pf-fg3); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 3px; }
.gs-pf .gs-pf-suc .form-control { height: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.gs-pf .gs-pf-suc ._ct_ubi .form-control { text-align: left; }
.gs-pf .gs-pf-suc-n { display: flex; align-items: center; gap: 8px; align-self: center; }
.gs-pf .gs-pf-suc-n b { font-weight: 700; color: var(--pf-fg); }
.gs-pf .gs-pf-suc._control_group_1 { border-color: rgba(10, 184, 137, .45); }
.gs-pf .gs-pf-note { margin: 12px 0 0; font-size: 12.5px; color: var(--pf-fg3); }
.gs-pf .gs-pf-sucro select { width: 100%; min-height: 90px; }

/* ---------- pie ---------- */
.gs-pf .gs-pf-foot { padding: 12px 20px; border-top: 1px solid var(--pf-line); background: var(--pf-surface); }
.gs-pf .gs-pf-foot .btn { border-radius: 9px; }

/* ---------- celular / tablet ---------- */
@media (max-width: 860px) {
    .gs-pf .gs-pf-cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .gs-pf .gs-pf-grid { grid-template-columns: 1fr; }
    .gs-pf .gs-pf-panes { padding: 12px; }
    .gs-pf .gs-pf-head { padding: 12px 14px; }
    .gs-pf .gs-pf-suc { grid-template-columns: 1fr 1fr; }
    .gs-pf .gs-pf-suc-n { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
    .gs-pf * { transition: none !important; }
}
.gs-pf .gs-pf-noimg { color: var(--pf-fg3); font-size: 12.5px; text-align: center; line-height: 1.6; }
.gs-pf .gs-pf-noimg .fa { font-size: 28px; opacity: .55; }
/* GESMART lotes_11: N° de lote y vencimiento del stock al activar el lote */
.gs-pf .gs-pf-lotini { margin: 4px 0 6px; padding: 10px 12px; border-radius: 10px; background: var(--pf-lot-s); }
.gs-pf .gs-pf-lotini .t { display: block; margin-bottom: 6px; }
.gs-pf .gs-pf-lotini .t b { display: block; font-size: 12.5px; }
.gs-pf .gs-pf-lotini .t span { font-size: 11.5px; color: var(--pf-fg3, #8a94a6); }
.gs-pf .gs-pf-lotini-f { background: var(--pf-surface, #fff); border: 1px solid rgba(139, 92, 246, .25); border-radius: 9px; padding: 8px 10px; margin-top: 8px; }
.gs-pf .gs-pf-lotini-h { display: flex; justify-content: space-between; font-size: 12px; }
.gs-pf .gs-pf-lotini-h span { color: var(--pf-fg3, #8a94a6); font-weight: 700; }
.gs-pf .gs-pf-lotini-f .gs-lotec { margin-top: 6px; }
.gs-pf .gs-pf-lotini-vacio { font-size: 12px; color: var(--pf-fg3, #8a94a6); }
body.theme-dark .gs-pf .gs-pf-lotini-f { background: rgba(255, 255, 255, .03); }
