/* =========================================================
   PREMIUM SAAS ERP PURCHASE PAGE
   Modern Glassmorphism + Card-Based Layout + Sticky Sidebar
   ========================================================= */
.purchase-page {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #60a5fa;
  --primary-soft: #eff6ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.15);
  
  /* Header height */
  --header-height: 72px;
  /* Footer height */
  --footer-height: 72px;
}
/* ==================== PAGE ROOT ==================== */
.purchase-page * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
.purchase-page {
  width: 100%;
  font-family: var(--font-main);
  color: var(--gray-800);
  min-height: 100vh;
  background: #f8fafc;
  padding-bottom: 0;
}
/* ==================== HEADER ==================== */
.purchase-page .purchase-header-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  padding: 0 32px;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.purchase-page .purchase-header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.purchase-page .purchase-back-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gray-100);
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s ease;
}
.purchase-page .purchase-back-btn:hover {
  background: var(--gray-200);
  transform: translateX(-2px);
}
.purchase-page .purchase-header-title-wrap h1 {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-600) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}
.purchase-page .purchase-number-badge {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-main);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
/* ==================== TOP STATS BAR (HIDDEN) ==================== */
.purchase-page .purchase-top-stats {
  display: none;  /* Hidden - stats now in sidebar summary */
}
.purchase-page .top-stat-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 16px 24px;
  min-width: 140px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.purchase-page .top-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.purchase-page .top-stat-card span {
  display: block;
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 500;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.purchase-page .top-stat-card strong {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-800);
}
/* ==================== MAIN LAYOUT ==================== */
.purchase-page .purchase-main-layout {
  display: grid !important;
  grid-template-columns: 1fr 380px !important;
  gap: 28px;
  align-items: start;
  padding: 28px 32px;
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
}
.purchase-page .purchase-content-area {
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  max-height: calc(100vh - var(--header-height) - var(--footer-height) - 56px);
  padding-right: 8px;
}
/* ==================== STICKY SIDEBAR ==================== */
.purchase-page .purchase-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 28px);
  width: 380px;
  max-height: calc(100vh - var(--header-height) - var(--footer-height) - 56px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: fit-content;
  overflow-y: auto;
  scrollbar-width: thin;
}
.purchase-page .purchase-sidebar::-webkit-scrollbar {
  width: 6px;
}
.purchase-page .purchase-sidebar::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}
.purchase-page .purchase-sidebar::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 10px;
  transition: background 0.2s ease;
}
.purchase-page .purchase-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}
/* ==================== CARDS ==================== */
.purchase-page .neo-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.07);
  transition: box-shadow 0.2s ease;
  overflow: hidden;
  flex-shrink: 0;
}
.purchase-page .neo-card:hover {
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.1);
}
.purchase-page .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px 28px;
  border-bottom: 1px solid var(--gray-200);
  background: rgba(255, 255, 255, 0.5);
}
.purchase-page .card-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.purchase-page .card-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary-soft) 0%, #fff 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 20px;
  flex-shrink: 0;
}
.purchase-page .card-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-800);
}
.purchase-page .card-header p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--gray-500);
}
.purchase-page .card-body {
  padding: 24px 28px;
}
/* ==================== FORM STYLES ==================== */
.purchase-page .form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.purchase-page .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.purchase-page .form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.purchase-page .form-group label .required {
  color: var(--danger);
}
.purchase-page .form-group input,
.purchase-page .form-group select,
.purchase-page .form-group textarea {
  padding: 12px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: 14px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: white;
  font-family: inherit;
}
.purchase-page .form-group input:focus,
.purchase-page .form-group select:focus,
.purchase-page .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.purchase-page .form-group input.readonly-input {
  background: var(--gray-50);
  color: var(--gray-500);
  cursor: not-allowed;
}
/* ==================== ITEMS GRID (MODERN CARD-BASED) ==================== */
.purchase-page .purchase-items-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.purchase-page .item-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 20px;
  transition: all 0.25s ease;
}
.purchase-page .item-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}
.purchase-page .item-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-100);
}
.purchase-page .item-number {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.purchase-page .delete-item-btn {
  background: rgba(239, 68, 68, 0.1);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--danger);
  cursor: pointer;
  transition: all 0.2s ease;
}
.purchase-page .delete-item-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.05);
}
.purchase-page .item-form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.purchase-page .item-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.purchase-page .item-field.span-2 {
  grid-column: span 2;
}
.purchase-page .item-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.purchase-page .item-field input,
.purchase-page .item-field select {
  padding: 10px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  font-size: 13px;
  transition: all 0.2s ease;
  background: white;
}
.purchase-page .item-field input:focus,
.purchase-page .item-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.purchase-page .item-card-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
}
.purchase-page .item-total {
  text-align: right;
}
.purchase-page .item-total span {
  display: block;
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 500;
  text-transform: uppercase;
}
.purchase-page .item-total strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}
/* ==================== ACTION BUTTONS ==================== */
.purchase-page .items-actions-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.purchase-page .btn {
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: inherit;
}
.purchase-page .btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: var(--shadow-sm);
}
.purchase-page .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.purchase-page .btn-secondary {
  background: white;
  border: 1.5px solid var(--gray-200);
  color: var(--gray-700);
}
.purchase-page .btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.purchase-page .btn-ghost {
  background: transparent;
  color: var(--gray-600);
}
.purchase-page .btn-ghost:hover {
  background: var(--gray-100);
}
/* ==================== SIDEBAR SUMMARY ==================== */
.purchase-page .summary-card {
  background: linear-gradient(135deg, #fff 0%, var(--gray-50) 100%);
}
.purchase-page .summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}
.purchase-page .summary-line span {
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 500;
}
.purchase-page .summary-line strong {
  color: var(--gray-800);
  font-weight: 700;
  font-size: 15px;
  word-break: break-word;
  text-align: right;
}
.purchase-page .summary-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gray-200), transparent);
  margin: 16px 0;
}
.purchase-page .input-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.purchase-page .input-row label {
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 500;
}
.purchase-page .input-row input {
  width: 120px;
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  text-align: right;
  font-size: 13px;
  transition: all 0.2s ease;
}
.purchase-page .input-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.purchase-page .grand-total-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 20px;
  padding: 20px;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}
.purchase-page .grand-total-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}
.purchase-page .grand-total-card span {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 500;
}
.purchase-page .grand-total-card strong {
  color: white;
  font-size: 20px;
  font-weight: 800;
  text-align: right;
  word-break: break-word;
}
/* ==================== PAYMENT SECTION ==================== */
.purchase-page .payment-card {
  background: linear-gradient(135deg, #fff 0%, var(--gray-50) 100%);
}
.purchase-page .payment-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  margin-top: 12px;
}
.purchase-page .payment-result.paid {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.purchase-page .payment-result.paid strong {
  color: var(--success);
}
.purchase-page .payment-result.due {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.purchase-page .payment-result.due strong {
  color: var(--danger);
}
.purchase-page .payment-result span {
  font-size: 14px;
  font-weight: 600;
}
.purchase-page .payment-result strong {
  font-size: 15px;
  font-weight: 700;
  text-align: right;
  word-break: break-word;
}
/* ==================== BOTTOM ACTION DOCK ==================== */
.purchase-page .purchase-footer-toolbar {
  position: sticky;
  bottom: 0;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: 16px 32px;
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 28px;
  z-index: 90;
  height: var(--footer-height);
  align-items: center;
}
.purchase-page .btn-cancel {
  background: white;
  border: 1.5px solid var(--gray-200);
  padding: 12px 28px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.purchase-page .btn-cancel:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}
.purchase-page .btn-save {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
  font-family: inherit;
}
.purchase-page .btn-save:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.purchase-page .btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
/* ==================== EMPTY STATE ==================== */
.purchase-page .empty-state {
  text-align: center;
  padding: 60px;
  color: var(--gray-500);
}
.purchase-page .empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}
/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
.purchase-page .purchase-main-layout {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }
.purchase-page .purchase-sidebar {
    position: static !important;
    top: auto !important;
    max-height: none !important;
    width: 100% !important;
    padding: 0;
  }
.purchase-page .item-form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
.purchase-page .item-field.span-2 {
    grid-column: span 1;
  }
.purchase-page .purchase-content-area {
    max-height: none !important;
    overflow-y: visible !important;
  }
}
@media (max-width: 768px) {
.purchase-page {
    --header-height: 64px;
    --footer-height: 80px;
  }
.purchase-page .form-grid {
    grid-template-columns: 1fr;
  }
.purchase-page .item-form-grid {
    grid-template-columns: 1fr;
  }
.purchase-page .purchase-header-bar {
    padding: 0 20px;
    min-height: var(--header-height);
  }
.purchase-page .purchase-header-title-wrap h1 {
    font-size: 18px;
  }
.purchase-page .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
  }
.purchase-page .card-body {
    padding: 20px;
  }
.purchase-page .purchase-footer-toolbar {
    flex-direction: column-reverse;
    padding: 12px 16px;
    height: auto;
  }
.purchase-page .btn-save,
.purchase-page .btn-cancel {
    width: 100%;
    justify-content: center;
  }
.purchase-page .purchase-main-layout {
    padding: 16px;
    gap: 16px;
  }
.purchase-page .purchase-content-area {
    gap: 16px;
  }
.purchase-page .purchase-sidebar {
    gap: 16px;
  }
}
/* ==================== SCROLLBAR STYLING ==================== */
.purchase-page ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.purchase-page ::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 10px;
}
.purchase-page ::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 10px;
}
.purchase-page ::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}
/* ==================== ANIMATIONS ==================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.purchase-page .neo-card {
  animation: fadeInUp 0.4s ease-out;
}
.purchase-page .item-card {
  animation: fadeInUp 0.3s ease-out;
}
/* =========================================================
   PURCHASE ITEM FOOTER + INLINE ADD BUTTON POLISH
   ========================================================= */
.purchase-page .items-actions-bar .btn-primary {
  display: none !important;
}
.purchase-page .premium-item-footer {
  justify-content: space-between !important;
  align-items: center !important;
  gap: 16px;
}
.purchase-page .premium-item-footer .btn-primary {
  min-width: 132px;
  justify-content: center;
}
.purchase-page .item-total strong {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.purchase-page .item-total strong small {
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 600;
}
.purchase-page .item-total {
  min-width: 210px;
}
.purchase-page .delete-item-btn.js-clear-item {
  color: var(--primary);
  background: var(--primary-soft);
}
.purchase-page .delete-item-btn.js-clear-item:hover {
  background: #dbeafe;
}
/* =========================================================
   PURCHASE SECTION ENHANCEMENTS
   Payment terms, supplier quick create, serial modal, clean scrollbars
   ========================================================= */
.purchase-page .purchase-content-area,
.purchase-page .purchase-sidebar {
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  transform: none !important;
}
.purchase-page .purchase-content-area::-webkit-scrollbar,
.purchase-page .purchase-sidebar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.purchase-page .purchase-content-area::-webkit-scrollbar-track,
.purchase-page .purchase-sidebar::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}
.purchase-page .purchase-content-area::-webkit-scrollbar-thumb,
.purchase-page .purchase-sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gray-300), var(--gray-400));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.purchase-page .purchase-content-area::-webkit-scrollbar-thumb:hover,
.purchase-page .purchase-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
  border: 2px solid transparent;
  background-clip: content-box;
}
.purchase-page .field-help {
  display: block;
  margin-top: 6px;
  color: var(--gray-500);
  font-size: 12px;
  line-height: 1.4;
}
.purchase-page .supplier-field-wrap {
  display: flex !important;
  align-items: stretch;
  gap: 10px !important;
}
.purchase-page .supplier-add-icon-btn,
.purchase-page .serial-open-btn,
.purchase-page .modal-close-btn {
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.purchase-page .supplier-add-icon-btn {
  width: 46px;
  min-width: 46px;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: var(--shadow-md);
}
.purchase-page .supplier-add-icon-btn:hover,
.purchase-page .serial-open-btn:hover,
.purchase-page .modal-close-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.purchase-page .purchase-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: modalFadeIn 0.18s ease-out;
}
.purchase-page .purchase-modal-backdrop[hidden] {
  display: none !important;
}
.purchase-page .purchase-modal {
  width: min(720px, 100%);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
  animation: modalSlideUp 0.22s ease-out;
}
.purchase-page .serial-modal {
  width: min(620px, 100%);
}
.purchase-page .purchase-modal-header,
.purchase-page .purchase-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--gray-200);
}
.purchase-page .purchase-modal-footer {
  border-top: 1px solid var(--gray-200);
  border-bottom: 0;
  justify-content: flex-end;
}
.purchase-page .purchase-modal-header h3 {
  margin: 0 0 4px;
  color: var(--gray-900);
  font-size: 20px;
  font-weight: 800;
}
.purchase-page .purchase-modal-header p {
  margin: 0;
  color: var(--gray-500);
  font-size: 13px;
}
.purchase-page .purchase-modal-body {
  padding: 22px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.purchase-page .supplier-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.purchase-page .supplier-modal-grid .span-2 {
  grid-column: span 2;
}
.purchase-page .modal-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gray-100);
  color: var(--gray-600);
}
.purchase-page .serial-field-wrap {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
  align-items: center;
}
.purchase-page .serial-field-wrap input[readonly] {
  cursor: pointer;
  background: white;
}
.purchase-page .serial-open-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--primary);
  background: var(--primary-soft);
}
.purchase-page .serial-entry-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.purchase-page .serial-error {
  min-height: 20px;
  margin-top: 8px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}
.purchase-page .serial-meta {
  margin: 10px 0 14px;
  color: var(--gray-600);
  font-size: 14px;
}
.purchase-page .serial-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 2px;
}
.purchase-page .serial-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 9px 12px;
  border-radius: 999px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--gray-800);
  font-weight: 600;
  font-size: 13px;
}
.purchase-page .serial-pill button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: white;
  color: var(--gray-500);
  cursor: pointer;
}
.purchase-page .serial-empty {
  width: 100%;
  padding: 20px;
  text-align: center;
  color: var(--gray-500);
  background: var(--gray-50);
  border: 1px dashed var(--gray-300);
  border-radius: 16px;
}
.purchase-page .due-notification-card {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: white;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
}
.purchase-page .due-notification-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--warning);
  background: #fffbeb;
}
.purchase-page .due-notification-card strong {
  display: block;
  color: var(--gray-900);
  font-size: 13px;
  margin-bottom: 3px;
}
.purchase-page .due-notification-card p,
.purchase-page .due-notification-card small {
  display: block;
  margin: 0;
  color: var(--gray-500);
  font-size: 12px;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (max-width: 768px) {
.purchase-page .supplier-modal-grid,
.purchase-page .serial-entry-row {
    grid-template-columns: 1fr;
  }
.purchase-page .supplier-modal-grid .span-2 {
    grid-column: span 1;
  }
.purchase-page .purchase-modal-header,
.purchase-page .purchase-modal-footer,
.purchase-page .purchase-modal-body {
    padding: 16px;
  }
}
/* =========================================================
   PURCHASE SECTION UPDATE: CLEAN SCROLL + PRODUCT QUICK CREATE
   ========================================================= */
.purchase-page,
.purchase-page,
.purchase-page .purchase-main-layout,
.purchase-page .purchase-content-area,
.purchase-page .purchase-sidebar,
.purchase-page .purchase-modal-body {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.purchase-page .purchase-content-area,
.purchase-page .purchase-sidebar,
.purchase-page .purchase-modal-body {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(107, 114, 128, 0.55) transparent;
  transform: none !important;
  will-change: scroll-position;
}
.purchase-page .purchase-content-area::-webkit-scrollbar,
.purchase-page .purchase-sidebar::-webkit-scrollbar,
.purchase-page .purchase-modal-body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.purchase-page .purchase-content-area::-webkit-scrollbar-track,
.purchase-page .purchase-sidebar::-webkit-scrollbar-track,
.purchase-page .purchase-modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.purchase-page .purchase-content-area::-webkit-scrollbar-thumb,
.purchase-page .purchase-sidebar::-webkit-scrollbar-thumb,
.purchase-page .purchase-modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(156, 163, 175, 0.75), rgba(107, 114, 128, 0.75));
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}
.purchase-page .purchase-content-area::-webkit-scrollbar-thumb:hover,
.purchase-page .purchase-sidebar::-webkit-scrollbar-thumb:hover,
.purchase-page .purchase-modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(107, 114, 128, 0.9), rgba(75, 85, 99, 0.9));
  border: 3px solid transparent;
  background-clip: padding-box;
}
.purchase-page .neo-card:hover {
  transform: none;
}
.purchase-page .items-actions-bar {
  display: none !important;
}
.purchase-page .clean-items-grid {
  margin-top: 0;
}
.purchase-page .product-field-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 10px;
  align-items: stretch;
}
.purchase-page .product-add-icon-btn {
  width: 46px;
  min-width: 46px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.purchase-page .product-add-icon-btn:hover,
.purchase-page .product-add-icon-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  outline: none;
}
.purchase-page .product-modal {
  width: min(860px, 100%);
}
.purchase-page .product-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.purchase-page .product-modal-grid .span-2 {
  grid-column: span 2;
}
.purchase-page .field-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12) !important;
}
@media (max-width: 768px) {
.purchase-page .product-modal-grid {
    grid-template-columns: 1fr;
  }
.purchase-page .product-modal-grid .span-2 {
    grid-column: span 1;
  }
.purchase-page .product-field-wrap {
    grid-template-columns: minmax(0, 1fr) 44px;
  }
}
/* =========================================================
   FINAL FIX: ALWAYS VISIBLE FOOTER + NO SCROLL SCALE/Bounce
   Keeps footer buttons visible and removes remaining scaling
   from Purchase Summary / Invoice Details scroll areas.
   ========================================================= */
.purchase-page {
  --footer-height: 82px;
}
.purchase-page {
  min-height: 100vh;
  padding-bottom: calc(var(--footer-height) + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  overscroll-behavior: none;
}
.purchase-page .purchase-main-layout {
  padding-bottom: calc(var(--footer-height) + 28px) !important;
  min-height: calc(100vh - var(--header-height));
  overscroll-behavior: none;
}
.purchase-page .purchase-content-area,
.purchase-page .purchase-sidebar,
.purchase-page .summary-card,
.purchase-page .payment-card,
.purchase-page .purchase-modal-body {
  overscroll-behavior: none !important;
  -webkit-overflow-scrolling: auto !important;
  transform: none !important;
  scale: 1 !important;
}
.purchase-page .purchase-content-area,
.purchase-page .purchase-sidebar {
  max-height: calc(100vh - var(--header-height) - var(--footer-height) - 48px) !important;
  padding-bottom: 14px;
}
.purchase-page .purchase-footer-toolbar {
  position: fixed !important;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footer-height);
  margin: 0 !important;
  padding: 14px clamp(16px, 4vw, 32px) calc(14px + env(safe-area-inset-bottom, 0px));
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.07);
  z-index: 9999;
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}
/* Remove remaining hover/scroll scale effects from summary and invoice panels */
.purchase-page .neo-card:hover,
.purchase-page .summary-card:hover,
.purchase-page .payment-card:hover,
.purchase-page .grand-total-card:hover,
.purchase-page .purchase-sidebar .neo-card:hover,
.purchase-page .purchase-content-area .neo-card:hover {
  transform: none !important;
}
.purchase-page .grand-total-card {
  transition: box-shadow 0.2s ease, background 0.2s ease !important;
}
/* Modern clean scrollbar without stretching/bounce look */
.purchase-page .purchase-content-area::-webkit-scrollbar,
.purchase-page .purchase-sidebar::-webkit-scrollbar,
.purchase-page .purchase-modal-body::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}
.purchase-page .purchase-content-area::-webkit-scrollbar-track,
.purchase-page .purchase-sidebar::-webkit-scrollbar-track,
.purchase-page .purchase-modal-body::-webkit-scrollbar-track {
  background: transparent !important;
}
.purchase-page .purchase-content-area::-webkit-scrollbar-thumb,
.purchase-page .purchase-sidebar::-webkit-scrollbar-thumb,
.purchase-page .purchase-modal-body::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, 0.42) !important;
  border: 2px solid transparent !important;
  border-radius: 999px !important;
  background-clip: padding-box !important;
}
.purchase-page .purchase-content-area::-webkit-scrollbar-thumb:hover,
.purchase-page .purchase-sidebar::-webkit-scrollbar-thumb:hover,
.purchase-page .purchase-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(75, 85, 99, 0.68) !important;
  background-clip: padding-box !important;
}
@media (max-width: 768px) {
.purchase-page {
    --footer-height: 92px;
  }
.purchase-page .purchase-footer-toolbar {
    justify-content: stretch;
    gap: 10px;
  }
.purchase-page .purchase-footer-toolbar .btn-cancel,
.purchase-page .purchase-footer-toolbar .btn-save {
    flex: 1 1 0;
    justify-content: center;
    padding-inline: 14px;
  }
.purchase-page .purchase-main-layout {
    padding-bottom: calc(var(--footer-height) + 20px) !important;
  }
}
/* =========================================================
   UPLOAD PAYMENT DOCUMENT SECTION
   ========================================================= */
.purchase-page .payment-document-card {
  overflow: hidden;
}
.purchase-page .payment-document-dropzone {
  width: 100%;
  min-height: 132px;
  border: 1.5px dashed rgba(37, 99, 235, 0.32);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  cursor: pointer;
  padding: 18px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.purchase-page .payment-document-dropzone:hover,
.purchase-page .payment-document-dropzone.is-dragging {
  border-color: rgba(37, 99, 235, 0.72);
  background: rgba(239, 246, 255, 0.82);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.10);
}
.purchase-page .payment-document-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.10);
  color: #2563eb;
  font-size: 18px;
}
.purchase-page .payment-document-dropzone strong {
  font-size: 14px;
  color: #111827;
}
.purchase-page .payment-document-dropzone small {
  color: #6b7280;
  font-size: 12px;
}
.purchase-page .payment-document-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.purchase-page .payment-document-empty {
  color: #6b7280;
  font-size: 12px;
  text-align: center;
  padding: 6px 0 0;
}
.purchase-page .payment-document-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 14px;
  background: #ffffff;
  padding: 10px;
}
.purchase-page .payment-document-file-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
}
.purchase-page .payment-document-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.purchase-page .payment-document-info strong {
  color: #111827;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.purchase-page .payment-document-info small {
  color: #6b7280;
  font-size: 12px;
}
.purchase-page .payment-document-remove {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 11px;
  background: rgba(239, 68, 68, 0.10);
  color: #dc2626;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, color 0.18s ease;
}
.purchase-page .payment-document-remove:hover {
  background: #dc2626;
  color: #ffffff;
}
@media (max-width: 1024px) {
.purchase-page .payment-document-dropzone {
    min-height: 118px;
  }
}
/* =========================================================
   ATTACHMENTS / SUPPORTING DOCUMENTS SECTION
   Polished upload UI matching payment document section
   ========================================================= */
.purchase-page .attachments-card,
.purchase-page .supporting-documents-card {
  overflow: hidden;
}
.purchase-page .supporting-document-dropzone {
  width: 100%;
  min-height: 148px;
  border: 1.5px dashed rgba(37, 99, 235, 0.32);
  border-radius: 20px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 1));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  padding: 22px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.purchase-page .supporting-document-dropzone:hover,
.purchase-page .supporting-document-dropzone.is-dragging {
  border-color: rgba(37, 99, 235, 0.72);
  background: rgba(239, 246, 255, 0.88);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.12);
}
.purchase-page .supporting-document-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.10);
  color: var(--primary);
  font-size: 20px;
}
.purchase-page .supporting-document-dropzone strong {
  color: var(--gray-900);
  font-size: 15px;
  font-weight: 700;
}
.purchase-page .supporting-document-dropzone small {
  color: var(--gray-500);
  font-size: 12px;
  line-height: 1.45;
  max-width: 420px;
}
.purchase-page .supporting-document-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.purchase-page .supporting-document-empty {
  color: var(--gray-500);
  font-size: 12px;
  text-align: center;
  padding: 7px 0 0;
}
.purchase-page .supporting-document-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 16px;
  background: #ffffff;
  padding: 11px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}
.purchase-page .supporting-document-file-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.purchase-page .supporting-document-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.purchase-page .supporting-document-info strong {
  color: var(--gray-900);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.purchase-page .supporting-document-info small {
  color: var(--gray-500);
  font-size: 12px;
}
.purchase-page .supporting-document-remove {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.10);
  color: #dc2626;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.purchase-page .supporting-document-remove:hover {
  background: #dc2626;
  color: #ffffff;
  transform: translateY(-1px);
}
@media (max-width: 768px) {
.purchase-page .supporting-document-dropzone {
    min-height: 126px;
    padding: 18px;
  }
.purchase-page .supporting-document-item {
    grid-template-columns: 38px minmax(0, 1fr) 34px;
  }
}
/* =========================================================
   CLEAN ERP FIXED LAYOUT + PREMIUM SCROLL SYSTEM
   Purpose:
   - Body/page does not scroll while Purchase Invoice is open
   - Left Invoice area and Right Summary area scroll independently
   - Header, Sidebar and Footer remain stable/fixed
   - Footer aligns with content shell and never overlaps sidebar
   ========================================================= */
.purchase-page {
  --erp-sidebar-left: var(--sidebar-width, var(--app-sidebar-width, 260px));
  --erp-header-height: var(--header-height, 72px);
  --erp-footer-height: 82px;
  --erp-shell-padding-x: 32px;
  --erp-shell-padding-y: 24px;
  --erp-shell-gap: 28px;
  --erp-summary-width: minmax(340px, 30%);
  --erp-content-max-width: 1600px;
  --erp-scrollbar-size: 10px;
}



.purchase-page.modern-purchase-page {
  position: fixed !important;
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--erp-sidebar-left);
  width: auto !important;
  min-height: 0 !important;
  height: 100vh !important;
  overflow: hidden !important;
  padding: 0 !important;
  overscroll-behavior: none !important;
  background: #f8fafc;
}
/* Header follows the exact same content shell as the footer */
.purchase-page .purchase-header-bar {
  position: fixed !important;
  top: 0;
  left: var(--erp-sidebar-left);
  right: 0;
  height: var(--erp-header-height);
  min-height: var(--erp-header-height);
  margin: 0 !important;
  padding: 0 var(--erp-shell-padding-x) !important;
  z-index: 1100;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
}
.purchase-page .purchase-main-layout {
  position: fixed !important;
  top: var(--erp-header-height);
  right: 0;
  bottom: var(--erp-footer-height);
  left: var(--erp-sidebar-left);
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: var(--erp-shell-padding-y) var(--erp-shell-padding-x) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 70%) var(--erp-summary-width) !important;
  gap: var(--erp-shell-gap) !important;
  align-items: stretch !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}
.purchase-page .purchase-content-area,
.purchase-page .purchase-sidebar {
  min-height: 0 !important;
  height: 100% !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.42) transparent;
  -webkit-overflow-scrolling: touch;
  transform: none !important;
  scale: 1 !important;
  will-change: scroll-position;
  contain: layout paint style;
}
.purchase-page .purchase-content-area {
  padding: 0 8px 24px 0 !important;
  gap: 24px !important;
}
.purchase-page .purchase-sidebar {
  position: relative !important;
  top: auto !important;
  width: auto !important;
  padding: 0 8px 24px 0 !important;
  gap: 20px !important;
  align-self: stretch !important;
}
/* Item table also gets controlled desktop-app scrolling */
.purchase-page .item-table-wrap,
.purchase-page .items-table-wrap,
.purchase-page .purchase-items-table-wrap,
.purchase-page .item-section-table,
.purchase-page .table-responsive {
  max-height: min(52vh, 520px);
  overflow: auto !important;
  overscroll-behavior: contain !important;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.42) transparent;
  -webkit-overflow-scrolling: touch;
}
.purchase-page .purchase-footer-toolbar {
  position: fixed !important;
  left: var(--erp-sidebar-left) !important;
  right: 0 !important;
  bottom: 0 !important;
  width: auto !important;
  height: var(--erp-footer-height) !important;
  min-height: var(--erp-footer-height) !important;
  margin: 0 !important;
  padding: 14px var(--erp-shell-padding-x) calc(14px + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 1100;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 14px !important;
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
  box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.07) !important;
}
/* Remove all scroll/hover bounce, scale, and layout jumping */
.purchase-page .purchase-content-area *,
.purchase-page .purchase-sidebar *,
.purchase-page .purchase-main-layout *,
.purchase-page .purchase-footer-toolbar *,
.purchase-page .purchase-header-bar * {
  overscroll-behavior: contain;
}
.purchase-page .neo-card:hover,
.purchase-page .summary-card:hover,
.purchase-page .payment-card:hover,
.purchase-page .grand-total-card:hover,
.purchase-page .attachments-card:hover,
.purchase-page .payment-document-card:hover,
.purchase-page .purchase-content-area .neo-card:hover,
.purchase-page .purchase-sidebar .neo-card:hover {
  transform: none !important;
}
.purchase-page .purchase-content-area,
.purchase-page .purchase-sidebar,
.purchase-page .summary-card,
.purchase-page .payment-card,
.purchase-page .grand-total-card,
.purchase-page .item-table-wrap,
.purchase-page .items-table-wrap,
.purchase-page .purchase-items-table-wrap,
.purchase-page .purchase-modal-body {
  animation-timing-function: ease-out;
  backface-visibility: hidden;
}
/* Premium modern scrollbar */
.purchase-page .purchase-content-area::-webkit-scrollbar,
.purchase-page .purchase-sidebar::-webkit-scrollbar,
.purchase-page .purchase-modal-body::-webkit-scrollbar,
.purchase-page .item-table-wrap::-webkit-scrollbar,
.purchase-page .items-table-wrap::-webkit-scrollbar,
.purchase-page .purchase-items-table-wrap::-webkit-scrollbar,
.purchase-page .table-responsive::-webkit-scrollbar {
  width: var(--erp-scrollbar-size) !important;
  height: var(--erp-scrollbar-size) !important;
}
.purchase-page .purchase-content-area::-webkit-scrollbar-track,
.purchase-page .purchase-sidebar::-webkit-scrollbar-track,
.purchase-page .purchase-modal-body::-webkit-scrollbar-track,
.purchase-page .item-table-wrap::-webkit-scrollbar-track,
.purchase-page .items-table-wrap::-webkit-scrollbar-track,
.purchase-page .purchase-items-table-wrap::-webkit-scrollbar-track,
.purchase-page .table-responsive::-webkit-scrollbar-track {
  background: transparent !important;
}
.purchase-page .purchase-content-area::-webkit-scrollbar-thumb,
.purchase-page .purchase-sidebar::-webkit-scrollbar-thumb,
.purchase-page .purchase-modal-body::-webkit-scrollbar-thumb,
.purchase-page .item-table-wrap::-webkit-scrollbar-thumb,
.purchase-page .items-table-wrap::-webkit-scrollbar-thumb,
.purchase-page .purchase-items-table-wrap::-webkit-scrollbar-thumb,
.purchase-page .table-responsive::-webkit-scrollbar-thumb {
  min-height: 44px;
  background: rgba(100, 116, 139, 0.36) !important;
  border: 3px solid transparent !important;
  border-radius: 999px !important;
  background-clip: padding-box !important;
}
.purchase-page .purchase-content-area::-webkit-scrollbar-thumb:hover,
.purchase-page .purchase-sidebar::-webkit-scrollbar-thumb:hover,
.purchase-page .purchase-modal-body::-webkit-scrollbar-thumb:hover,
.purchase-page .item-table-wrap::-webkit-scrollbar-thumb:hover,
.purchase-page .items-table-wrap::-webkit-scrollbar-thumb:hover,
.purchase-page .purchase-items-table-wrap::-webkit-scrollbar-thumb:hover,
.purchase-page .table-responsive::-webkit-scrollbar-thumb:hover {
  background: rgba(71, 85, 105, 0.62) !important;
  background-clip: padding-box !important;
}
.purchase-page .purchase-content-area::-webkit-scrollbar-corner,
.purchase-page .purchase-sidebar::-webkit-scrollbar-corner,
.purchase-page .purchase-modal-body::-webkit-scrollbar-corner,
.purchase-page .item-table-wrap::-webkit-scrollbar-corner,
.purchase-page .items-table-wrap::-webkit-scrollbar-corner,
.purchase-page .purchase-items-table-wrap::-webkit-scrollbar-corner,
.purchase-page .table-responsive::-webkit-scrollbar-corner {
  background: transparent !important;
}
/* Responsive ERP behavior */
@media (max-width: 1180px) {
.purchase-page {
    --erp-summary-width: minmax(320px, 34%);
    --erp-shell-padding-x: 22px;
    --erp-shell-gap: 20px;
  }
}
@media (max-width: 900px) {

.purchase-page.modern-purchase-page,
.purchase-page .purchase-header-bar,
.purchase-page .purchase-main-layout,
.purchase-page .purchase-footer-toolbar {
    left: 0 !important;
  }
.purchase-page .purchase-main-layout {
    grid-template-columns: 1fr !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
  }
.purchase-page .purchase-content-area,
.purchase-page .purchase-sidebar {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    contain: none;
  }
}
@media (max-width: 640px) {
.purchase-page {
    --erp-header-height: 76px;
    --erp-footer-height: 92px;
    --erp-shell-padding-x: 14px;
    --erp-shell-padding-y: 14px;
  }
.purchase-page .purchase-footer-toolbar {
    justify-content: stretch !important;
  }
.purchase-page .purchase-footer-toolbar .btn-cancel,
.purchase-page .purchase-footer-toolbar .btn-save {
    flex: 1 1 0;
    justify-content: center;
  }
}
/* =========================================================
   FINAL PREMIUM ERP DYNAMIC SIDEBAR + HIDDEN SCROLL FIX
   Purpose:
   - Uses JS-measured --erp-sidebar-left, so collapsed sidebar frees space
   - Header/content/footer move and resize together
   - Body remains fixed; only invoice + summary sections scroll
   - Wheel/trackpad scrolling works naturally over each section
   - Scrollbar UI is hidden/ultra-clean; no bounce/stretch/scale
   ========================================================= */
.purchase-page {
  --erp-sidebar-left: 0px;
  --erp-header-height: var(--header-height, 72px);
  --erp-footer-height: 82px;
  --erp-shell-padding-x: 32px;
  --erp-shell-padding-y: 24px;
  --erp-shell-gap: 28px;
  --erp-summary-column: minmax(340px, 30%);
  --erp-layout-transition: left 240ms cubic-bezier(0.22, 1, 0.36, 1),
                           width 240ms cubic-bezier(0.22, 1, 0.36, 1),
                           right 240ms cubic-bezier(0.22, 1, 0.36, 1),
                           padding 240ms cubic-bezier(0.22, 1, 0.36, 1);
}


.purchase-page.modern-purchase-page {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: var(--erp-sidebar-left) !important;
  width: auto !important;
  height: 100vh !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: var(--erp-layout-transition) !important;
}
.purchase-page .purchase-header-bar,
.purchase-page .purchase-footer-toolbar,
.purchase-page .purchase-main-layout {
  left: var(--erp-sidebar-left) !important;
  right: 0 !important;
  width: auto !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  transition: var(--erp-layout-transition), box-shadow 180ms ease, background-color 180ms ease !important;
}
.purchase-page .purchase-header-bar {
  position: fixed !important;
  top: 0 !important;
  height: var(--erp-header-height) !important;
  min-height: var(--erp-header-height) !important;
  padding: 0 var(--erp-shell-padding-x) !important;
  z-index: 1100 !important;
}
.purchase-page .purchase-main-layout {
  position: fixed !important;
  top: var(--erp-header-height) !important;
  bottom: var(--erp-footer-height) !important;
  height: auto !important;
  min-height: 0 !important;
  padding: var(--erp-shell-padding-y) var(--erp-shell-padding-x) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) var(--erp-summary-column) !important;
  gap: var(--erp-shell-gap) !important;
  align-items: stretch !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}
.purchase-page .purchase-footer-toolbar {
  position: fixed !important;
  bottom: 0 !important;
  height: var(--erp-footer-height) !important;
  min-height: var(--erp-footer-height) !important;
  padding: 14px var(--erp-shell-padding-x) calc(14px + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 1100 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 14px !important;
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
  box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.07) !important;
}
.purchase-page .purchase-content-area,
.purchase-page .purchase-sidebar {
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  scroll-behavior: smooth !important;
  -webkit-overflow-scrolling: touch;
  transform: none !important;
  scale: 1 !important;
  contain: layout paint style;
  will-change: scroll-position;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.purchase-page .purchase-content-area {
  padding: 0 2px 26px 0 !important;
}
.purchase-page .purchase-sidebar {
  position: relative !important;
  top: auto !important;
  align-self: stretch !important;
  width: auto !important;
  padding: 0 2px 26px 0 !important;
}
.purchase-page .purchase-content-area::-webkit-scrollbar,
.purchase-page .purchase-sidebar::-webkit-scrollbar,
.purchase-page .item-table-wrap::-webkit-scrollbar,
.purchase-page .items-table-wrap::-webkit-scrollbar,
.purchase-page .purchase-items-table-wrap::-webkit-scrollbar,
.purchase-page .table-responsive::-webkit-scrollbar,
.purchase-page .purchase-modal-body::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}
.purchase-page .item-table-wrap,
.purchase-page .items-table-wrap,
.purchase-page .purchase-items-table-wrap,
.purchase-page .table-responsive,
.purchase-page .purchase-modal-body {
  overflow: auto !important;
  overscroll-behavior: contain !important;
  scroll-behavior: smooth !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.purchase-page .neo-card:hover,
.purchase-page .summary-card:hover,
.purchase-page .payment-card:hover,
.purchase-page .grand-total-card:hover,
.purchase-page .attachments-card:hover,
.purchase-page .payment-document-card:hover,
.purchase-page .purchase-content-area .neo-card:hover,
.purchase-page .purchase-sidebar .neo-card:hover {
  transform: none !important;
  scale: 1 !important;
}
.purchase-page .purchase-content-area *,
.purchase-page .purchase-sidebar *,
.purchase-page .purchase-main-layout * {
  overscroll-behavior: contain;
}
@media (max-width: 1180px) {
.purchase-page {
    --erp-summary-column: minmax(320px, 34%);
    --erp-shell-padding-x: 22px;
    --erp-shell-gap: 20px;
  }
}
@media (max-width: 900px) {
.purchase-page {
    --erp-sidebar-left: 0px !important;
    --erp-shell-padding-x: 16px;
    --erp-shell-padding-y: 16px;
    --erp-footer-height: 92px;
  }
.purchase-page.modern-purchase-page,
.purchase-page .purchase-header-bar,
.purchase-page .purchase-footer-toolbar,
.purchase-page .purchase-main-layout {
    left: 0 !important;
  }
.purchase-page .purchase-main-layout {
    grid-template-columns: 1fr !important;
    overflow: hidden !important;
  }
.purchase-page .purchase-content-area,
.purchase-page .purchase-sidebar {
    overflow-y: auto !important;
  }
}
@media (max-width: 640px) {
.purchase-page {
    --erp-header-height: 76px;
    --erp-footer-height: 96px;
    --erp-shell-padding-x: 14px;
    --erp-shell-padding-y: 14px;
  }
.purchase-page .purchase-footer-toolbar {
    justify-content: stretch !important;
  }
.purchase-page .purchase-footer-toolbar .btn-cancel,
.purchase-page .purchase-footer-toolbar .btn-save {
    flex: 1 1 0;
    justify-content: center;
  }
}
/* =========================================================
   INVISIBLE PREMIUM SCROLL + NATURAL WHEEL SYSTEM
   Purpose:
   - Mouse wheel / trackpad scrolling remains enabled
   - Scrollbar UI is completely hidden
   - Body stays locked; only ERP panels scroll
   - No bounce, stretch, scale, or overscroll glow
   ========================================================= */

.purchase-page.modern-purchase-page,
.purchase-page .purchase-main-layout {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}
.purchase-page .purchase-content-area,
.purchase-page .purchase-sidebar,
.purchase-page .item-table-wrap,
.purchase-page .items-table-wrap,
.purchase-page .purchase-items-table-wrap,
.purchase-page .table-responsive,
.purchase-page .purchase-modal-body {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scroll-behavior: smooth;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none !important;          /* Firefox: hide scrollbar */
  -ms-overflow-style: none !important;       /* Legacy Edge/IE: hide scrollbar */
}
.purchase-page .item-table-wrap,
.purchase-page .items-table-wrap,
.purchase-page .purchase-items-table-wrap,
.purchase-page .table-responsive {
  overflow-x: auto !important;
}
.purchase-page .purchase-content-area::-webkit-scrollbar,
.purchase-page .purchase-sidebar::-webkit-scrollbar,
.purchase-page .item-table-wrap::-webkit-scrollbar,
.purchase-page .items-table-wrap::-webkit-scrollbar,
.purchase-page .purchase-items-table-wrap::-webkit-scrollbar,
.purchase-page .table-responsive::-webkit-scrollbar,
.purchase-page .purchase-modal-body::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
}
.purchase-page .purchase-content-area::-webkit-scrollbar-track,
.purchase-page .purchase-sidebar::-webkit-scrollbar-track,
.purchase-page .item-table-wrap::-webkit-scrollbar-track,
.purchase-page .items-table-wrap::-webkit-scrollbar-track,
.purchase-page .purchase-items-table-wrap::-webkit-scrollbar-track,
.purchase-page .table-responsive::-webkit-scrollbar-track,
.purchase-page .purchase-modal-body::-webkit-scrollbar-track,
.purchase-page .purchase-content-area::-webkit-scrollbar-thumb,
.purchase-page .purchase-sidebar::-webkit-scrollbar-thumb,
.purchase-page .item-table-wrap::-webkit-scrollbar-thumb,
.purchase-page .items-table-wrap::-webkit-scrollbar-thumb,
.purchase-page .purchase-items-table-wrap::-webkit-scrollbar-thumb,
.purchase-page .table-responsive::-webkit-scrollbar-thumb,
.purchase-page .purchase-modal-body::-webkit-scrollbar-thumb {
  background: transparent !important;
  border: 0 !important;
}
.purchase-page .purchase-content-area,
.purchase-page .purchase-sidebar {
  scrollbar-gutter: auto !important;
  touch-action: pan-y;
}
.purchase-page .item-table-wrap,
.purchase-page .items-table-wrap,
.purchase-page .purchase-items-table-wrap,
.purchase-page .table-responsive {
  touch-action: pan-x pan-y;
}
.purchase-page .neo-card:hover,
.purchase-page .summary-card:hover,
.purchase-page .payment-card:hover,
.purchase-page .grand-total-card:hover,
.purchase-page .attachments-card:hover,
.purchase-page .payment-document-card:hover {
  transform: none !important;
}
/* =========================================================
   FINAL PERFORMANCE SCROLL OVERRIDE
   Purpose:
   - Faster, lighter internal ERP scrolling
   - Hidden scrollbars remain fully functional
   - Removes heavy smooth/will-change/contain/backdrop effects
   - Keeps fixed header, footer, sidebar and body scroll lock
   ========================================================= */

.purchase-page.modern-purchase-page,
.purchase-page .purchase-main-layout {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  scroll-behavior: auto !important;
}
.purchase-page .purchase-content-area,
.purchase-page .purchase-sidebar,
.purchase-page .item-table-wrap,
.purchase-page .items-table-wrap,
.purchase-page .purchase-items-table-wrap,
.purchase-page .item-section-table,
.purchase-page .table-responsive,
.purchase-page .purchase-modal-body,
.purchase-page .purchase-modal-content,
.purchase-page .modal-body {
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  scroll-behavior: auto !important;
  -webkit-overflow-scrolling: auto !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  will-change: auto !important;
  contain: none !important;
  transform: none !important;
  backface-visibility: visible !important;
}
.purchase-page .item-table-wrap,
.purchase-page .items-table-wrap,
.purchase-page .purchase-items-table-wrap,
.purchase-page .item-section-table,
.purchase-page .table-responsive {
  overflow-x: auto !important;
}
.purchase-page .purchase-content-area::-webkit-scrollbar,
.purchase-page .purchase-sidebar::-webkit-scrollbar,
.purchase-page .item-table-wrap::-webkit-scrollbar,
.purchase-page .items-table-wrap::-webkit-scrollbar,
.purchase-page .purchase-items-table-wrap::-webkit-scrollbar,
.purchase-page .item-section-table::-webkit-scrollbar,
.purchase-page .table-responsive::-webkit-scrollbar,
.purchase-page .purchase-modal-body::-webkit-scrollbar,
.purchase-page .purchase-modal-content::-webkit-scrollbar,
.purchase-page .modal-body::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
}
.purchase-page .purchase-content-area::-webkit-scrollbar-track,
.purchase-page .purchase-sidebar::-webkit-scrollbar-track,
.purchase-page .item-table-wrap::-webkit-scrollbar-track,
.purchase-page .items-table-wrap::-webkit-scrollbar-track,
.purchase-page .purchase-items-table-wrap::-webkit-scrollbar-track,
.purchase-page .item-section-table::-webkit-scrollbar-track,
.purchase-page .table-responsive::-webkit-scrollbar-track,
.purchase-page .purchase-modal-body::-webkit-scrollbar-track,
.purchase-page .purchase-modal-content::-webkit-scrollbar-track,
.purchase-page .modal-body::-webkit-scrollbar-track,
.purchase-page .purchase-content-area::-webkit-scrollbar-thumb,
.purchase-page .purchase-sidebar::-webkit-scrollbar-thumb,
.purchase-page .item-table-wrap::-webkit-scrollbar-thumb,
.purchase-page .items-table-wrap::-webkit-scrollbar-thumb,
.purchase-page .purchase-items-table-wrap::-webkit-scrollbar-thumb,
.purchase-page .item-section-table::-webkit-scrollbar-thumb,
.purchase-page .table-responsive::-webkit-scrollbar-thumb,
.purchase-page .purchase-modal-body::-webkit-scrollbar-thumb,
.purchase-page .purchase-modal-content::-webkit-scrollbar-thumb,
.purchase-page .modal-body::-webkit-scrollbar-thumb {
  background: transparent !important;
  border: 0 !important;
}
.purchase-page .purchase-header-bar,
.purchase-page .purchase-footer-toolbar {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.purchase-page .purchase-content-area *,
.purchase-page .purchase-sidebar *,
.purchase-page .item-table-wrap *,
.purchase-page .items-table-wrap *,
.purchase-page .purchase-items-table-wrap *,
.purchase-page .table-responsive * {
  will-change: auto !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
.purchase-page.modern-purchase-page,
.purchase-page .purchase-header-bar,
.purchase-page .purchase-footer-toolbar,
.purchase-page .purchase-main-layout {
    transition: none !important;
  }
}
/* =========================================================
   FINAL BALANCED ERP SCROLL SYSTEM
   Purpose:
   - Medium-speed, controlled internal scrolling
   - Enables wheel/trackpad scroll for invoice, summary, tables,
     sidebar navigation, notification dropdowns and all modal bodies
   - Keeps body/page locked and scrollbar UI invisible
   - Removes bounce/stretch while avoiding heavy rendering effects
   ========================================================= */


.purchase-page.modern-purchase-page,
.purchase-page .purchase-main-layout {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  scroll-behavior: auto !important;
}
.purchase-page .purchase-content-area,
.purchase-page .purchase-sidebar,
.purchase-page .item-table-wrap,
.purchase-page .items-table-wrap,
.purchase-page .purchase-items-table-wrap,
.purchase-page .item-section-table,
.purchase-page .table-responsive,
.purchase-page .purchase-modal-body,
.purchase-page .purchase-modal-content,
.purchase-page .modal-body,
.purchase-page .modal-content,
.purchase-page .popup-body,
.purchase-page .notification-dropdown,
.purchase-page .notifications-dropdown,
.purchase-page .notification-panel,
.purchase-page .notification-list,
.purchase-page .dropdown-menu,
.purchase-page .sidebar-nav,
.purchase-page .sidebar-menu,
.purchase-page .sidebar-menu-area,
.purchase-page .nav-menu,
.purchase-page .menu-scroll {
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  scroll-behavior: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  will-change: auto !important;
  contain: none !important;
  transform: none !important;
  backface-visibility: visible !important;
}
.purchase-page .item-table-wrap,
.purchase-page .items-table-wrap,
.purchase-page .purchase-items-table-wrap,
.purchase-page .item-section-table,
.purchase-page .table-responsive {
  overflow-x: auto !important;
}
.purchase-page .purchase-modal,
.purchase-page .product-modal,
.purchase-page .serial-modal {
  max-height: calc(100vh - 40px) !important;
  overflow: hidden !important;
}
.purchase-page .purchase-modal-body,
.purchase-page .purchase-modal-content,
.purchase-page .modal-body,
.purchase-page .popup-body {
  max-height: min(72vh, 680px) !important;
}
.purchase-page .notification-dropdown,
.purchase-page .notifications-dropdown,
.purchase-page .notification-panel,
.purchase-page .dropdown-menu {
  max-height: min(70vh, 520px);
}
.purchase-page .purchase-content-area::-webkit-scrollbar,
.purchase-page .purchase-sidebar::-webkit-scrollbar,
.purchase-page .item-table-wrap::-webkit-scrollbar,
.purchase-page .items-table-wrap::-webkit-scrollbar,
.purchase-page .purchase-items-table-wrap::-webkit-scrollbar,
.purchase-page .item-section-table::-webkit-scrollbar,
.purchase-page .table-responsive::-webkit-scrollbar,
.purchase-page .purchase-modal-body::-webkit-scrollbar,
.purchase-page .purchase-modal-content::-webkit-scrollbar,
.purchase-page .modal-body::-webkit-scrollbar,
.purchase-page .modal-content::-webkit-scrollbar,
.purchase-page .popup-body::-webkit-scrollbar,
.purchase-page .notification-dropdown::-webkit-scrollbar,
.purchase-page .notifications-dropdown::-webkit-scrollbar,
.purchase-page .notification-panel::-webkit-scrollbar,
.purchase-page .notification-list::-webkit-scrollbar,
.purchase-page .dropdown-menu::-webkit-scrollbar,
.purchase-page .sidebar-nav::-webkit-scrollbar,
.purchase-page .sidebar-menu::-webkit-scrollbar,
.purchase-page .sidebar-menu-area::-webkit-scrollbar,
.purchase-page .nav-menu::-webkit-scrollbar,
.purchase-page .menu-scroll::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
}
.purchase-page .purchase-content-area::-webkit-scrollbar-track,
.purchase-page .purchase-sidebar::-webkit-scrollbar-track,
.purchase-page .item-table-wrap::-webkit-scrollbar-track,
.purchase-page .items-table-wrap::-webkit-scrollbar-track,
.purchase-page .purchase-items-table-wrap::-webkit-scrollbar-track,
.purchase-page .item-section-table::-webkit-scrollbar-track,
.purchase-page .table-responsive::-webkit-scrollbar-track,
.purchase-page .purchase-modal-body::-webkit-scrollbar-track,
.purchase-page .purchase-modal-content::-webkit-scrollbar-track,
.purchase-page .modal-body::-webkit-scrollbar-track,
.purchase-page .modal-content::-webkit-scrollbar-track,
.purchase-page .popup-body::-webkit-scrollbar-track,
.purchase-page .notification-dropdown::-webkit-scrollbar-track,
.purchase-page .notifications-dropdown::-webkit-scrollbar-track,
.purchase-page .notification-panel::-webkit-scrollbar-track,
.purchase-page .notification-list::-webkit-scrollbar-track,
.purchase-page .dropdown-menu::-webkit-scrollbar-track,
.purchase-page .sidebar-nav::-webkit-scrollbar-track,
.purchase-page .sidebar-menu::-webkit-scrollbar-track,
.purchase-page .sidebar-menu-area::-webkit-scrollbar-track,
.purchase-page .nav-menu::-webkit-scrollbar-track,
.purchase-page .menu-scroll::-webkit-scrollbar-track,
.purchase-page .purchase-content-area::-webkit-scrollbar-thumb,
.purchase-page .purchase-sidebar::-webkit-scrollbar-thumb,
.purchase-page .item-table-wrap::-webkit-scrollbar-thumb,
.purchase-page .items-table-wrap::-webkit-scrollbar-thumb,
.purchase-page .purchase-items-table-wrap::-webkit-scrollbar-thumb,
.purchase-page .item-section-table::-webkit-scrollbar-thumb,
.purchase-page .table-responsive::-webkit-scrollbar-thumb,
.purchase-page .purchase-modal-body::-webkit-scrollbar-thumb,
.purchase-page .purchase-modal-content::-webkit-scrollbar-thumb,
.purchase-page .modal-body::-webkit-scrollbar-thumb,
.purchase-page .modal-content::-webkit-scrollbar-thumb,
.purchase-page .popup-body::-webkit-scrollbar-thumb,
.purchase-page .notification-dropdown::-webkit-scrollbar-thumb,
.purchase-page .notifications-dropdown::-webkit-scrollbar-thumb,
.purchase-page .notification-panel::-webkit-scrollbar-thumb,
.purchase-page .notification-list::-webkit-scrollbar-thumb,
.purchase-page .dropdown-menu::-webkit-scrollbar-thumb,
.purchase-page .sidebar-nav::-webkit-scrollbar-thumb,
.purchase-page .sidebar-menu::-webkit-scrollbar-thumb,
.purchase-page .sidebar-menu-area::-webkit-scrollbar-thumb,
.purchase-page .nav-menu::-webkit-scrollbar-thumb,
.purchase-page .menu-scroll::-webkit-scrollbar-thumb {
  background: transparent !important;
  border: 0 !important;
}
.purchase-page .purchase-content-area,
.purchase-page .purchase-sidebar,
.purchase-page .purchase-modal-body,
.purchase-page .notification-dropdown,
.purchase-page .notifications-dropdown,
.purchase-page .sidebar-nav,
.purchase-page .sidebar-menu,
.purchase-page .sidebar-menu-area {
  touch-action: pan-y;
}
.purchase-page .item-table-wrap,
.purchase-page .items-table-wrap,
.purchase-page .purchase-items-table-wrap,
.purchase-page .item-section-table,
.purchase-page .table-responsive {
  touch-action: pan-x pan-y;
}
.purchase-page .purchase-header-bar,
.purchase-page .purchase-footer-toolbar {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.purchase-page .purchase-content-area *,
.purchase-page .purchase-sidebar *,
.purchase-page .item-table-wrap *,
.purchase-page .items-table-wrap *,
.purchase-page .purchase-items-table-wrap *,
.purchase-page .table-responsive *,
.purchase-page .purchase-modal-body * {
  scroll-behavior: auto !important;
  will-change: auto !important;
}
@media (prefers-reduced-motion: reduce) {
.purchase-page.modern-purchase-page,
.purchase-page .purchase-header-bar,
.purchase-page .purchase-footer-toolbar,
.purchase-page .purchase-main-layout,
.purchase-page .purchase-modal {
    transition: none !important;
    animation: none !important;
  }
}


/* =========================================================
   PURCHASE CREATE PAGE — SCOPED SCROLL SHELL ONLY
   Keeps purchase visual style unchanged and avoids global locks.
   ========================================================= */
.purchase-page {
  --erp-sidebar-left: 0px;
  --erp-header-height: var(--header-height, 72px);
  --erp-footer-height: 82px;
  --erp-shell-padding-x: 32px;
  --erp-shell-padding-y: 24px;
  --erp-shell-gap: 28px;
  --erp-summary-column: minmax(340px, 30%);
  --erp-layout-transition: left 220ms cubic-bezier(0.22, 1, 0.36, 1),
                           right 220ms cubic-bezier(0.22, 1, 0.36, 1),
                           padding 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.purchase-page.modern-purchase-page {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: var(--erp-sidebar-left) !important;
  width: auto !important;
  height: 100vh !important;
  min-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  transition: var(--erp-layout-transition) !important;
  overscroll-behavior: contain !important;
}

.purchase-page .purchase-header-bar,
.purchase-page .purchase-main-layout,
.purchase-page .purchase-footer-toolbar {
  left: var(--erp-sidebar-left) !important;
  right: 0 !important;
  width: auto !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  transition: var(--erp-layout-transition), box-shadow 180ms ease, background-color 180ms ease !important;
}

.purchase-page .purchase-header-bar {
  position: fixed !important;
  top: 0 !important;
  height: var(--erp-header-height) !important;
  min-height: var(--erp-header-height) !important;
  padding: 0 var(--erp-shell-padding-x) !important;
  z-index: 1100 !important;
}

.purchase-page .purchase-main-layout {
  position: fixed !important;
  top: var(--erp-header-height) !important;
  bottom: var(--erp-footer-height) !important;
  height: auto !important;
  min-height: 0 !important;
  padding: var(--erp-shell-padding-y) var(--erp-shell-padding-x) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) var(--erp-summary-column) !important;
  gap: var(--erp-shell-gap) !important;
  align-items: stretch !important;
  overflow: hidden !important;
  overscroll-behavior: contain !important;
}

.purchase-page .purchase-footer-toolbar {
  position: fixed !important;
  bottom: 0 !important;
  height: var(--erp-footer-height) !important;
  min-height: var(--erp-footer-height) !important;
  padding: 14px var(--erp-shell-padding-x) calc(14px + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 1100 !important;
}

.purchase-page .purchase-content-area,
.purchase-page .purchase-sidebar,
.purchase-page .purchase-modal-body,
.purchase-page .purchase-modal-content,
.purchase-page .item-table-wrap,
.purchase-page .items-table-wrap,
.purchase-page .purchase-items-table-wrap,
.purchase-page .table-responsive,
.purchase-page .dropdown-menu,
.purchase-page .notification-dropdown,
.purchase-page .notifications-dropdown,
.purchase-page .notification-panel,
.purchase-page .notification-list {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.purchase-page .purchase-content-area,
.purchase-page .purchase-sidebar {
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: none !important;
  scroll-behavior: auto !important;
  transform: none !important;
  scale: 1 !important;
  contain: layout paint style;
}

.purchase-page .purchase-content-area { padding: 0 2px 26px 0 !important; }
.purchase-page .purchase-sidebar {
  position: relative !important;
  top: auto !important;
  align-self: stretch !important;
  width: auto !important;
  padding: 0 2px 26px 0 !important;
}

.purchase-page .purchase-content-area::-webkit-scrollbar,
.purchase-page .purchase-sidebar::-webkit-scrollbar,
.purchase-page .purchase-modal-body::-webkit-scrollbar,
.purchase-page .purchase-modal-content::-webkit-scrollbar,
.purchase-page .item-table-wrap::-webkit-scrollbar,
.purchase-page .items-table-wrap::-webkit-scrollbar,
.purchase-page .purchase-items-table-wrap::-webkit-scrollbar,
.purchase-page .table-responsive::-webkit-scrollbar,
.purchase-page .dropdown-menu::-webkit-scrollbar,
.purchase-page .notification-dropdown::-webkit-scrollbar,
.purchase-page .notifications-dropdown::-webkit-scrollbar,
.purchase-page .notification-panel::-webkit-scrollbar,
.purchase-page .notification-list::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

@media (max-width: 900px) {
  .purchase-page.modern-purchase-page,
  .purchase-page .purchase-header-bar,
  .purchase-page .purchase-main-layout,
  .purchase-page .purchase-footer-toolbar {
    left: 0 !important;
  }
  .purchase-page .purchase-main-layout {
    grid-template-columns: 1fr !important;
    overflow-y: auto !important;
  }
  .purchase-page .purchase-content-area,
  .purchase-page .purchase-sidebar {
    height: auto !important;
    max-height: none !important;
  }
}

/* =========================================================
   PURCHASE DETAIL PAGE - PREMIUM MULTI CURRENCY VIEW
   File: assets/css/purchase.css

   Scope:
   - Only affects Purchase Detail page
   ========================================================= */

.purchase-detail-page {
    --purchase-primary: #7c3aed;
    --purchase-primary-dark: #6d28d9;
    --purchase-primary-soft: #f3e8ff;
    --purchase-border: #e2e8f0;
    --purchase-muted: #64748b;
    --purchase-text: #0f172a;
    --purchase-soft-bg: #f8fafc;
    --purchase-card-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

.purchase-detail-page .purchase-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding: 22px 24px;
    background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%);
    border: 1px solid var(--purchase-border);
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.purchase-detail-page .purchase-detail-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--purchase-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.purchase-detail-page .purchase-detail-header h1 {
    margin: 0;
    color: var(--purchase-text);
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: -0.04em;
}

.purchase-detail-page .purchase-detail-header p {
    margin: 6px 0 0;
    color: var(--purchase-muted);
    font-size: 14px;
}

.purchase-detail-page .purchase-detail-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.purchase-detail-page .purchase-detail-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border-radius: 12px;
    font-weight: 800;
}

.purchase-detail-page .purchase-detail-actions .btn-primary {
    background: linear-gradient(135deg, var(--purchase-primary), var(--purchase-primary-dark));
    border-color: var(--purchase-primary);
    box-shadow: 0 10px 22px rgba(124, 58, 237, 0.22);
}

.purchase-detail-page .purchase-detail-loader {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid var(--purchase-border);
    border-radius: 22px;
    color: var(--purchase-muted);
    box-shadow: var(--purchase-card-shadow);
}

.purchase-detail-page .purchase-detail-loader strong {
    color: var(--purchase-text);
    font-size: 16px;
}

.purchase-detail-page .purchase-loader-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #ede9fe;
    border-top-color: var(--purchase-primary);
    border-radius: 999px;
    animation: purchaseLoaderSpin 0.8s linear infinite;
}

@keyframes purchaseLoaderSpin {
    to { transform: rotate(360deg); }
}

.purchase-detail-page .purchase-invoice-shell {
    background: #ffffff;
    border: 1px solid var(--purchase-border);
    border-radius: 24px;
    padding: 26px;
    box-shadow: var(--purchase-card-shadow);
}

.purchase-detail-page .purchase-invoice-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: stretch;
    padding: 22px;
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.14), transparent 34%),
        linear-gradient(135deg, #fbfaff 0%, #ffffff 100%);
    border: 1px solid #ede9fe;
    border-radius: 22px;
}

.purchase-detail-page .purchase-brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.purchase-detail-page .purchase-brand-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--purchase-primary), #a855f7);
    color: #ffffff;
    border-radius: 18px;
    font-size: 24px;
    font-weight: 900;
    box-shadow: 0 14px 30px rgba(124, 58, 237, 0.24);
}

.purchase-detail-page .purchase-brand-block h2 {
    margin: 0;
    color: var(--purchase-text);
    font-size: 28px;
    letter-spacing: -0.04em;
}

.purchase-detail-page .purchase-brand-block p {
    margin: 4px 0 0;
    color: var(--purchase-muted);
    font-weight: 700;
}

.purchase-detail-page .purchase-invoice-meta-card {
    min-width: 260px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid #ede9fe;
    border-radius: 18px;
}

.purchase-detail-page .purchase-invoice-meta-card div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.purchase-detail-page .purchase-invoice-meta-card span,
.purchase-detail-page .purchase-summary-card span,
.purchase-detail-page .purchase-total-row span,
.purchase-detail-page .purchase-info-row span {
    color: var(--purchase-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.purchase-detail-page .purchase-invoice-meta-card strong,
.purchase-detail-page .purchase-info-row strong,
.purchase-detail-page .purchase-total-row strong {
    color: var(--purchase-text);
    font-weight: 900;
}

.purchase-detail-page .purchase-detail-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.purchase-detail-page .purchase-summary-card {
    position: relative;
    overflow: hidden;
    min-height: 118px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid var(--purchase-border);
    border-radius: 20px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.purchase-detail-page .purchase-summary-card::after {
    content: "";
    position: absolute;
    right: -28px;
    top: -28px;
    width: 86px;
    height: 86px;
    border-radius: 999px;
    opacity: 0.16;
}

.purchase-detail-page .purchase-summary-card.is-vendor::after { background: #2563eb; }
.purchase-detail-page .purchase-summary-card.is-currency::after { background: #7c3aed; }
.purchase-detail-page .purchase-summary-card.is-foreign::after { background: #f59e0b; }
.purchase-detail-page .purchase-summary-card.is-local::after { background: #059669; }

.purchase-detail-page .purchase-summary-card strong {
    position: relative;
    z-index: 1;
    color: var(--purchase-text);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.2;
    word-break: break-word;
}

.purchase-detail-page .purchase-summary-card small {
    position: relative;
    z-index: 1;
    color: var(--purchase-muted);
    font-weight: 700;
}

.purchase-detail-page .purchase-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.purchase-detail-page .purchase-info-panel,
.purchase-detail-page .purchase-items-panel,
.purchase-detail-page .purchase-note-panel,
.purchase-detail-page .purchase-total-panel {
    background: #ffffff;
    border: 1px solid var(--purchase-border);
    border-radius: 20px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.purchase-detail-page .purchase-info-panel {
    padding: 18px;
}

.purchase-detail-page .purchase-panel-title,
.purchase-detail-page .purchase-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.purchase-detail-page .purchase-panel-title {
    justify-content: flex-start;
    margin-bottom: 14px;
}

.purchase-detail-page .purchase-panel-title i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: var(--purchase-primary);
    background: var(--purchase-primary-soft);
    border-radius: 12px;
}

.purchase-detail-page .purchase-panel-title h3,
.purchase-detail-page .purchase-note-panel h3,
.purchase-detail-page .purchase-total-title,
.purchase-detail-page .purchase-section-heading h2 {
    margin: 0;
    color: var(--purchase-text);
    font-weight: 900;
    letter-spacing: -0.02em;
}

.purchase-detail-page .purchase-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.purchase-detail-page .purchase-info-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.purchase-detail-page .purchase-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.purchase-detail-page .purchase-pill.is-success { color: #047857; background: #d1fae5; }
.purchase-detail-page .purchase-pill.is-danger { color: #b91c1c; background: #fee2e2; }
.purchase-detail-page .purchase-pill.is-warning { color: #b45309; background: #fef3c7; }
.purchase-detail-page .purchase-pill.is-muted { color: #475569; background: #e2e8f0; }
.purchase-detail-page .purchase-pill.is-cash { color: #047857; background: #d1fae5; }
.purchase-detail-page .purchase-pill.is-bank { color: #1d4ed8; background: #dbeafe; }
.purchase-detail-page .purchase-pill.is-partial { color: #b45309; background: #fef3c7; }
.purchase-detail-page .purchase-pill.is-credit { color: #7c2d12; background: #ffedd5; }
.purchase-detail-page .purchase-pill.is-neutral { color: #4338ca; background: #e0e7ff; }

.purchase-detail-page .purchase-items-panel {
    margin-top: 18px;
    overflow: hidden;
}

.purchase-detail-page .purchase-section-heading {
    padding: 20px 22px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--purchase-border);
}

.purchase-detail-page .purchase-section-heading p {
    margin: 5px 0 0;
    color: var(--purchase-muted);
    font-size: 13px;
    font-weight: 700;
}

.purchase-detail-page .purchase-section-heading > span {
    flex: 0 0 auto;
    padding: 8px 12px;
    color: var(--purchase-primary);
    background: var(--purchase-primary-soft);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.purchase-detail-page .purchase-detail-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.purchase-detail-page .purchase-detail-table {
    width: 100%;
    min-width: 1040px;
    border-collapse: separate;
    border-spacing: 0;
}

.purchase-detail-page .purchase-detail-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 14px 12px;
    color: #475569;
    background: #f8fafc;
    border-bottom: 1px solid var(--purchase-border);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.purchase-detail-page .purchase-detail-table td {
    padding: 16px 12px;
    color: var(--purchase-text);
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}

.purchase-detail-page .purchase-detail-table tbody tr:hover {
    background: #faf5ff;
}

.purchase-detail-page .purchase-detail-table tbody tr:last-child td {
    border-bottom: 0;
}

.purchase-detail-page .purchase-item-title {
    color: var(--purchase-text);
    font-weight: 900;
}

.purchase-detail-page .purchase-item-title.is-small {
    font-size: 13px;
}

.purchase-detail-page .purchase-item-subtitle {
    margin-top: 4px;
    color: var(--purchase-muted);
    font-size: 12px;
    font-weight: 700;
}

.purchase-detail-page .purchase-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 16px;
    align-items: start;
    margin-top: 18px;
}

.purchase-detail-page .purchase-notes-area {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.purchase-detail-page .purchase-note-panel,
.purchase-detail-page .purchase-total-panel {
    padding: 18px;
}

.purchase-detail-page .purchase-note-panel p {
    min-height: 44px;
    margin: 10px 0 0;
    color: var(--purchase-muted);
    line-height: 1.6;
}

.purchase-detail-page .purchase-total-title {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--purchase-border);
}

.purchase-detail-page .purchase-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
}

.purchase-detail-page .purchase-total-row.is-highlight {
    margin-top: 8px;
    padding: 14px;
    background: linear-gradient(135deg, #faf5ff, #ffffff);
    border: 1px solid #ede9fe;
    border-radius: 14px;
}

.purchase-detail-page .purchase-total-row.is-highlight strong {
    color: var(--purchase-primary-dark);
    font-size: 18px;
}

@media (max-width: 1180px) {
    .purchase-detail-page .purchase-detail-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .purchase-detail-page .purchase-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .purchase-detail-page .purchase-detail-header,
    .purchase-detail-page .purchase-invoice-hero,
    .purchase-detail-page .purchase-info-grid,
    .purchase-detail-page .purchase-notes-area {
        grid-template-columns: 1fr;
    }

    .purchase-detail-page .purchase-detail-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .purchase-detail-page .purchase-detail-actions {
        width: 100%;
        justify-content: stretch;
    }

    .purchase-detail-page .purchase-detail-actions .btn {
        flex: 1;
    }

    .purchase-detail-page .purchase-detail-summary-grid {
        grid-template-columns: 1fr;
    }

    .purchase-detail-page .purchase-invoice-meta-card {
        min-width: 0;
    }
}

@media print {
    .purchase-detail-page {
        background: #ffffff !important;
    }

    .purchase-detail-page .purchase-invoice-shell {
        border: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
    }

    .purchase-detail-page .purchase-invoice-hero,
    .purchase-detail-page .purchase-summary-card,
    .purchase-detail-page .purchase-info-panel,
    .purchase-detail-page .purchase-items-panel,
    .purchase-detail-page .purchase-note-panel,
    .purchase-detail-page .purchase-total-panel {
        box-shadow: none !important;
    }

    .purchase-detail-page .purchase-detail-table {
        min-width: 0 !important;
        font-size: 11px;
    }

    .purchase-detail-page .purchase-detail-table th,
    .purchase-detail-page .purchase-detail-table td {
        padding: 8px 6px;
    }
}

/* =========================================================
   PURCHASE DETAIL SERIAL DESCRIPTION ADJUSTMENT
   Scope: .purchase-detail-page only
   ========================================================= */

.purchase-detail-page .purchase-serial-description {
  max-width: 320px;
  color: #334155;
  font-size: 12px;
  line-height: 1.55;
  word-break: break-word;
}

.purchase-detail-page .purchase-detail-table {
  min-width: 1180px;
}
/* Transaction create pages open instantly: no fade/slide animation */
.purchase-page,.purchase-page *{animation:none!important}


/* =========================================================
   PURCHASE SERIAL MODAL SCROLL FIX V29
   Scope: purchase serial modal only
   ========================================================= */
.purchase-page .serial-modal .purchase-modal-body {
  overflow-y: auto !important;
  touch-action: pan-y !important;
}
.purchase-page .serial-list {
  max-height: 260px !important;
  min-height: 72px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  touch-action: pan-y !important;
  align-content: flex-start;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.purchase-page .serial-list::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}


/* =========================================================
   PURCHASE SERIAL ENTRY MODAL HIDDEN SCROLLBAR V31
   Scope: purchase serial entry modal only
   ========================================================= */
.purchase-page .serial-modal .purchase-modal-body {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.purchase-page .serial-modal .purchase-modal-body::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}
