/* GP-STOCK-V1 */
.stock-modal{width:min(1180px,calc(100vw - 28px));max-height:92vh;overflow:auto;background:linear-gradient(180deg,#0f2416,#08140d);border:1px solid #294832;box-shadow:0 28px 90px rgba(0,0,0,.62)}
.stock-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;margin-bottom:18px}.stock-head h2{margin:3px 0 4px}.stock-head p{margin:0;color:var(--muted,#a4bda9);font-size:.84rem}.stock-kicker{font-size:.68rem;letter-spacing:.12em;font-weight:900;color:#7ee08a}.stock-add{white-space:nowrap;margin-right:26px}#stockTotalValue,#strainsTotalValue{font-size:.78rem;font-weight:600;color:var(--muted,#a4bda9)}
.stock-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:14px}.stock-summary>div{padding:14px 16px;border:1px solid #294832;border-radius:13px;background:rgba(0,0,0,.2)}.stock-summary b{display:block;font-size:1.45rem}.stock-summary span{color:#a4bda9;font-size:.72rem}.stock-summary .low b{color:#f5c451}.stock-summary .empty b{color:#ff7777}
.stock-toolbar{display:flex;justify-content:space-between;align-items:center;color:#a4bda9;font-size:.78rem;margin:10px 2px}.stock-link{border:0;background:none;color:#8be596;font-weight:700;cursor:pointer}
.stock-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.stock-card{border:1px solid #294832;border-radius:13px;background:rgba(0,0,0,.22);padding:9px;min-width:0}.stock-card-top{display:flex;gap:10px;align-items:center}.stock-img{width:36px;height:36px;border-radius:10px;overflow:hidden;display:grid;place-items:center;background:#10271a;border:1px solid #294832;flex:none}.stock-img img{width:100%;height:100%;object-fit:cover}.stock-product-icon{font-size:22px}.stock-product-main{min-width:0;flex:1}.stock-product-main h3{margin:0;font-size:.82rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.stock-product-main p{margin:3px 0 0;color:#8fa894;font-size:.72rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.stock-badge{font-size:.64rem;font-weight:900;border-radius:999px;padding:5px 8px;white-space:nowrap}.stock-badge.ok{background:#153d20;color:#8be596}.stock-badge.low{background:#493b14;color:#ffd96a}.stock-badge.empty{background:#4a1717;color:#ff9b9b}.stock-badge.inactive{background:#292929;color:#aaa}
.stock-qty{display:flex;justify-content:space-between;gap:8px;margin:10px 0 6px}.stock-qty span,.stock-qty b{display:block;color:#8fa894;font-size:.68rem}.stock-qty strong{display:block;font-size:1.05rem;margin-top:2px}.stock-progress{height:6px;background:#16271b;border-radius:999px;overflow:hidden}.stock-progress i{display:block;height:100%;background:#3fa34a;border-radius:inherit}.stock-meta{display:flex;justify-content:space-between;color:#a4bda9;font-size:.68rem;margin:7px 0}.stock-actions{display:flex;flex-wrap:wrap;gap:4px}.stock-actions button,.stock-secondary,.stock-danger,.stock-back{border:1px solid #294832;background:#102318;color:#d9f3df;border-radius:9px;padding:6px 7px;font-size:.66rem;font-weight:800;cursor:pointer}.stock-actions button:hover,.stock-secondary:hover,.stock-back:hover{background:#183420}.stock-actions .danger,.stock-danger{color:#ffaaaa;border-color:#633535;background:#281616}
.stock-inactive{margin-top:18px}.stock-inactive h3{font-size:.9rem;color:#a4bda9}.stock-empty{text-align:center;border:1px dashed #294832;border-radius:15px;padding:48px 20px;color:#a4bda9}.stock-empty>div{font-size:34px}.stock-empty h3{color:#edf8ef;margin:8px 0}.stock-empty p{font-size:.82rem}.stock-empty.small{padding:34px}
.stock-editor-bar{display:flex;align-items:center;gap:15px;margin-bottom:18px}.stock-editor-bar>div:nth-child(2){flex:1}.stock-editor-bar h3{margin:2px 0 0;font-size:1.15rem}.stock-form-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.stock-form-grid label,.stock-form-full label{display:flex;flex-direction:column;gap:6px;color:#a4bda9;font-size:.72rem;font-weight:800}.stock-form-grid input,.stock-form-grid select,.stock-form-full textarea{background:#0c1c12;border:1px solid #294832;color:#edf8ef;border-radius:9px;padding:10px 11px;outline:none}.stock-form-grid input:focus,.stock-form-grid select:focus,.stock-form-full textarea:focus{border-color:#3fa34a;box-shadow:0 0 0 3px rgba(63,163,74,.18)}.stock-form-full{margin-top:12px}.stock-form-full textarea{min-height:100px;resize:vertical}.stock-custom-unit{margin-top:6px}.stock-form-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:18px}
@media(max-width:900px){.stock-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.stock-form-grid{grid-template-columns:repeat(2,1fr)}.stock-summary{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px){.stock-head{flex-direction:column}.stock-grid{grid-template-columns:1fr}.stock-form-grid{grid-template-columns:1fr}.stock-head .stock-add{width:100%}}
/* Stock V2: fichas compactas, ventana sin cambios */
.stock-toolbar-note{color:#8fa894;font-size:.72rem}
@media (max-width:1400px){.stock-grid{grid-template-columns:repeat(4,minmax(0,1fr));}}
@media (max-width:1100px){.stock-grid{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media (max-width:760px){.stock-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}}
@media (max-width:480px){.stock-grid{grid-template-columns:1fr;}}
/* GP-STOCK-MODAL-V2 — tamaño de ventana */
.stock-modal{
  width:min(980px,calc(100vw - 48px)) !important;
  max-width:980px !important;
  max-height:88vh !important;
}

/* GP-STOCK-V16 — restauración visual de las tarjetas */
.stock-grid{
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:14px !important;
  width:100% !important;
}
.stock-card{
  min-width:0 !important;
  width:auto !important;
  padding:15px !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
}
.stock-card-top{
  display:flex !important;
  align-items:center !important;
  gap:11px !important;
  min-height:50px !important;
  margin-bottom:14px !important;
}
.stock-img{
  flex:0 0 42px !important;
  width:42px !important;
  height:42px !important;
}
.stock-product-main{
  min-width:0 !important;
  flex:1 1 auto !important;
}
.stock-product-main h3{
  font-size:1.02rem !important;
  line-height:1.22 !important;
  font-weight:800 !important;
  margin:0 !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
}
.stock-product-main p{
  font-size:.82rem !important;
  line-height:1.2 !important;
  margin:5px 0 0 !important;
}
.stock-card-stock{
  display:flex !important;
  flex-direction:column !important;
  gap:9px !important;
  margin:11px 0 13px !important;
}
.stock-card-stock > div{
  min-height:24px !important;
}
.stock-card-stock span{
  font-size:.70rem !important;
  line-height:1.25 !important;
}
.stock-card-stock strong,
.stock-card-stock b{
  font-size:1.08rem !important;
  font-weight:850 !important;
}
.stock-card-stock em{
  font-size:.62rem !important;
  margin-left:4px !important;
}
.stock-progress-wrap{
  margin:8px 0 13px !important;
}
.stock-card-bottom{
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  gap:9px !important;
  margin-top:10px !important;
  padding-top:10px !important;
}
.stock-price{
  width:100% !important;
  min-width:0 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
}
.stock-price b{
  display:block !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  font-size:.72rem !important;
}
.stock-card-status{
  width:100% !important;
  min-height:24px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
}
.stock-card-actions{
  width:100% !important;
  display:flex !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
  gap:6px !important;
  overflow:hidden !important;
}
.stock-card-actions .stock-card-btn{
  flex:1 1 0 !important;
  min-width:0 !important;
  height:30px !important;
  min-height:30px !important;
  padding:6px 7px !important;
  box-sizing:border-box !important;
  font-size:.66rem !important;
  line-height:1 !important;
  white-space:nowrap !important;
  border-radius:8px !important;
}
#stockAdd{
  width:50% !important;
  max-width:50% !important;
}
@media(max-width:1100px){
  .stock-grid{grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
}
@media(max-width:760px){
  .stock-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
}
@media(max-width:480px){
  .stock-grid{grid-template-columns:1fr !important;}
}

/* GP-STOCK-V17 — estilo de botones aislado del tema global */
.stock-card-actions button.stock-card-btn,
.stock-card-actions button.stock-card-btn.primary,
.stock-card-actions button.stock-card-btn.danger,
.stock-card-actions button.stock-card-btn:link,
.stock-card-actions button.stock-card-btn:visited,
.stock-card-actions button.stock-card-btn:hover,
.stock-card-actions button.stock-card-btn:focus,
.stock-card-actions button.stock-card-btn:active{
  appearance:none !important;
  -webkit-appearance:none !important;
  -moz-appearance:none !important;
  background:#163b22 !important;
  background-image:none !important;
  background-color:#163b22 !important;
  color:#eef8ef !important;
  border:1px solid #4f8e5d !important;
  border-radius:8px !important;
  box-shadow:0 2px 7px rgba(0,0,0,.24) !important;
  text-shadow:none !important;
  opacity:1 !important;
  filter:none !important;
}
.stock-card-actions button.stock-card-btn:hover,
.stock-card-actions button.stock-card-btn:focus{
  background:#1e4d2c !important;
  background-image:none !important;
  background-color:#1e4d2c !important;
  color:#ffffff !important;
  border-color:#6aae78 !important;
}
.stock-card-actions button.stock-card-btn:active{
  background:#102d19 !important;
  background-image:none !important;
  background-color:#102d19 !important;
  color:#ffffff !important;
}
.stock-card-actions button.stock-card-btn.primary{
  background:#1c5a2b !important;
  background-color:#1c5a2b !important;
  border-color:#63a96c !important;
  color:#effff1 !important;
}
.stock-card-actions button.stock-card-btn.danger{
  background:#542020 !important;
  background-color:#542020 !important;
  border-color:#a85b5b !important;
  color:#ffe8e8 !important;
}
.stock-card-actions button.stock-card-btn.danger:hover{
  background:#682727 !important;
  background-color:#682727 !important;
  color:#ffffff !important;
}

/* GP-STRAINS-V5 — botón compacto y fondo de ficha coherente */
.strains-stock-modal #strainAdd.btn-start-table{
  width:50%!important;
  max-width:50%!important;
  box-sizing:border-box!important;
}
/* Fuerza el mismo fondo oscuro de las tarjetas del Stock de fertilizantes. */
.strains-stock-modal .stock-card.strain-card{
  background:rgba(0,0,0,.22)!important;
  background-color:rgba(0,0,0,.22)!important;
  border:1px solid #294832!important;
  color:#edf8ef!important;
  box-shadow:none!important;
}
/* Evita fondos blancos heredados en elementos internos. */
.strains-stock-modal .stock-card.strain-card .stock-card-top,
.strains-stock-modal .stock-card.strain-card .stock-card-stock,
.strains-stock-modal .stock-card.strain-card .stock-card-bottom{
  background:transparent!important;
}

/* GP-STOCK-EDITOR-REDESIGN — formularios de añadir/editar producto y cepa,
   con el mismo lenguaje visual de tarjetas por sección que el editor de
   plantillas (tpl-section), en vez de un único grid plano de inputs. */
.stock-editor{display:flex;flex-direction:column;gap:14px}
.stock-form-section{background:rgba(0,0,0,.2);border:1px solid #294832;border-radius:12px;padding:16px}
.stock-form-section h4{margin:0 0 12px;font-size:.9rem;font-weight:800;color:#8be596;border-bottom:1px solid #294832;padding-bottom:8px}
.stock-form-section .stock-form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.stock-form-grid label span{text-transform:uppercase;letter-spacing:.03em;font-size:.68rem}
.stock-image-row{display:flex;align-items:center;gap:16px}
.stock-image-preview{width:64px;height:64px;border-radius:12px;overflow:hidden;background:#10271a;border:1px solid #294832;display:flex;align-items:center;justify-content:center;font-size:28px;flex:none}
.stock-image-preview img{width:100%;height:100%;object-fit:cover}
.stock-image-field{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:7px}
.stock-file-label{display:inline-flex;align-items:center;gap:6px;padding:9px 15px;font-size:.78rem}
.stock-file-help{color:#8fa894;font-size:.7rem}
.stock-form-actions{margin-top:2px}
@media(max-width:600px){.stock-image-row{flex-direction:row}}

/* GP-STOCK-IMAGE-URL — alternar entre subir archivo o pegar un enlace */
.stock-image-mode-toggle{display:inline-flex;gap:6px;margin-bottom:12px;padding:3px;border:1px solid #294832;border-radius:11px;background:rgba(0,0,0,.25)}
.stock-image-mode-btn{border:0;background:transparent;color:#8fa894;border-radius:8px;padding:7px 13px;font-size:.74rem;font-weight:800;cursor:pointer;transition:background .15s,color .15s}
.stock-image-mode-btn:hover{color:#d9f3df}
.stock-image-mode-btn.active{background:#1c5a2b;color:#effff1}
.stock-image-mode-file,.stock-image-mode-url{display:flex;flex-direction:column;align-items:flex-start;gap:7px}
.stock-image-url-input{width:100%;box-sizing:border-box;background:#0c1c12;border:1px solid #294832;color:#edf8ef;border-radius:9px;padding:10px 11px;font-size:.85rem;outline:none}
.stock-image-url-input:focus{border-color:#3fa34a;box-shadow:0 0 0 3px rgba(63,163,74,.18)}
