
/* Container layout */
.npp-container{
  width:95%;
  margin:0 auto;
  display:flex;
  gap:2%;
  align-items:flex-start;
  box-sizing:border-box;
}

.npp-products{ width:74%; }
.npp-cart{
  width:24%;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:15px;
  box-shadow:0 2px 8px rgba(0,0,0,.05);
  position:sticky;
  top:20px;
  height:fit-content;
}

/* Toolbar */
.npp-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}

.npp-filters{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1;
  justify-content:flex-end;
}

.npp-category{
  width:220px;
  max-width:40vw;
  padding:10px 12px;
  border:1px solid #d1d5db;
  border-radius:10px;
  background:#fff;
  font-size:14px;
  outline:none;
  box-sizing:border-box;
}
.npp-category:focus{
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,.15);
}
.npp-title{
  font-weight:700;
  font-size:16px;
  line-height:1.2;
}
.npp-search{
  width:100%;
  max-width:420px;
  padding:10px 12px;
  border:1px solid #d1d5db;
  border-radius:10px;
  background:#fff;
  font-size:14px;
  outline:none;
  box-sizing:border-box;
}

/* Stock indicator dot (months of supply) */
.npp-stockdot{
  display:inline-block;
  width:10px;
  height:10px;
  border-radius:50%;
  margin-right:8px;
  vertical-align:middle;
  border:1px solid rgba(0,0,0,.12);
}
.npp-dot-green{ background:#22c55e; }
.npp-dot-orange{ background:#f59e0b; }
.npp-dot-red{ background:#ef4444; }
.npp-stocknum{ vertical-align:middle; }
.npp-search:focus{
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,.15);
}

/* Table */
.npp-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 8px;
}
.npp-row{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
}
.npp-row td{
  padding:10px;
  vertical-align:middle;
}

/* Image pop */
.npp-imgwrap{ position:relative; width:44px; }
.npp-img{ width:44px; height:44px; object-fit:cover; border-radius:8px; cursor:pointer; border:1px solid #e5e7eb; background:#fff; }
.npp-pop-float{
  display:none;
  position:fixed;
  background:#fff;
  border:1px solid #ddd;
  padding:8px;
  border-radius:10px;
  box-shadow:0 12px 36px rgba(0,0,0,.25);
  z-index:2147483000;
  max-width:320px;
  pointer-events:none;
}
.npp-imgwrap{
  position:relative;
  overflow:visible;
}
.npp-pop-float img{ max-width:220px; max-height:220px; display:block; border-radius:8px; }

/* Image hover popover is driven by JS; keep the inline template hidden */
.npp-pop-hidden{ display:none !important; }

.npp-prod-name{ font-weight:600; }
.npp-sku,.npp-skudata{ font-size:11px; color:#6b7280; }

/* Inputs & buttons */
.npp-input{
  width:60px;
  padding:6px 8px;
  border:1px solid #d1d5db;
  border-radius:8px;
  font-size:13px;
  background:#f9fafb;
  box-sizing:border-box;
}
.npp-input:focus{
  outline:none;
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,.15);
  background:#fff;
}
.npp-btn{
  background:#2563eb;
  color:#fff;
  border:none;
  border-radius:8px;
  padding:7px 10px;
  font-size:12px;
  cursor:pointer;
}
.npp-btn:hover{ filter:brightness(0.95); }

/* Cart */
.npp-cart h3{ margin:0 0 10px 0; font-size:16px; }
.npp-cart-line{
  border-bottom:1px solid #eee;
  padding:8px 0;
  display:flex;
  flex-direction:column;
  gap:4px;
}

/*.npp-cart-main{ display:flex; justify-content:space-between; } */

.npp-cart-main{
  display: grid;
  grid-template-columns: 1fr 80px 60px 90px;
  align-items: center;
  gap: 8px;
}

/* Price */
.npp-price{
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Quantity */
.npp-qty{
  text-align: right;
  color: #374151;
  font-variant-numeric: tabular-nums;
}

/* Line total (highlight) */
.npp-line-total{
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.npp-cart-meta{ font-size:12px; color:#6b7280; display:flex; gap:10px; flex-wrap:wrap; }
.npp-del{
  background:#ef4444;
  color:#fff;
  border:none;
  border-radius:6px;
  padding:5px 8px;
  font-size:11px;
  width:64px;
  cursor:pointer;
}
.npp-empty{ color:#6b7280; font-size:13px; }

/* Responsive */
@media (max-width: 900px){
  .npp-container{ flex-direction:column; }
  .npp-products,.npp-cart{ width:100%; }
  .npp-cart{ position:static; }
  .npp-search{ max-width:none; }
  .npp-filters{ width:100%; justify-content:stretch; }
  .npp-category{ width:45%; max-width:none; }
  .npp-search{ width:55%; }
}

.npp-cart-summary{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid #eee;
}
.npp-sum-row{
  display:flex;
  justify-content:space-between;
  font-size:13px;
  padding:4px 0;
}
.npp-sum-total{
  margin-top:6px;
  padding-top:8px;
  border-top:1px dashed #e5e7eb;
  font-size:14px;
}
.npp-confirm{
  width:100%;
  margin-top:12px;
  padding:10px 12px;
  font-size:13px;
}
.npp-confirm-msg{
  margin-top:10px;
  font-size:12px;
  color:#374151;
  background:#f3f4f6;
  border:1px solid #e5e7eb;
  border-radius:10px;
  padding:8px 10px;
  word-break:break-word;
}

/* Modal (product details) - fully contained */
body.npp-modal-open{ overflow:hidden; }

.npp-modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(17,24,39,.55);
  z-index:2147482000; /* above Divi header/footer */
  display:flex;
  align-items:center;
  justify-content:center;
  padding:14px;
  box-sizing:border-box;
}

.npp-modal{
  width:min(980px, 95vw);
  max-height:92vh;
  background:#fff;
  border-radius:14px;
  box-shadow:0 18px 50px rgba(0,0,0,.25);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.npp-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 14px;
  border-bottom:1px solid #e5e7eb;
  gap:12px;
}

.npp-modal-title{
  font-weight:700;
  font-size:15px;
  line-height:1.2;
  color:#111827;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.npp-modal-close{
  background:transparent;
  border:none;
  font-size:22px;
  line-height:1;
  cursor:pointer;
  color:#111827;
  padding:6px 8px;
  border-radius:10px;
}
.npp-modal-close:hover{ background:#f3f4f6; }

.npp-modal-body{
  padding:14px;
  overflow:auto;
}

.npp-modal-loading,
.npp-modal-error{
  padding:14px;
  border:1px solid #e5e7eb;
  border-radius:12px;
  background:#f9fafb;
  color:#111827;
  font-size:13px;
}

.npp-modal-images{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.npp-modal-images img{
  width:160px;
  height:160px;
  object-fit:cover;
  border-radius:12px;
  border:1px solid #e5e7eb;
  background:#fff;
}

.npp-modal-section{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid #f1f5f9;
}
.npp-modal-section h4{
  margin:0 0 8px 0;
  font-size:13px;
  color:#111827;
}

.npp-kvgrid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:8px 14px;
}
.npp-kv{
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size:13px;
  border:1px solid #eef2f7;
  background:#fff;
  border-radius:10px;
  padding:8px 10px;
}
.npp-kv span{ color:#6b7280; }
.npp-kv strong{ color:#111827; font-weight:600; }

.npp-long{
  font-size:13px;
  color:#111827;
  line-height:1.45;
  white-space:pre-wrap;
}

.npp-list{
  margin:0;
  padding-left:18px;
  font-size:13px;
  color:#111827;
}

.npp-lots{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}
.npp-lots th, .npp-lots td{
  border:1px solid #e5e7eb;
  padding:6px 8px;
  text-align:left;
}
.npp-lots th{
  background:#f9fafb;
  font-weight:600;
}

.npp-prod-name a{
  color:#111827;
  text-decoration:underline;
  text-decoration-color:#cbd5e1;
}
.npp-prod-name a:hover{
  text-decoration-color:#111827;
}

@media (max-width: 900px){
  .npp-kvgrid{ grid-template-columns:1fr; }
  .npp-modal-images img{ width:120px; height:120px; }
}

.npp-filter{
  width:180px;
  max-width:28vw;
  padding:10px 12px;
  border:1px solid #d1d5db;
  border-radius:10px;
  background:#fff;
  font-size:14px;
  outline:none;
  box-sizing:border-box;
}

.npp-filter:focus{
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,.15);
}

@media (max-width: 900px){
  .npp-filter{
    width:32%;
    max-width:none;
  }
  .npp-filters{
    flex-wrap:wrap;
  }
  .npp-search{
    width:100%;
  }
}

/* .npp-approval-cell{min-width:220px} */

.npp-doctor{
  font-size:12px;
  color:#065f46;
  margin-top:4px;
  /*min-height:16px;*/
  text-align: center;
}
.npp-upload-hint{
  font-size:11px;
  color:#b45309;
  margin-top:4px;
}
.npp-line-actions{
  display:flex;
  align-items:center;
  gap:8px;
}
.npp-astate{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:22px;
  height:22px;
  border-radius:50%;
  font-size:12px;
  font-weight:700;
}
.npp-astate-invalid{
  background:#fee2e2;
  color:#b91c1c;
  border:1px solid #fecaca;
}
.npp-astate-valid{
  background:#dcfce7;
  color:#166534;
  border:1px solid #bbf7d0;
}
.npp-astate-checking{
  background:#e0f2fe;
  color:#0369a1;
  border:1px solid #bae6fd;
}
.npp-add.is-disabled{
  opacity:.5;
  cursor:not-allowed;
}
.npp-approval-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  z-index:1000002;
}
.npp-approval-modal{
  background:#fff;
  border-radius:12px;
  width:min(920px,92vw);
  max-height:88vh;
  overflow:auto;
  margin:5vh auto 0;
  padding:16px;
  box-shadow:0 18px 60px rgba(0,0,0,.3);
}
.npp-approval-body{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.npp-approval-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  /*border:1px solid #e5e7eb;*/
  border-radius:10px;
  padding:12px;
  background:#fff;
}
.npp-approval-main{
  display:flex;
  flex-direction:column;
  gap:2px;
  font-size:13px;
}
.npp-approval-main strong{
  font-size:14px;
}
.npp-approval-patient{
  color:#374151;
}


/* ===== V30 stability fixes ===== */
.npp-approval-cell{
  display:flex;
  flex-direction:column;
}
.npp-approval-row{
  display:flex;
  align-items:center;
  gap:6px;
}
.npp-approval{
  width:15ch;
}
.npp-approval-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.npp-initials{
  width:6ch;
  text-align:center;
}
.npp-pop-hidden{
  display:none !important;
}

.npp-upload-panel {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
}

.npp-upload-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.npp-dropzone {
  border: 2px dashed #bbb;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.npp-dropzone.is-dragover {
  border-color: #2e7d32;
  background: #f1f8f4;
}

.npp-drop-msg span {
  font-size: 12px;
  color: #666;
}

.npp-upload-status {
  margin-top: 8px;
  font-size: 13px;
}

.npp-cart-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: -18px;
  margin-bottom: 8px;
}

.npp-appr-dl {
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  color: #2563eb;
  text-decoration: none;
  cursor: pointer;
}

.npp-appr-dl:hover {
  color: #1d4ed8;
}

.npp-appr-dl svg {
  width: 14px;
  height: 14px;
}
