/* =========================================================
   STOCK MODULE STYLES
   File: assets/css/stock.css
   Scoped to: .stock-page
   ========================================================= */

.stock-page.premium-stock-dashboard{--stock-primary:#2563eb;--stock-border:#e6edf5;--stock-muted:#64748b;padding:28px 30px 34px;display:grid;gap:18px}.stock-page .stock-dash-header{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}.stock-page .stock-dash-header h1{margin:0;color:#0f172a;font-size:32px;line-height:1;font-weight:950;letter-spacing:-.035em}.stock-page .stock-dash-header p{margin:10px 0 0;color:#64748b;font-size:15px;font-weight:700}.stock-page .stock-primary-btn{min-width:168px;height:52px;border:0;border-radius:13px;background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff;box-shadow:0 16px 34px rgba(37,99,235,.25);font-size:14px;font-weight:950;display:inline-flex;align-items:center;justify-content:center;gap:10px;cursor:pointer}.stock-page .stock-top-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(410px,.9fr);gap:18px}.stock-page .stock-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.stock-page .stock-kpi-card,.stock-page .stock-panel,.stock-page .stock-status-card{background:#fff;border:1px solid var(--stock-border);border-radius:16px;box-shadow:0 14px 40px rgba(15,23,42,.055)}.stock-page .stock-kpi-card{min-height:174px;padding:20px;position:relative;overflow:hidden}.stock-page .stock-kpi-card::after{content:"";position:absolute;inset:auto 18px 18px 18px;height:34px;opacity:.7;background:linear-gradient(110deg,transparent 0 10%,currentColor 11% 14%,transparent 15% 26%,currentColor 27% 31%,transparent 32% 42%,currentColor 43% 48%,transparent 49% 60%,currentColor 61% 64%,transparent 65% 78%,currentColor 79% 84%,transparent 85%);clip-path:polygon(0 72%,12% 60%,22% 70%,34% 34%,45% 56%,58% 26%,69% 66%,82% 38%,100% 54%,100% 100%,0 100%)}.stock-page .stock-kpi-card.blue{color:#2563eb;background:linear-gradient(180deg,#fff,#f5f9ff)}.stock-page .stock-kpi-card.green{color:#16a34a;background:linear-gradient(180deg,#fff,#f4fff8)}.stock-page .stock-kpi-card.purple{color:#7c3aed;background:linear-gradient(180deg,#fff,#fbf7ff)}.stock-page .stock-kpi-card.orange{color:#f97316;background:linear-gradient(180deg,#fff,#fff7ed)}.stock-page .stock-kpi-icon{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:color-mix(in srgb,currentColor 13%,white);font-size:19px}.stock-page .stock-kpi-card span{display:block;margin-top:12px;color:#0f172a;font-size:13px;font-weight:900}.stock-page .stock-kpi-card strong{display:block;margin-top:12px;color:#0f172a;font-size:25px;font-weight:950;letter-spacing:.02em}.stock-page .stock-kpi-card p{margin:14px 0 0;color:#64748b;font-size:12px;font-weight:800}.stock-page .stock-status-card{padding:22px}.stock-page .stock-card-head h2,.stock-page .stock-search-panel h2,.stock-page .stock-table-head h2{margin:0;color:#0f172a;font-size:17px;font-weight:950;letter-spacing:-.015em}.stock-page .stock-status-layout{display:grid;grid-template-columns:150px 1fr;align-items:center;gap:24px;margin-top:20px}.stock-page .stock-donut,.stock-page .stock-category-donut{width:146px;height:146px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(#22c55e 0 82%,#2563eb 82% 90%,#f59e0b 90% 96%,#ef4444 96% 100%)}.stock-page .stock-category-donut{background:conic-gradient(#2563eb 0 58%,#22c55e 58% 76%,#f59e0b 76% 92%,#7c3aed 92% 100%)}.stock-page .stock-donut>div,.stock-page .stock-category-donut>div{width:82px;height:82px;border-radius:50%;background:#fff;display:grid;place-items:center;text-align:center;box-shadow:inset 0 0 0 1px #eef2f7}.stock-page .stock-donut span,.stock-page .stock-category-donut span{color:#64748b;font-size:12px;font-weight:850}.stock-page .stock-donut strong,.stock-page .stock-category-donut strong{color:#0f172a;font-size:14px;font-weight:950;line-height:1.25}.stock-page .stock-status-legend,.stock-page .stock-category-legend{display:grid;gap:14px}.stock-page .stock-status-line,.stock-page .stock-category-line{display:grid;grid-template-columns:12px minmax(90px,.8fr) minmax(110px,1fr);align-items:center;gap:10px;font-size:13px}.stock-page .stock-status-line strong,.stock-page .stock-category-line strong{color:#0f172a;font-weight:950}.stock-page .stock-status-line em,.stock-page .stock-category-line em{font-style:normal;text-align:right;color:#0f172a;font-weight:850}.stock-page .status-dot,.stock-page .dot{width:10px;height:10px;border-radius:50%}.stock-page .status-dot.in,.stock-page .movement-icon.in{background:#dcfce7;color:#16a34a}.stock-page .status-dot.low,.stock-page .movement-icon.low{background:#fef3c7;color:#f59e0b}.stock-page .status-dot.out,.stock-page .movement-icon.out{background:#fee2e2;color:#ef4444}.stock-page .status-dot.inactive,.stock-page .movement-icon.inactive{background:#f1f5f9;color:#64748b}.stock-page .dot-1{background:#2563eb}.stock-page .dot-2{background:#22c55e}.stock-page .dot-3{background:#f59e0b}.stock-page .dot-4{background:#7c3aed}.stock-page .stock-mid-grid{display:grid;grid-template-columns:1.08fr .84fr 1.32fr;gap:18px}.stock-page .stock-panel{padding:20px}.stock-page .stock-category-layout{display:grid;grid-template-columns:170px 1fr;gap:18px;align-items:center;margin-top:20px}.stock-page .stock-top-products{display:grid;gap:14px;margin-top:18px}.stock-page .stock-top-product{display:grid;grid-template-columns:24px 44px 1fr auto;align-items:center;gap:12px}.stock-page .stock-top-product>span{color:#64748b;font-weight:950}.stock-page .stock-product-thumb{width:44px;height:34px;border-radius:8px;background:#e0f2fe;color:#2563eb;display:grid;place-items:center}.stock-page .stock-top-product strong{display:block;color:#0f172a;font-weight:950}.stock-page .stock-top-product small{display:block;color:#64748b;font-weight:800}.stock-page .stock-top-product b{text-align:right;color:#0f172a;font-weight:950}.stock-page .stock-top-product b small{font-size:11px}.stock-page .stock-view-link{margin-top:18px;border:0;background:transparent;color:#2563eb;font-weight:950;display:inline-flex;gap:8px;align-items:center;cursor:pointer}.stock-page .stock-movement-list{display:grid;gap:12px;margin-top:18px}.stock-page .stock-movement{display:grid;grid-template-columns:28px 72px minmax(140px,1fr) 60px 120px;gap:10px;align-items:center;font-size:13px}.stock-page .movement-icon{width:28px;height:28px;border-radius:50%;display:grid;place-items:center}.stock-page .movement-badge{height:23px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;font-size:11px;font-weight:950}.stock-page .movement-badge.in{background:#dcfce7;color:#16a34a}.stock-page .movement-badge.low{background:#fff7ed;color:#f97316}.stock-page .movement-badge.out{background:#fee2e2;color:#ef4444}.stock-page .stock-movement strong{color:#0f172a}.stock-page .stock-movement b{color:#0f172a}.stock-page .stock-movement em{font-style:normal;color:#64748b;font-size:12px}.stock-page .stock-empty-mini{min-height:90px;border:1px dashed #dbeafe;border-radius:14px;background:#f8fbff;display:grid;place-items:center;color:#64748b;font-weight:900}.stock-page .stock-search-panel{padding:18px 20px}.stock-page .stock-filter-row{display:grid;grid-template-columns:minmax(250px,1.35fr) minmax(150px,.6fr) minmax(150px,.6fr) minmax(150px,.6fr) auto auto;gap:14px;align-items:end;margin-top:14px}.stock-page .stock-search-box{position:relative}.stock-page .stock-search-box input{width:100%;height:44px;border:1px solid #dbe3ef;border-radius:10px;padding:0 44px 0 14px;font-weight:750}.stock-page .stock-search-box i{position:absolute;right:14px;top:50%;transform:translateY(-50%);color:#64748b}.stock-page .stock-field span{display:block;margin-bottom:8px;color:#0f172a;font-size:12px;font-weight:900}.stock-page .stock-field select{width:100%;height:44px;border:1px solid #dbe3ef;border-radius:10px;padding:0 12px;background:#fff;color:#0f172a;font-weight:850}.stock-page .stock-search-btn,.stock-page .stock-reset-btn{height:44px;border-radius:10px;padding:0 18px;display:inline-flex;align-items:center;gap:8px;font-weight:950;cursor:pointer}.stock-page .stock-search-btn{border:0;background:#2563eb;color:#fff;box-shadow:0 12px 24px rgba(37,99,235,.20)}.stock-page .stock-reset-btn{border:1px solid #dbe3ef;background:#fff;color:#0f172a}.stock-page .stock-quick-filters{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:14px;color:#0f172a;font-size:12px;font-weight:900}.stock-page .stock-quick-btn{height:30px;border:0;border-radius:8px;padding:0 14px;background:#f1f5f9;color:#0f172a;font-size:12px;font-weight:900;cursor:pointer}.stock-page .stock-quick-btn.active{background:#dbeafe;color:#2563eb;box-shadow:inset 0 0 0 1px #93c5fd}.stock-page .stock-table-panel{padding:0;overflow:visible}.stock-page .stock-table-head{display:flex;justify-content:space-between;align-items:center;padding:18px 20px;border-bottom:1px solid #eef2f7}.stock-page .stock-table-head p{margin:5px 0 0;color:#2563eb;font-size:12px;font-weight:900}.stock-page .stock-table-actions{display:flex;gap:10px}.stock-page .stock-table-actions button{height:40px;border:1px solid #dbe3ef;border-radius:10px;background:#fff;color:#0f172a;padding:0 15px;display:inline-flex;align-items:center;gap:8px;font-weight:900;cursor:pointer}.stock-page .stock-premium-table{width:100%;border-collapse:separate;border-spacing:0;font-size:13px}.stock-page .stock-premium-table th{background:#fbfdff;color:#475569;font-size:11px;font-weight:950;text-transform:uppercase;letter-spacing:.04em;padding:14px 16px;border-bottom:1px solid #eef2f7;text-align:left}.stock-page .stock-premium-table td{padding:13px 16px;border-bottom:1px solid #f1f5f9;color:#0f172a;vertical-align:middle}.stock-page .stock-premium-table tr:hover td{background:#f8fbff}.stock-page .stock-pill{display:inline-flex;align-items:center;justify-content:center;min-width:70px;height:23px;border-radius:999px;padding:0 10px;font-size:12px;font-weight:950}.stock-page .stock-pill.category{color:#2563eb;background:#dbeafe}.stock-page .stock-pill.in{color:#16a34a;background:#dcfce7}.stock-page .stock-pill.low{color:#d97706;background:#fef3c7}.stock-page .stock-pill.out{color:#dc2626;background:#fee2e2}.stock-page .qty-in{color:#16a34a}.stock-page .qty-low{color:#d97706}.stock-page .qty-out{color:#dc2626}.stock-page .stock-dots{border:0;background:transparent;color:#0f172a;cursor:pointer}.stock-page .stock-empty-state{min-height:140px;display:grid;place-items:center;gap:8px;color:#0f9f6e}.stock-page .stock-empty-state i{font-size:34px}.stock-page .stock-empty-state strong{font-size:14px;font-weight:950;letter-spacing:.08em}.stock-page .stock-table-footer{display:flex;justify-content:space-between;align-items:center;padding:14px 20px;color:#0f172a;font-size:13px;font-weight:850}.stock-page .stock-table-footer select{margin:0 8px;height:34px;border:1px solid #dbe3ef;border-radius:8px;padding:0 10px;font-weight:900}.stock-page .stock-pagination{display:flex;gap:8px}.stock-page .stock-pagination button{width:36px;height:36px;border:1px solid #dbe3ef;border-radius:10px;background:#fff;color:#0f172a;font-weight:950}.stock-page .stock-pagination .active{background:#2563eb;color:#fff;border-color:#2563eb}
@media(max-width:1280px){.stock-page .stock-top-grid,.stock-page .stock-mid-grid{grid-template-columns:1fr}.stock-page .stock-kpi-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:980px){.stock-page .stock-filter-row{grid-template-columns:1fr 1fr}.stock-page .stock-movement{grid-template-columns:28px 72px 1fr}}@media(max-width:640px){.stock-page.premium-stock-dashboard{padding:18px}.stock-page .stock-dash-header{flex-direction:column}.stock-page .stock-primary-btn{width:100%}.stock-page .stock-kpi-grid,.stock-page .stock-filter-row,.stock-page .stock-status-layout,.stock-page .stock-category-layout{grid-template-columns:1fr}}

/* =========================================================
   FINAL STOCK MODULE UI POLISH
   Purpose: fix product table/footer alignment and readability
   ========================================================= */
.stock-page.premium-stock-dashboard {
  padding: 18px 22px 28px !important;
  background: #f8fafc;
}

.stock-page .stock-dash-header { margin-bottom: 4px; }
.stock-page .stock-dash-header h1,
.stock-page .stock-card-head h2,
.stock-page .stock-search-panel h2,
.stock-page .stock-table-head h2 { letter-spacing: -0.025em; }

.stock-page .stock-kpi-card strong {
  font-size: clamp(21px, 1.35vw, 25px) !important;
  line-height: 1.25;
  white-space: nowrap;
}

.stock-page .stock-kpi-card span { min-height: 18px; }
.stock-page .stock-status-card { min-width: 0; overflow: hidden; }
.stock-page .stock-status-layout { grid-template-columns: 150px minmax(0, 1fr) !important; }
.stock-page .stock-status-line,
.stock-page .stock-category-line { grid-template-columns: 12px minmax(92px, .8fr) minmax(120px, 1fr) !important; }
.stock-page .stock-status-line em,
.stock-page .stock-category-line em { white-space: nowrap; }

.stock-page .stock-premium-table {
  min-width: 1240px;
  table-layout: auto;
  font-size: 13px !important;
}

.stock-page .stock-premium-table th,
.stock-page .stock-premium-table td {
  padding: 12px 14px !important;
  font-size: 13px !important;
  line-height: 1.35;
  vertical-align: middle;
}

.stock-page .stock-premium-table th:nth-child(1), .stock-page .stock-premium-table td:nth-child(1) { min-width: 54px; white-space: nowrap; }
.stock-page .stock-premium-table th:nth-child(2), .stock-page .stock-premium-table td:nth-child(2) { min-width: 210px; }
.stock-page .stock-premium-table th:nth-child(3), .stock-page .stock-premium-table td:nth-child(3) { min-width: 100px; white-space: nowrap; }
.stock-page .stock-premium-table th:nth-child(4), .stock-page .stock-premium-table td:nth-child(4) { min-width: 120px; white-space: nowrap; }
.stock-page .stock-premium-table th:nth-child(5), .stock-page .stock-premium-table td:nth-child(5) { min-width: 126px; white-space: nowrap; }
.stock-page .stock-premium-table th:nth-child(6), .stock-page .stock-premium-table td:nth-child(6) { min-width: 78px; white-space: nowrap; }
.stock-page .stock-premium-table th:nth-child(7), .stock-page .stock-premium-table td:nth-child(7) { min-width: 135px; white-space: nowrap; }
.stock-page .stock-premium-table th:nth-child(8), .stock-page .stock-premium-table td:nth-child(8) { min-width: 120px; white-space: nowrap; }
.stock-page .stock-premium-table th:nth-child(9), .stock-page .stock-premium-table td:nth-child(9) { min-width: 150px; white-space: nowrap; }
.stock-page .stock-premium-table th:nth-child(10), .stock-page .stock-premium-table td:nth-child(10) { min-width: 120px; white-space: nowrap; }

.stock-page .stock-table-footer,
.stock-page .stock-table-footer .table-footer-size {
  display: flex !important;
  align-items: center !important;
  gap: 8px;
  white-space: nowrap;
}

.stock-page .stock-table-footer {
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
}

.stock-page .stock-table-footer select {
  width: 88px !important;
  margin: 0 !important;
  flex: 0 0 88px;
}

.stock-page .stock-table-actions button,
.purchase-list-page .purchase-table-actions button,
.expense-list-page .expense-table-actions button,
.sales-list-page .sales-table-actions button {
  white-space: nowrap;
}

@media (max-width: 1500px) {
  .stock-page .stock-status-layout { grid-template-columns: 1fr !important; }
  .stock-page .stock-donut { justify-self: center; }
}


/* =========================================================
   UI VISIBILITY FIX ONLY
   Purpose: table footer spacing, select visibility, pagination alignment
   ========================================================= */
.stock-page .stock-table-footer {
  min-height: 64px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  flex-wrap: wrap !important;
  padding: 14px 20px 18px !important;
  border-top: 1px solid #eef2f7;
  line-height: 1.35 !important;
}
.stock-page .stock-table-footer .table-footer-size {
  min-height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  white-space: nowrap !important;
  line-height: 1.35 !important;
}
.stock-page .stock-table-footer select {
  width: 88px !important;
  min-width: 88px !important;
  height: 42px !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 0 34px 0 14px !important;
  line-height: 42px !important;
  border: 1px solid #dbe3ef !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #0f172a !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  appearance: auto !important;
  -webkit-appearance: menulist !important;
}
.stock-page .stock-pagination {
  min-height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  margin-left: auto !important;
}
.stock-page .stock-pagination button {
  min-width: 42px !important;
  width: 42px !important;
  min-height: 42px !important;
  height: 42px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  line-height: 1 !important;
}
@media (max-width: 640px) {
  .stock-page .stock-pagination { width: 100%; }
}


/* Stock Status Overview clipping fix only */
.stock-page .stock-status-card { overflow: visible !important; min-width: 0 !important; }
.stock-page .stock-status-layout {
  grid-template-columns: 150px minmax(300px, 1fr) !important;
  gap: 24px !important;
}
.stock-page .stock-status-legend { min-width: 300px !important; width: 100%; }
.stock-page .stock-status-line {
  grid-template-columns: 12px minmax(94px, 1fr) minmax(118px, auto) !important;
  gap: 10px !important;
  line-height: 1.35 !important;
}
.stock-page .stock-status-line strong,
.stock-page .stock-status-line em {
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
.stock-page .stock-status-line em { justify-self: end; min-width: 118px; text-align: right; }
@media (max-width: 1500px) {
  .stock-page .stock-status-layout { grid-template-columns: 1fr !important; }
  .stock-page .stock-status-legend { min-width: 0 !important; }
}

/* =========================================================
   STOCK PRODUCT FORM - INLINE STOCK MODULE
   Purpose:
   - Add Product form opens from Stock module
   - No separate add-product JS/CSS required
   ========================================================= */

.stock-product-form-page {
  padding-bottom: 32px;
}

.stock-product-form-page .product-form-header {
  align-items: center;
}

.stock-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stock-product-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.stock-product-form-main {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.stock-product-form-sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 18px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: none;
}

.stock-product-form-sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.stock-product-form-card,
.stock-product-summary-card {
  padding: 24px;
}

.product-form-card-head {
  justify-content: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.product-form-card-head h2 {
  margin: 0;
}

.product-form-card-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
}

.stock-form-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: #eff6ff;
  color: #2563eb;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex: 0 0 auto;
}

.stock-form-icon.green {
  background: #ecfdf5;
  color: #059669;
}

.stock-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.stock-form-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.stock-form-field.span-2 {
  grid-column: span 2;
}

.stock-form-field span {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stock-form-field b {
  color: #ef4444;
}

.stock-form-field input,
.stock-form-field select {
  width: 100%;
  height: 50px;
  border: 1px solid #dbe3ef;
  border-radius: 15px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
  padding: 0 14px;
  outline: none;
  transition: 0.2s ease;
}

.stock-form-field input:focus,
.stock-form-field select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.stock-form-field input[readonly] {
  background: #f8fafc;
  color: #64748b;
}

.stock-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #eef2f7;
}

.stock-summary-row span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.stock-summary-row strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
  text-align: right;
}

.stock-summary-note {
  margin-top: 16px;
  padding: 14px;
  border-radius: 16px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  gap: 10px;
}

@media (max-width: 1180px) {
  .stock-product-form-layout {
    grid-template-columns: 1fr;
  }

  .stock-product-form-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 820px) {
  .stock-form-grid {
    grid-template-columns: 1fr;
  }

  .stock-form-field.span-2 {
    grid-column: auto;
  }

  .stock-form-actions {
    width: 100%;
  }

  .stock-form-actions button {
    flex: 1 1 100%;
    justify-content: center;
  }
}
