/**
 * GOCA ERP - PO Consolidation Workbench Stylesheet
 * File: public/css/po-workbench.css
 * Purpose: Cung cấp đầy đủ Scoped CSS cho Bàn gom PR sang PO (Page_Ops_PO_Create)
 * Độc lập 100%, không phụ thuộc CDN, hỗ trợ Responsive Desktop / Tablet / Mobile và Print
 */

/* ========================================================================= */
/* 1. CSS VARIABLES & BASE SCOPE                                             */
/* ========================================================================= */
:root {
  --po-primary: #25478B;
  --po-primary-hover: #1A3668;
  --po-primary-light: #EFF6FF;
  --po-primary-border: #BFDBFE;

  --po-success: #059669;
  --po-success-light: #ECFDF5;
  --po-success-border: #A7F3D0;

  --po-warning: #D97706;
  --po-warning-light: #FFFBEB;
  --po-warning-border: #FDE68A;

  --po-danger: #DC2626;
  --po-danger-light: #FEF2F2;
  --po-danger-border: #FECACA;

  --po-slate-50: #F8FAFC;
  --po-slate-100: #F1F5F9;
  --po-slate-200: #E2E8F0;
  --po-slate-300: #CBD5E1;
  --po-slate-400: #94A3B8;
  --po-slate-500: #64748B;
  --po-slate-600: #475569;
  --po-slate-700: #334155;
  --po-slate-800: #1E293B;
  --po-slate-900: #0F172A;
}

.po-create-workspace {
  font-family: var(--font-sans, 'Inter', system-ui, -apple-system, sans-serif);
  color: var(--text-main, #0F172A);
  background-color: transparent;
  box-sizing: border-box;
  width: 100%;
}

.po-create-workspace *,
.po-create-workspace *::before,
.po-create-workspace *::after,
#modal-pr-detail *,
#modal-bang-gia-ncc *,
#modal-supplier-quote-lookup *,
#modal-po-product-history *,
#modal-po-linh-kien-lookup *,
#drawer-po-panel * {
  box-sizing: border-box;
}

/* ========================================================================= */
/* 2. TYPOGRAPHY & MONO                                                      */
/* ========================================================================= */
.font-mono-num,
.po-create-workspace .font-mono-num,
#drawer-po-panel .font-mono-num,
#modal-pr-detail .font-mono-num,
#modal-bang-gia-ncc .font-mono-num {
  font-family: 'JetBrains Mono', monospace !important;
  font-feature-settings: "tnum";
}

.po-create-workspace .text-\[9px\], #modal-pr-detail .text-\[9px\], #modal-bang-gia-ncc .text-\[9px\], #drawer-po-panel .text-\[9px\] { font-size: 9px; }
.po-create-workspace .text-\[10px\], #modal-pr-detail .text-\[10px\], #modal-bang-gia-ncc .text-\[10px\], #drawer-po-panel .text-\[10px\] { font-size: 10px; }
.po-create-workspace .text-\[11px\], #modal-pr-detail .text-\[11px\], #modal-bang-gia-ncc .text-\[11px\], #drawer-po-panel .text-\[11px\] { font-size: 11px; }
.po-create-workspace .text-xs, #modal-pr-detail .text-xs, #modal-bang-gia-ncc .text-xs, #drawer-po-panel .text-xs { font-size: 0.75rem; line-height: 1rem; }
.po-create-workspace .text-sm, #modal-pr-detail .text-sm, #modal-bang-gia-ncc .text-sm, #drawer-po-panel .text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.po-create-workspace .text-base, #modal-pr-detail .text-base, #modal-bang-gia-ncc .text-base, #drawer-po-panel .text-base { font-size: 1rem; line-height: 1.5rem; }
.po-create-workspace .text-lg, #modal-pr-detail .text-lg, #modal-bang-gia-ncc .text-lg, #drawer-po-panel .text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.po-create-workspace .text-xl, #modal-pr-detail .text-xl, #modal-bang-gia-ncc .text-xl, #drawer-po-panel .text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.po-create-workspace .text-2xl, #modal-pr-detail .text-2xl, #modal-bang-gia-ncc .text-2xl, #drawer-po-panel .text-2xl { font-size: 1.5rem; line-height: 2rem; }
.po-create-workspace .text-3xl, #modal-pr-detail .text-3xl, #modal-bang-gia-ncc .text-3xl, #drawer-po-panel .text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.po-create-workspace .font-normal { font-weight: 400; }
.po-create-workspace .font-medium, #modal-pr-detail .font-medium, #drawer-po-panel .font-medium { font-weight: 500; }
.po-create-workspace .font-semibold, #modal-pr-detail .font-semibold, #drawer-po-panel .font-semibold { font-weight: 600; }
.po-create-workspace .font-bold, #modal-pr-detail .font-bold, #modal-bang-gia-ncc .font-bold, #drawer-po-panel .font-bold { font-weight: 700; }
.po-create-workspace .font-extrabold, #modal-pr-detail .font-extrabold, #modal-bang-gia-ncc .font-extrabold, #drawer-po-panel .font-extrabold { font-weight: 800; }
.po-create-workspace .font-black, #modal-pr-detail .font-black, #modal-bang-gia-ncc .font-black, #drawer-po-panel .font-black { font-weight: 900; }

.po-create-workspace .text-left { text-align: left; }
.po-create-workspace .text-right { text-align: right; }
.po-create-workspace .text-center { text-align: center; }
.po-create-workspace .uppercase { text-transform: uppercase; }
.po-create-workspace .tracking-wider { letter-spacing: 0.05em; }
.po-create-workspace .tracking-tight { letter-spacing: -0.025em; }
.po-create-workspace .leading-tight { line-height: 1.25; }
.po-create-workspace .italic, #drawer-po-panel .italic { font-style: italic; }
.po-create-workspace .hover\:underline:hover { text-decoration: underline; }

/* Text colors */
.po-create-workspace .text-white, #modal-bang-gia-ncc .text-white, #drawer-po-panel .text-white { color: #ffffff !important; }
.po-create-workspace .text-slate-300, #drawer-po-panel .text-slate-300 { color: #CBD5E1; }
.po-create-workspace .text-slate-400, #modal-bang-gia-ncc .text-slate-400, #drawer-po-panel .text-slate-400 { color: #94A3B8; }
.po-create-workspace .text-slate-500, #modal-bang-gia-ncc .text-slate-500, #drawer-po-panel .text-slate-500 { color: #64748B; }
.po-create-workspace .text-slate-600, #modal-bang-gia-ncc .text-slate-600, #drawer-po-panel .text-slate-600 { color: #475569; }
.po-create-workspace .text-slate-700, #modal-bang-gia-ncc .text-slate-700, #drawer-po-panel .text-slate-700 { color: #334155; }
.po-create-workspace .text-slate-800, #modal-bang-gia-ncc .text-slate-800, #drawer-po-panel .text-slate-800 { color: #1E293B; }
.po-create-workspace .text-slate-900, #modal-bang-gia-ncc .text-slate-900, #drawer-po-panel .text-slate-900 { color: #0F172A; }
.po-create-workspace .text-emerald-700, #drawer-po-panel .text-emerald-700 { color: #047857; }
.po-create-workspace .text-emerald-800, #modal-pr-detail .text-emerald-800, #drawer-po-panel .text-emerald-800 { color: #065F46; }
.po-create-workspace .text-emerald-950 { color: #022c22; }
.po-create-workspace .text-emerald-300, #modal-bang-gia-ncc .text-emerald-300 { color: #6ee7b7; }
.po-create-workspace .text-amber-300, #drawer-po-panel .text-amber-300 { color: #fcd34d; }
.po-create-workspace .text-amber-700, #drawer-po-panel .text-amber-700 { color: #B45309; }
.po-create-workspace .text-amber-800, #drawer-po-panel .text-amber-800 { color: #92400E; }
.po-create-workspace .text-red-700, .po-create-workspace .text-rose-700, #drawer-po-panel .text-rose-700 { color: #BE123C; }
.po-create-workspace .text-red-800, .po-create-workspace .text-rose-800 { color: #9F1239; }
.po-create-workspace .text-blue-700 { color: #1D4ED8; }
.po-create-workspace .text-blue-900, #modal-pr-detail .text-blue-900, #drawer-po-panel .text-blue-900 { color: #1E3A8A; }
.po-create-workspace .text-sky-400, #modal-bang-gia-ncc .text-sky-400, #drawer-po-panel .text-sky-400 { color: #38bdf8; }
.po-create-workspace .text-\[\#25478B\], #modal-pr-detail .text-\[\#25478B\], #modal-bang-gia-ncc .text-\[\#25478B\], #drawer-po-panel .text-\[\#25478B\] { color: #25478B !important; }

/* ========================================================================= */
/* 3. FLEXBOX & GRID UTILITIES                                               */
/* ========================================================================= */
.po-create-workspace .flex, #modal-pr-detail .flex, #modal-bang-gia-ncc .flex, #drawer-po-panel .flex { display: flex; }
.po-create-workspace .inline-flex, #modal-pr-detail .inline-flex, #modal-bang-gia-ncc .inline-flex, #drawer-po-panel .inline-flex { display: inline-flex; }
.po-create-workspace .flex-col, #modal-pr-detail .flex-col, #modal-bang-gia-ncc .flex-col, #drawer-po-panel .flex-col { flex-direction: column; }
.po-create-workspace .flex-wrap, #modal-pr-detail .flex-wrap, #modal-bang-gia-ncc .flex-wrap, #drawer-po-panel .flex-wrap { flex-wrap: wrap; }
.po-create-workspace .items-center, #modal-pr-detail .items-center, #modal-bang-gia-ncc .items-center, #drawer-po-panel .items-center { align-items: center; }
.po-create-workspace .items-start, #modal-pr-detail .items-start, #modal-bang-gia-ncc .items-start, #drawer-po-panel .items-start { align-items: flex-start; }
.po-create-workspace .items-baseline, #drawer-po-panel .items-baseline { align-items: baseline; }
.po-create-workspace .justify-between, #modal-pr-detail .justify-between, #modal-bang-gia-ncc .justify-between, #drawer-po-panel .justify-between { justify-content: space-between; }
.po-create-workspace .justify-center, #modal-pr-detail .justify-center, #modal-bang-gia-ncc .justify-center, #drawer-po-panel .justify-center { justify-content: center; }
.po-create-workspace .justify-end, #modal-pr-detail .justify-end, #modal-bang-gia-ncc .justify-end, #drawer-po-panel .justify-end { justify-content: flex-end; }
.po-create-workspace .flex-1, #drawer-po-panel .flex-1 { flex: 1 1 0%; }
.po-create-workspace .shrink-0, #modal-bang-gia-ncc .shrink-0, #drawer-po-panel .shrink-0 { flex-shrink: 0; }
.po-create-workspace .block, #modal-pr-detail .block, #modal-bang-gia-ncc .block, #drawer-po-panel .block { display: block; }
.po-create-workspace .mx-auto { margin-left: auto; margin-right: auto; }

.po-create-workspace .gap-1, #drawer-po-panel .gap-1 { gap: 4px; }
.po-create-workspace .gap-1\.5, #modal-pr-detail .gap-1\.5, #modal-bang-gia-ncc .gap-1\.5, #drawer-po-panel .gap-1\.5 { gap: 6px; }
.po-create-workspace .gap-2, #modal-pr-detail .gap-2, #modal-bang-gia-ncc .gap-2, #drawer-po-panel .gap-2 { gap: 8px; }
.po-create-workspace .gap-2\.5, #modal-pr-detail .gap-2\.5 { gap: 10px; }
.po-create-workspace .gap-3, #modal-pr-detail .gap-3, #modal-bang-gia-ncc .gap-3, #drawer-po-panel .gap-3 { gap: 12px; }
.po-create-workspace .gap-4, #modal-bang-gia-ncc .gap-4, #drawer-po-panel .gap-4 { gap: 16px; }
.po-create-workspace .gap-5 { gap: 20px; }

.po-create-workspace .space-y-1 > :not([hidden]) ~ :not([hidden]), #drawer-po-panel .space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 4px; }
.po-create-workspace .space-y-1\.5 > :not([hidden]) ~ :not([hidden]), #drawer-po-panel .space-y-1\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 6px; }
.po-create-workspace .space-y-2 > :not([hidden]) ~ :not([hidden]), #drawer-po-panel .space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 8px; }
.po-create-workspace .space-y-3 > :not([hidden]) ~ :not([hidden]), #modal-bang-gia-ncc .space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 12px; }
.po-create-workspace .space-y-4 > :not([hidden]) ~ :not([hidden]), #modal-pr-detail .space-y-4 > :not([hidden]) ~ :not([hidden]), #modal-bang-gia-ncc .space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 16px; }
.po-create-workspace .space-y-5 > :not([hidden]) ~ :not([hidden]) { margin-top: 20px; }
.po-create-workspace .space-y-6 > :not([hidden]) ~ :not([hidden]), #drawer-po-panel .space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 24px; }

/* Grid Layouts */
.po-create-workspace .grid, #modal-pr-detail .grid, #modal-bang-gia-ncc .grid, #modal-supplier-quote-lookup .grid, #drawer-po-panel .grid { display: grid; }
.po-create-workspace .grid-cols-1, #modal-bang-gia-ncc .grid-cols-1, #modal-supplier-quote-lookup .grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.po-create-workspace .grid-cols-2, #modal-pr-detail .grid-cols-2, #drawer-po-panel .grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.po-create-workspace .grid-cols-3, #modal-bang-gia-ncc .grid-cols-3, #modal-supplier-quote-lookup .grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.po-create-workspace .grid-cols-4, #drawer-po-panel .grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 640px) {
  .po-create-workspace .sm\:grid-cols-2, #modal-bang-gia-ncc .sm\:grid-cols-2, #modal-supplier-quote-lookup .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .po-create-workspace .sm\:grid-cols-4, #modal-pr-detail .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .po-create-workspace .sm\:p-5 { padding: 20px; }
  .po-create-workspace .sm\:p-6, #drawer-po-panel .sm\:p-6 { padding: 24px; }
  .po-create-workspace .sm\:p-8, #drawer-po-panel .sm\:p-8 { padding: 32px; }
}

@media (min-width: 768px) {
  .po-create-workspace .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .po-create-workspace .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .po-create-workspace .lg\:grid-cols-3, #modal-bang-gia-ncc .lg\:grid-cols-3, #modal-supplier-quote-lookup .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .po-create-workspace .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .po-create-workspace .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
  .po-create-workspace .lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
  .po-create-workspace .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)) !important; }
  .po-create-workspace .lg\:col-span-4 { grid-column: span 4 / span 4 !important; }
  .po-create-workspace .lg\:col-span-6 { grid-column: span 6 / span 6 !important; }
  .po-create-workspace .lg\:col-span-8 { grid-column: span 8 / span 8 !important; }
  .po-create-workspace .lg\:col-span-12 { grid-column: span 12 / span 12 !important; }
}

/* ========================================================================= */
/* 4. SPACING & SIZING                                                       */
/* ========================================================================= */
.po-create-workspace .p-1 { padding: 4px; }
.po-create-workspace .p-2, #drawer-po-panel .p-2 { padding: 8px; }
.po-create-workspace .p-2\.5, #modal-pr-detail .p-2\.5, #modal-bang-gia-ncc .p-2\.5, #drawer-po-panel .p-2\.5 { padding: 10px; }
.po-create-workspace .p-3, #modal-pr-detail .p-3, #modal-bang-gia-ncc .p-3 { padding: 12px; }
.po-create-workspace .p-3\.5, #drawer-po-panel .p-3\.5 { padding: 14px; }
.po-create-workspace .p-4, #modal-bang-gia-ncc .p-4, #drawer-po-panel .p-4 { padding: 16px; }
.po-create-workspace .p-5, #modal-pr-detail .p-5 { padding: 20px; }
.po-create-workspace .p-6, #modal-bang-gia-ncc .p-6, #drawer-po-panel .p-6 { padding: 24px; }
.po-create-workspace .p-8 { padding: 32px; }

.po-create-workspace .px-2 { padding-left: 8px; padding-right: 8px; }
.po-create-workspace .px-2\.5 { padding-left: 10px; padding-right: 10px; }
.po-create-workspace .px-3 { padding-left: 12px; padding-right: 12px; }
.po-create-workspace .px-3\.5, #modal-bang-gia-ncc .px-3\.5 { padding-left: 14px; padding-right: 14px; }
.po-create-workspace .px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.po-create-workspace .px-4, #modal-pr-detail .px-4, #modal-bang-gia-ncc .px-4 { padding-left: 16px; padding-right: 16px; }
.po-create-workspace .px-5, #modal-pr-detail .px-5, #modal-bang-gia-ncc .px-5 { padding-left: 20px; padding-right: 20px; }
.po-create-workspace .px-6, #modal-bang-gia-ncc .px-6, #drawer-po-panel .px-6 { padding-left: 24px; padding-right: 24px; }

.po-create-workspace .py-1 { padding-top: 4px; padding-bottom: 4px; }
.po-create-workspace .py-1\.5, #modal-bang-gia-ncc .py-1\.5, #drawer-po-panel .py-1\.5 { padding-top: 6px; padding-bottom: 6px; }
.po-create-workspace .py-2, #modal-pr-detail .py-2, #modal-bang-gia-ncc .py-2 { padding-top: 8px; padding-bottom: 8px; }
.po-create-workspace .py-2\.5 { padding-top: 10px; padding-bottom: 10px; }
.po-create-workspace .py-3, #modal-pr-detail .py-3 { padding-top: 12px; padding-bottom: 12px; }
.po-create-workspace .py-3\.5, #modal-pr-detail .py-3\.5, #modal-bang-gia-ncc .py-3\.5 { padding-top: 14px; padding-bottom: 14px; }
.po-create-workspace .py-4, #modal-bang-gia-ncc .py-4, #drawer-po-panel .py-4 { padding-top: 16px; padding-bottom: 16px; }
.po-create-workspace .py-5 { padding-top: 20px !important; padding-bottom: 20px !important; }

/* Custom Flat Section Padding (Top/Bottom 20px, Left/Right 0) */
.po-costs-discounts-section,
.po-create-workspace .po-costs-discounts-section {
  padding-top: 20px !important;
  padding-bottom: 20px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.po-create-workspace .pt-1, #drawer-po-panel .pt-1 { padding-top: 4px; }
.po-create-workspace .pt-2 { padding-top: 8px; }
.po-create-workspace .pt-3 { padding-top: 12px; }
.po-create-workspace .pt-4 { padding-top: 16px; }
.po-create-workspace .pt-6, #drawer-po-panel .pt-6 { padding-top: 24px; }

.po-create-workspace .pb-1 { padding-bottom: 4px; }
.po-create-workspace .pb-1\.5, #drawer-po-panel .pb-1\.5 { padding-bottom: 6px; }
.po-create-workspace .pb-2 { padding-bottom: 8px; }
.po-create-workspace .pb-3 { padding-bottom: 12px; }
.po-create-workspace .pb-4, #drawer-po-panel .pb-4 { padding-bottom: 16px; }

.po-create-workspace .pl-4, #drawer-po-panel .pl-4 { padding-left: 16px; }

.po-create-workspace .mt-0\.5, #modal-bang-gia-ncc .mt-0\.5, #drawer-po-panel .mt-0\.5 { margin-top: 2px; }
.po-create-workspace .mt-1 { margin-top: 4px; }
.po-create-workspace .mt-2 { margin-top: 8px; }
.po-create-workspace .mt-3 { margin-top: 12px; }
.po-create-workspace .mt-4 { margin-top: 16px; }
.po-create-workspace .mb-0\.5, #modal-pr-detail .mb-0\.5 { margin-bottom: 2px; }
.po-create-workspace .mb-1, #modal-bang-gia-ncc .mb-1 { margin-bottom: 4px; }
.po-create-workspace .mb-2, #modal-pr-detail .mb-2 { margin-bottom: 8px; }
.po-create-workspace .mb-3 { margin-bottom: 12px; }
.po-create-workspace .mb-4 { margin-bottom: 16px; }
.po-create-workspace .mb-12, #drawer-po-panel .mb-12 { margin-bottom: 48px; }

.po-create-workspace .w-full, #modal-pr-detail .w-full, #modal-bang-gia-ncc .w-full, #drawer-po-panel .w-full { width: 100%; }
.po-create-workspace .w-4 { width: 16px; }
.po-create-workspace .h-4 { height: 16px; }
.po-create-workspace .w-6 { width: 24px; }
.po-create-workspace .h-6 { height: 24px; }
.po-create-workspace .w-7 { width: 28px; }
.po-create-workspace .h-7 { height: 28px; }
.po-create-workspace .w-8, #modal-pr-detail .w-8, #modal-bang-gia-ncc .w-8, #drawer-po-panel .w-8 { width: 32px; }
.po-create-workspace .h-8, #modal-pr-detail .h-8, #modal-bang-gia-ncc .h-8, #drawer-po-panel .h-8 { height: 32px; }
.po-create-workspace .w-9, #drawer-po-panel .w-9 { width: 36px; }
.po-create-workspace .h-9, #drawer-po-panel .h-9 { height: 36px; }
.po-create-workspace .w-10, #modal-bang-gia-ncc .w-10 { width: 40px; }
.po-create-workspace .h-10, #modal-bang-gia-ncc .h-10 { height: 40px; }
.po-create-workspace .w-12, #modal-bang-gia-ncc .w-12, #drawer-po-panel .w-12 { width: 48px; }
.po-create-workspace .h-12, #modal-bang-gia-ncc .h-12, #drawer-po-panel .h-12 { height: 48px; }
.po-create-workspace .w-14, #modal-pr-detail .w-14 { width: 56px; }
.po-create-workspace .h-14, #modal-pr-detail .h-14 { height: 56px; }
.po-create-workspace .w-16 { width: 64px; }
.po-create-workspace .w-20 { width: 80px; }
.po-create-workspace .w-24, #modal-pr-detail .w-24, #modal-bang-gia-ncc .w-24, #drawer-po-panel .w-24 { width: 96px; }
.po-create-workspace .w-28, #modal-pr-detail .w-28, #modal-bang-gia-ncc .w-28, #drawer-po-panel .w-28 { width: 112px; }
.po-create-workspace .w-32 { width: 128px; }
.po-create-workspace .w-36 { width: 144px; }
.po-create-workspace .w-48 { width: 192px; }
.po-create-workspace .w-52 { width: 208px; }
.po-create-workspace .w-64 { width: 256px; }
.po-create-workspace .w-72, #drawer-po-panel .w-72 { width: 18rem; }
.po-create-workspace .w-1\/3 { width: 33.333333%; }

.po-create-workspace .min-w-\[160px\] { min-width: 160px; }
.po-create-workspace .min-w-\[180px\], #modal-bang-gia-ncc .min-w-\[180px\] { min-width: 180px; }
.po-create-workspace .min-w-\[200px\] { min-width: 200px; }

.po-create-workspace .max-w-md { max-width: 28rem; }
.po-create-workspace .max-w-xl { max-width: 36rem; }
.po-create-workspace .max-w-2xl, #modal-pr-detail .max-w-2xl, #drawer-po-panel .max-w-2xl { max-width: 42rem; }
.po-create-workspace .max-w-3xl, #drawer-po-panel .max-w-3xl { max-width: 48rem; }
.po-create-workspace .max-w-4xl, #modal-bang-gia-ncc .max-w-4xl { max-width: 56rem; }
.po-create-workspace .max-w-5xl { max-width: 64rem; }
.po-create-workspace .max-w-6xl { max-width: 72rem; }

.po-create-workspace .max-h-\[calc\(100vh-380px\)\] { max-height: calc(100vh - 380px); }
.po-create-workspace .max-h-\[calc\(100vh-395px\)\] { max-height: calc(100vh - 395px); }
.po-create-workspace .max-h-\[calc\(100vh-430px\)\] { max-height: calc(100vh - 430px); }
.po-create-workspace .min-h-\[180px\] { min-height: 180px; }
.po-create-workspace .min-h-\[200px\] { min-height: 200px; }
.po-create-workspace .min-h-\[220px\] { min-height: 220px; }
.po-create-workspace .min-h-\[300px\] { min-height: 300px; }
.po-create-workspace .min-h-\[320px\] { min-height: 320px; }
.po-create-workspace .min-w-\[1280px\] { min-width: 1280px; }

/* Bước 1: Khung cuộn nội bộ PR Table - Thoáng đãng, chỉ ngắn hơn Bước 2 đúng 15px (bù Merge Hint), khống chế width 100% */
.po-create-workspace .po-step1-table-scroll {
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 395px);
  min-height: 320px;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar nổi bật nhận diện ngay lập tức */
.po-create-workspace .po-step1-table-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.po-create-workspace .po-step1-table-scroll::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-radius: 4px;
}
.po-create-workspace .po-step1-table-scroll::-webkit-scrollbar-thumb {
  background: #25478B;
  border-radius: 4px;
}
.po-create-workspace .po-step1-table-scroll::-webkit-scrollbar-thumb:hover {
  background: #1A3668;
}

.po-create-workspace .po-step1-table-scroll table {
  min-width: 1280px;
  width: 100%;
}

.po-create-workspace .po-step1-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #F1F5F9;
}

#modal-pr-detail .max-h-\[75vh\] { max-height: 75vh; }
#modal-bang-gia-ncc .max-h-\[78vh\] { max-height: 78vh; }

.po-create-workspace .overflow-x-auto, #drawer-po-panel .overflow-x-auto { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.po-create-workspace .overflow-y-auto, #modal-pr-detail .overflow-y-auto, #modal-bang-gia-ncc .overflow-y-auto, #drawer-po-panel .overflow-y-auto { overflow-y: auto; }
.po-create-workspace .overflow-hidden, #modal-pr-detail .overflow-hidden, #modal-bang-gia-ncc .overflow-hidden, #drawer-po-panel .overflow-hidden { overflow: hidden; }
.po-create-workspace .whitespace-nowrap { white-space: nowrap; }
.po-create-workspace .sticky { position: sticky; }
.po-create-workspace .top-0 { top: 0; }
.po-create-workspace .z-10 { z-index: 10; }
.po-create-workspace .object-cover { object-fit: cover; }

/* ========================================================================= */
/* 5. BACKGROUNDS, BORDERS & SHADOWS                                         */
/* ========================================================================= */
.po-create-workspace .bg-white, #modal-pr-detail .bg-white, #modal-bang-gia-ncc .bg-white, #drawer-po-panel .bg-white { background-color: #ffffff; }
.po-create-workspace .bg-slate-50, #modal-pr-detail .bg-slate-50, #modal-bang-gia-ncc .bg-slate-50, #drawer-po-panel .bg-slate-50 { background-color: #F8FAFC; }
.po-create-workspace .bg-slate-100, #modal-pr-detail .bg-slate-100, #modal-bang-gia-ncc .bg-slate-100, #drawer-po-panel .bg-slate-100 { background-color: #F1F5F9; }
.po-create-workspace .bg-slate-200, #modal-bang-gia-ncc .bg-slate-200 { background-color: #E2E8F0; }
.po-create-workspace .bg-slate-800, #modal-bang-gia-ncc .bg-slate-800 { background-color: #1E293B; }
.po-create-workspace .bg-slate-900, #modal-bang-gia-ncc .bg-slate-900, #drawer-po-panel .bg-slate-900 { background-color: #0F172A; }
.po-create-workspace .bg-blue-50 { background-color: #EFF6FF; }
.po-create-workspace .bg-blue-100, #modal-bang-gia-ncc .bg-blue-100 { background-color: #DBEAFE; }
.po-create-workspace .bg-emerald-50 { background-color: #ECFDF5; }
.po-create-workspace .bg-emerald-100, #modal-pr-detail .bg-emerald-100 { background-color: #D1FAE5; }
.po-create-workspace .bg-emerald-600 { background-color: #059669; }
.po-create-workspace .bg-emerald-700 { background-color: #047857; }
.po-create-workspace .bg-amber-50 { background-color: #FFFBEB; }
.po-create-workspace .bg-amber-500 { background-color: #F59E0B; }
.po-create-workspace .bg-red-50, .po-create-workspace .bg-rose-50 { background-color: #FFF1F2; }
.po-create-workspace .bg-red-500 { background-color: #EF4444; }
.po-create-workspace .bg-\[\#25478B\], #modal-bang-gia-ncc .bg-\[\#25478B\], #drawer-po-panel .bg-\[\#25478B\] { background-color: #25478B !important; }

/* Opacity background blends */
.po-create-workspace .bg-slate-50\/80 { background-color: rgba(248, 250, 252, 0.85); }
.po-create-workspace .bg-blue-50\/70 { background-color: rgba(239, 246, 255, 0.7); }
.po-create-workspace .bg-blue-50\/60, #modal-pr-detail .bg-blue-50\/60 { background-color: rgba(239, 246, 255, 0.6); }
.po-create-workspace .bg-blue-50\/90 { background-color: rgba(239, 246, 255, 0.9); }
.po-create-workspace .bg-emerald-50\/80 { background-color: rgba(236, 253, 245, 0.8); }
.po-create-workspace .bg-white\/10, #drawer-po-panel .bg-white\/10 { background-color: rgba(255, 255, 255, 0.1); }
.po-create-workspace .bg-blue-500\/20, #modal-bang-gia-ncc .bg-blue-500\/20 { background-color: rgba(59, 130, 246, 0.2); }
.po-create-workspace .bg-emerald-500\/20, #modal-bang-gia-ncc .bg-emerald-500\/20 { background-color: rgba(16, 185, 129, 0.2); }
.po-create-workspace .bg-amber-500\/20, #drawer-po-panel .bg-amber-500\/20 { background-color: rgba(245, 158, 11, 0.2); }

.po-create-workspace .hover\:bg-slate-50:hover, #modal-bang-gia-ncc .hover\:bg-slate-50:hover { background-color: #F8FAFC; }
.po-create-workspace .hover\:bg-slate-100:hover, #modal-pr-detail .hover\:bg-slate-100:hover, #modal-bang-gia-ncc .hover\:bg-slate-100:hover { background-color: #F1F5F9; }
.po-create-workspace .hover\:bg-slate-200:hover, #modal-pr-detail .hover\:bg-slate-200:hover { background-color: #E2E8F0; }
.po-create-workspace .hover\:bg-blue-100:hover { background-color: #DBEAFE; }
.po-create-workspace .hover\:bg-rose-100:hover { background-color: #FFE4E6; }
.po-create-workspace .hover\:bg-emerald-700:hover { background-color: #047857; }
.po-create-workspace .hover\:bg-emerald-800:hover { background-color: #065F46; }
.po-create-workspace .hover\:bg-\[\#1A3668\]:hover, #drawer-po-panel .hover\:bg-\[\#1A3668\]:hover { background-color: #1A3668 !important; }
.po-create-workspace .hover\:border-\[\#25478B\]:hover { border-color: #25478B !important; }

/* Borders */
.po-create-workspace .border, #modal-pr-detail .border, #modal-bang-gia-ncc .border, #drawer-po-panel .border { border: 1px solid #E2E8F0; }
.po-create-workspace .border-t, #modal-pr-detail .border-t, #modal-bang-gia-ncc .border-t, #drawer-po-panel .border-t { border-top: 1px solid #E2E8F0; }
.po-create-workspace .border-b, #modal-pr-detail .border-b, #modal-bang-gia-ncc .border-b, #drawer-po-panel .border-b { border-bottom: 1px solid #E2E8F0; }
.po-create-workspace .border-b-2, #drawer-po-panel .border-b-2 { border-bottom-width: 2px; }
.po-create-workspace .border-r, #modal-pr-detail .border-r, #drawer-po-panel .border-r { border-right: 1px solid #E2E8F0; }
.po-create-workspace .border-l, #drawer-po-panel .border-l { border-left: 1px solid #E2E8F0; }
.po-create-workspace .border-dashed { border-style: dashed; }

.po-create-workspace .border-slate-100 { border-color: #F1F5F9; }
.po-create-workspace .border-slate-200, #modal-pr-detail .border-slate-200, #modal-bang-gia-ncc .border-slate-200, #drawer-po-panel .border-slate-200 { border-color: #E2E8F0; }
.po-create-workspace .border-slate-300, #modal-pr-detail .border-slate-300, #modal-bang-gia-ncc .border-slate-300, #drawer-po-panel .border-slate-300 { border-color: #CBD5E1; }
.po-create-workspace .border-slate-900, #drawer-po-panel .border-slate-900 { border-color: #0F172A; }
.po-create-workspace .border-blue-200, #modal-pr-detail .border-blue-200 { border-color: #BFDBFE; }
.po-create-workspace .border-blue-200\/80 { border-color: rgba(191, 219, 254, 0.8); }
.po-create-workspace .border-emerald-200 { border-color: #A7F3D0; }
.po-create-workspace .border-emerald-500\/40, #modal-bang-gia-ncc .border-emerald-500\/40 { border-color: rgba(16, 185, 129, 0.4); }
.po-create-workspace .border-amber-200 { border-color: #FDE68A; }
.po-create-workspace .border-amber-500\/40, #drawer-po-panel .border-amber-500\/40 { border-color: rgba(245, 158, 11, 0.4); }
.po-create-workspace .border-red-200, .po-create-workspace .border-rose-200 { border-color: #FECDD3; }

/* Dividers */
.po-create-workspace .divide-y > * + *, #modal-pr-detail .divide-y > * + *, #modal-bang-gia-ncc .divide-y > * + *, #drawer-po-panel .divide-y > * + * {
  border-top-width: 1px;
  border-top-style: solid;
}
.po-create-workspace .divide-slate-100 > * + *, #modal-pr-detail .divide-slate-100 > * + *, #modal-bang-gia-ncc .divide-slate-100 > * + * {
  border-top-color: #F1F5F9;
}
.po-create-workspace .divide-slate-200 > * + *, #drawer-po-panel .divide-slate-200 > * + * {
  border-top-color: #E2E8F0;
}

/* Border Radius */
.po-create-workspace .rounded, #modal-pr-detail .rounded { border-radius: 4px; }
.po-create-workspace .rounded-md, #modal-pr-detail .rounded-md { border-radius: 6px; }
.po-create-workspace .rounded-lg, #modal-pr-detail .rounded-lg, #modal-bang-gia-ncc .rounded-lg, #drawer-po-panel .rounded-lg { border-radius: 8px; }
.po-create-workspace .rounded-xl, #modal-pr-detail .rounded-xl, #modal-bang-gia-ncc .rounded-xl, #drawer-po-panel .rounded-xl { border-radius: 12px; }
.po-create-workspace .rounded-2xl, #modal-pr-detail .rounded-2xl, #modal-bang-gia-ncc .rounded-2xl { border-radius: 16px; }
.po-create-workspace .rounded-full, #modal-pr-detail .rounded-full, #drawer-po-panel .rounded-full { border-radius: 9999px; }

/* Shadows */
.po-create-workspace .shadow-2xs { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.po-create-workspace .shadow-xs, #drawer-po-panel .shadow-xs { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.po-create-workspace .shadow-sm, #drawer-po-panel .shadow-sm { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
.po-create-workspace .shadow-md, #drawer-po-panel .shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.po-create-workspace .shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); }
.po-create-workspace .shadow-2xl, #modal-pr-detail .shadow-2xl, #modal-bang-gia-ncc .shadow-2xl, #drawer-po-panel .shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

.po-create-workspace .transition, #modal-pr-detail .transition, #modal-bang-gia-ncc .transition, #drawer-po-panel .transition {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.po-create-workspace .cursor-pointer { cursor: pointer; }
.po-create-workspace .cursor-not-allowed { cursor: not-allowed; }
.po-create-workspace .select-none { user-select: none; }
.po-create-workspace .accent-\[\#25478B\] { accent-color: #25478B; }

/* ========================================================================= */
/* 6. STEPPER WIZARD COMPONENT                                               */
/* ========================================================================= */
.po-create-workspace .wizard-step {
  border: 1px solid var(--po-slate-200);
  background-color: #ffffff;
  color: var(--po-slate-700);
  cursor: pointer;
  outline: none;
}

.po-create-workspace .wizard-step.active {
  background-color: #25478B !important;
  color: #ffffff !important;
  border-color: #25478B !important;
  box-shadow: 0 4px 12px rgba(37, 71, 139, 0.2);
}

.po-create-workspace .wizard-step.active .step-subtext {
  color: #DBEAFE !important;
  opacity: 0.95;
}

.po-create-workspace .wizard-step.active .step-num {
  background-color: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

.po-create-workspace .wizard-step.completed {
  background-color: #ECFDF5 !important;
  color: #065F46 !important;
  border-color: #10B981 !important;
}

.po-create-workspace .wizard-step.completed .step-subtext {
  color: #047857 !important;
}

.po-create-workspace .wizard-step.completed .step-num {
  background-color: #10B981 !important;
  color: #ffffff !important;
}

.po-create-workspace .wizard-step.locked {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ========================================================================= */
/* 7. DATA TABLES & FORMS                                                    */
/* ========================================================================= */
.po-create-workspace .badge, #modal-pr-detail .badge, #modal-bang-gia-ncc .badge, #drawer-po-panel .badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.3;
}

.po-create-workspace .input-cell, #modal-bang-gia-ncc .input-cell {
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.75rem;
  background: #fff;
  width: 100%;
  outline: none;
}

.po-create-workspace .input-cell:focus, #modal-bang-gia-ncc .input-cell:focus {
  border-color: #25478B;
  box-shadow: 0 0 0 2px rgba(37, 71, 139, 0.15);
}

.po-create-workspace .thumb-img {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #CBD5E1;
  background: #F1F5F9;
  flex-shrink: 0;
}

.po-create-workspace table, #modal-pr-detail table, #modal-bang-gia-ncc table, #drawer-po-panel table {
  width: 100%;
  border-collapse: collapse;
}

.po-create-workspace th, #modal-pr-detail th, #modal-bang-gia-ncc th, #drawer-po-panel th {
  font-weight: 700;
}

.po-create-workspace input[type=number]::-webkit-inner-spin-button,
.po-create-workspace input[type=number]::-webkit-outer-spin-button,
#modal-bang-gia-ncc input[type=number]::-webkit-inner-spin-button,
#modal-bang-gia-ncc input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.po-create-workspace input[type=number],
#modal-bang-gia-ncc input[type=number] {
  -moz-appearance: textfield;
}

/* Supplier Left Border Tags */
.supplier-tag-1 { border-left: 4px solid #0284C7; }
.supplier-tag-2 { border-left: 4px solid #059669; }
.supplier-tag-3 { border-left: 4px solid #D97706; }
.supplier-tag-4 { border-left: 4px solid #64748B; }

/* Pulse animation */
@keyframes pulse-highlight {
  0% { background-color: #FEF08A; }
  100% { background-color: transparent; }
}
.highlight-flash {
  animation: pulse-highlight 1.2s ease-out;
}

/* ========================================================================= */
/* 8. MODAL & SLIDE-OVER DRAWER (XEM NHANH & IN ĐƠN PO)                      */
/* ========================================================================= */
.fixed { position: fixed !important; }
.inset-0 { top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important; }
.inset-y-0 { top: 0 !important; bottom: 0 !important; }
.right-0 { right: 0 !important; }
.z-40 { z-index: 40 !important; }
.z-50 { z-index: 50 !important; }
.hidden { display: none !important; }

.bg-slate-900\/50 { background-color: rgba(15, 23, 42, 0.5) !important; }
.bg-slate-900\/60 { background-color: rgba(15, 23, 42, 0.6) !important; }
.backdrop-blur-xs { backdrop-filter: blur(2px) !important; -webkit-backdrop-filter: blur(2px) !important; }

.opacity-0 { opacity: 0 !important; }
.opacity-100 { opacity: 1 !important; }
.duration-300 { transition-duration: 300ms !important; }
.transition-opacity { transition-property: opacity !important; }
.transition-transform { transition-property: transform !important; }
.transform { transform: translateZ(0); }

/* Centered Standard System Popups */
#modal-bang-gia-ncc,
#modal-pr-detail,
#modal-po-linh-kien-lookup,
#modal-po-product-history,
.goca-popup-overlay {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: rgba(15, 23, 42, 0.65) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 1050 !important;
  padding: 16px !important;
  box-sizing: border-box !important;
}

#modal-bang-gia-ncc.hidden,
#modal-pr-detail.hidden,
#modal-po-linh-kien-lookup.hidden,
#modal-po-product-history.hidden,
.goca-popup-overlay.hidden {
  display: none !important;
}

#modal-bang-gia-ncc > div,
#modal-pr-detail > div,
#modal-po-linh-kien-lookup > div,
#modal-po-product-history > div,
.goca-popup-container {
  margin: auto !important;
  background-color: #ffffff !important;
  border-radius: 16px !important;
  border: 1px solid var(--po-slate-200) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  width: 100% !important;
}

/* Modal Lịch Sử Đơn PO Mua Hàng Cũ (Chuẩn 860px thoáng rộng) */
#modal-po-product-history .popup-card,
#modal-po-product-history > div {
  width: min(860px, calc(100vw - 32px)) !important;
  max-width: 860px !important;
  box-sizing: border-box !important;
}

/* Kích thước thoáng đãng cho Modal Chuẩn hóa Linh kiện & Tên Hóa đơn (840px hỗ trợ bảng 6 cột) */
#modal-po-linh-kien-lookup .popup-card,
#modal-po-linh-kien-lookup > div {
  width: min(840px, calc(100vw - 32px)) !important;
  max-width: 840px !important;
  box-sizing: border-box !important;
}

#drawer-po-panel {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 48rem !important;
  background-color: #ffffff !important;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.2) !important;
  display: flex !important;
  flex-direction: column !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  z-index: 50 !important;
}

#drawer-po-panel.translate-x-full {
  transform: translateX(100%) !important;
}

#drawer-po-panel.translate-x-0 {
  transform: translateX(0) !important;
}

/* ========================================================================= */
/* 8. SUPPLIER IDENTIFICATION TAGS (STEP 2 COLOR ACCENTS)                    */
/* ========================================================================= */
.supplier-tag-1 { border-left: 4px solid #0284C7 !important; }
.supplier-tag-2 { border-left: 4px solid #059669 !important; }
.supplier-tag-3 { border-left: 4px solid #D97706 !important; }
.supplier-tag-4 { border-left: 4px solid #7C3AED !important; }
.supplier-tag-5 { border-left: 4px solid #E11D48 !important; }
.supplier-tag-6 { border-left: 4px solid #0891B2 !important; }
.supplier-tag-7 { border-left: 4px solid #EA580C !important; }
.supplier-tag-8 { border-left: 4px solid #4F46E5 !important; }

/* ========================================================================= */
/* 9. RESPONSIVE DESIGN (TABLET & MOBILE)                                    */
/* ========================================================================= */
@media (max-width: 1023px) {
  .po-create-workspace .grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 767px) {
  .po-create-workspace {
    padding: 10px !important;
  }

  .po-create-workspace .grid-cols-4,
  .po-create-workspace .grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  }

  .po-create-workspace header {
    padding: 12px !important;
  }

  #drawer-po-panel {
    max-width: 100% !important;
  }

  #modal-pr-detail .max-w-3xl,
  #modal-pr-detail .max-w-2xl,
  #modal-bang-gia-ncc .max-w-4xl,
  #modal-supplier-quote-lookup .max-w-4xl {
    width: 100% !important;
    max-width: 100% !important;
    margin: 10px !important;
  }
}

/* ========================================================================= */
/* 9.5. PO CARDS, FORM CONTROLS & MICRO-TOOLTIP COMPONENTS                   */
/* ========================================================================= */
.po-card-container {
  margin-bottom: 28px !important;
  border-radius: 16px !important;
  transition: all 0.2s ease;
}
.po-card-domestic {
  border: 2px solid #7dd3fc !important; /* sky-300 */
}
.po-card-international {
  border: 2px solid #fcd34d !important; /* amber-300 */
}

/* Form Controls Step 3 */
.po-form-control,
.po-select-master,
.po-input-master {
  width: 100%;
  min-height: 38px;
  padding: 6px 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1e293b;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.po-select-master:focus,
.po-input-master:focus,
.po-form-control:focus {
  border-color: #25478B !important;
  box-shadow: 0 0 0 3px rgba(37, 71, 139, 0.15) !important;
}
.po-select-master.intl:focus,
.po-input-master.intl:focus {
  border-color: #b45309 !important;
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15) !important;
}

/* Action Buttons */
.po-btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.po-btn-cost-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #25478B;
  cursor: pointer;
  transition: all 0.15s ease;
}
.po-btn-cost-add:hover {
  background-color: #dbeafe;
  border-color: #93c5fd;
  color: #1a3668;
}
.po-btn-cost-add.intl {
  background-color: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.po-btn-cost-add.intl:hover {
  background-color: #fef3c7;
  border-color: #fcd34d;
  color: #78350f;
}

.po-btn-tax-apply {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff !important;
  background-color: #25478B;
  border: 1px solid #1a3668;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.po-btn-tax-apply:hover {
  background-color: #1a3668;
}
.po-btn-tax-apply.intl {
  background-color: #b45309;
  border-color: #92400e;
}
.po-btn-tax-apply.intl:hover {
  background-color: #92400e;
}

/* Micro Tooltip (i) */
.po-th-tip {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  vertical-align: middle;
  white-space: normal !important;
  line-height: 1.25 !important;
}
.po-th-tip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.35);
  color: #334155;
  font-size: 10px;
  font-weight: 800;
  font-style: normal;
  cursor: help;
  user-select: none;
  transition: all 0.15s ease;
}
.po-th-tip:hover .po-th-tip-icon {
  background: #25478B;
  color: #ffffff;
}
.po-th-tip-icon.intl {
  background: rgba(245, 158, 11, 0.35);
  color: #92400e;
}
.po-th-tip:hover .po-th-tip-icon.intl {
  background: #d97706;
  color: #ffffff;
}

/* Global Floating Tooltip Singleton (Portal) */
#po-global-th-tooltip {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  min-width: 210px;
  max-width: 300px;
  padding: 8px 12px;
  background-color: #0f172a;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  text-transform: none;
  text-align: left;
  border-radius: 8px;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.45), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform: translateY(4px);
}
#po-global-th-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#po-global-th-tooltip.intl {
  border-left: 3px solid #f59e0b;
}
#po-global-th-tooltip.domestic {
  border-left: 3px solid #0284c7;
}

/* Zone Theming for Items Table */
.po-th-amber-zone {
  background-color: #fef3c7 !important;
  color: #78350f !important;
  border-bottom: 1px solid #fde68a !important;
}
.po-td-amber-zone {
  background-color: rgba(254, 243, 199, 0.22) !important;
}
.po-th-sky-zone {
  background-color: #e0f2fe !important;
  color: #0369a1 !important;
  border-bottom: 1px solid #bae6fd !important;
}
.po-td-sky-zone {
  background-color: rgba(224, 242, 254, 0.22) !important;
}
.po-th-emerald-zone {
  background-color: #d1fae5 !important;
  color: #065f46 !important;
  border-bottom: 1px solid #a7f3d0 !important;
}
.po-td-emerald-zone {
  background-color: rgba(209, 250, 229, 0.22) !important;
}
.po-th-blue-zone {
  background-color: #dbeafe !important;
  color: #1e40af !important;
  border-bottom: 1px solid #bfdbfe !important;
}
.po-td-blue-zone {
  background-color: rgba(219, 234, 254, 0.22) !important;
}

/* Touch-Friendly VAT Buttons */
.po-btn-vat-choice {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.po-btn-vat-choice:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}
.po-btn-vat-choice.active {
  background-color: #25478B;
  border-color: #25478B;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Costs Table Spacing & Elimination of Fake Horizontal Scroll */
[id$="-table-costs"] {
  table-layout: auto;
  border-spacing: 0;
  width: 100%;
}
[id$="-table-costs"] td {
  padding: 8px 10px !important;
}
[id$="-table-costs"] th {
  padding: 8px 10px !important;
}

/* ========================================================================= */
/* 9.1. PO CARD THEME & EXPLICIT BACKGROUND COLORS (WIREFRAME PARITY)        */
/* ========================================================================= */
.po-card-international {
  border: 2px solid #F59E0B !important;
  box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.1), 0 2px 4px -2px rgba(245, 158, 11, 0.1) !important;
}

.po-card-domestic {
  border: 2px solid #0284C7 !important;
  box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.1), 0 2px 4px -2px rgba(2, 132, 199, 0.1) !important;
}

/* Explicit Header Colors */
.po-header-quoc-te {
  background: linear-gradient(135deg, #FEF3C7 0%, #FFFBEB 100%) !important;
  border-bottom: 2px solid #FCD34D !important;
}

.po-header-noi-dia {
  background: linear-gradient(135deg, #E0F2FE 0%, #F0F9FF 100%) !important;
  border-bottom: 2px solid #BAE6FD !important;
}

/* Explicit Master Bar Colors */
.po-master-quoc-te {
  background-color: #FFFDF5 !important;
  border-bottom: 1px solid #FDE68A !important;
}

.po-master-noi-dia {
  background-color: #F8FAFC !important;
  border-bottom: 1px solid #E2E8F0 !important;
}

/* Explicit Tax Toolbar Colors */
.po-tax-quoc-te {
  background-color: #FEF3C7 !important;
  border-bottom: 1px solid #FCD34D !important;
}

.po-tax-noi-dia {
  background-color: #F1F5F9 !important;
  border-bottom: 1px solid #CBD5E1 !important;
}

/* Dual Financial Reconciliation Cards */
.po-card-vendor-amber {
  background-color: #FFFBEB !important;
  border: 2px solid #F59E0B !important;
  border-radius: 16px !important;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.08) !important;
}

.po-card-budget-sky {
  background-color: #F0F9FF !important;
  border: 2px solid #0284C7 !important;
  border-radius: 16px !important;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.08) !important;
}

.po-card-domestic-summary {
  background-color: #F8FAFC !important;
  border: 1px solid #CBD5E1 !important;
  border-radius: 16px !important;
}

/* Validation Mandatory Error Highlighting */
.po-input-error {
  border-color: #EF4444 !important;
  background-color: #FEF2F2 !important;
  color: #991B1B !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25) !important;
}

/* Cost table cell wrap & padding tuning */
.po-cost-select {
  white-space: normal !important;
  word-break: break-word !important;
  line-height: 1.3 !important;
  height: auto !important;
  padding: 4px 6px !important;
}

/* Popup Close Buttons - Crisp & Clear ERP Styling */
.btn-close-popup {
  background-color: #F8FAFC !important;
  border: 1px solid #CBD5E1 !important;
  color: #334155 !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  font-size: 0.8125rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
}
.btn-close-popup:hover {
  background-color: #E2E8F0 !important;
  border-color: #94A3B8 !important;
  color: #0F172A !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

/* Currency Select in Cost Table */
.po-currency-select {
  min-width: 58px !important;
  width: 60px !important;
  text-align: center !important;
  font-weight: 800 !important;
  padding: 4px 18px 4px 6px !important;
}


/* ========================================================================= */
/* 10. MODAL LỊCH SỬ PO, TRA CỨU LINH KIỆN & THẺ TÊN XUẤT HÓA ĐƠN STEP 3    */
/* ========================================================================= */

/* --- Modal Headers --- */
#modal-po-product-history .popup-hdr,
#modal-po-linh-kien-lookup .popup-hdr {
  background: linear-gradient(135deg, #1E3A8A 0%, #25478B 100%) !important;
  color: #ffffff !important;
  padding: 14px 20px !important;
  border-bottom: 1px solid #1e3a73 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  border-radius: 16px 16px 0 0 !important;
}

#modal-po-product-history .popup-hdr h3,
#modal-po-linh-kien-lookup .popup-hdr h3 {
  margin: 0 !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  letter-spacing: -0.01em !important;
}

#modal-po-product-history .popup-close-btn,
#modal-po-linh-kien-lookup .popup-close-btn {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  color: #e0e7ff !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

#modal-po-product-history .popup-close-btn:hover,
#modal-po-linh-kien-lookup .popup-close-btn:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
}

/* --- Hero Card Sản Phẩm Đang Tra Cứu (Modal Lịch Sử PO) --- */
.po-hist-hero-box {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  flex-wrap: wrap !important;
}

.po-hist-hero-thumb {
  width: 48px !important;
  height: 48px !important;
  border-radius: 10px !important;
  object-fit: cover !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  flex-shrink: 0 !important;
}

/* --- Empty State Lịch Sử Đơn PO --- */
.po-hist-empty-container {
  padding: 36px 20px !important;
  text-align: center !important;
  background: #ffffff !important;
  border: 1px dashed #cbd5e1 !important;
  border-radius: 12px !important;
  margin: 8px 0 !important;
}

.po-hist-empty-icon {
  width: 52px !important;
  height: 52px !important;
  border-radius: 50% !important;
  background-color: #f1f5f9 !important;
  color: #64748b !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-bottom: 10px !important;
}

/* --- Bảng Danh Sách Lịch Sử PO --- */
#table-po-history-list th {
  padding: 10px 12px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  color: #475569 !important;
  background-color: #f1f5f9 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  white-space: nowrap !important;
}

#table-po-history-list td {
  padding: 10px 12px !important;
  font-size: 12px !important;
  vertical-align: middle !important;
}

/* --- Thẻ Hộp Tên Xuất Hóa Đơn Nổi Bật (Bước 3) --- */
.po-invoice-name-card {
  background-color: rgba(236, 253, 245, 0.9) !important;
  border: 1px solid #6ee7b7 !important;
  border-radius: 8px !important;
  padding: 7px 10px !important;
  margin-top: 6px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.2s ease !important;
}

.po-invoice-name-card:hover {
  border-color: #059669 !important;
  background-color: #ecfdf5 !important;
  box-shadow: 0 2px 5px rgba(5, 150, 105, 0.15) !important;
}

.po-invoice-name-card .invoice-hdr {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  margin-bottom: 3px !important;
}

.po-invoice-name-card .invoice-label {
  font-size: 9.5px !important;
  font-weight: 800 !important;
  color: #065f46 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
}

.po-invoice-name-card .invoice-edit-btn {
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #047857 !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  padding: 0 !important;
  text-decoration: underline !important;
  transition: color 0.15s ease !important;
}

.po-invoice-name-card .invoice-edit-btn:hover {
  color: #064e3b !important;
}

.po-invoice-name-card .invoice-legal-name {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  line-height: 1.35 !important;
  word-break: break-word !important;
}

.po-invoice-name-card .invoice-meta {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
  margin-top: 4px !important;
  font-size: 9.5px !important;
  color: #475569 !important;
}

/* --- Nhóm Nút Rút Gọn Khi Chưa Có Tên HĐ (Bước 3 - Thiết kế Tinh Gọn) --- */
.po-invoice-btn-group {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex-wrap: wrap !important;
  margin-top: 3px !important;
}

.po-invoice-btn-assign {
  display: inline-flex !important;
  align-items: center !important;
  gap: 2.5px !important;
  font-size: 9.5px !important;
  font-weight: 600 !important;
  color: #9a3412 !important;
  background-color: #fffbeb !important;
  padding: 1.5px 6px !important;
  border-radius: 4px !important;
  border: 1px solid #fed7aa !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  line-height: 1.3 !important;
}

.po-invoice-btn-assign:hover {
  color: #1e3a8a !important;
  background-color: #eff6ff !important;
  border-color: #93c5fd !important;
}

.po-invoice-btn-quick {
  display: inline-flex !important;
  align-items: center !important;
  gap: 2.5px !important;
  font-size: 9.5px !important;
  font-weight: 600 !important;
  color: #475569 !important;
  background-color: #f8fafc !important;
  padding: 1.5px 6px !important;
  border-radius: 4px !important;
  border: 1px solid #e2e8f0 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  line-height: 1.3 !important;
}

.po-invoice-btn-quick:hover {
  color: #065f46 !important;
  background-color: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
}

/* --- Badge PO Nội Địa (Bước 3 - Nền Xanh Tươi Đậm, Chữ Trắng Tương Phản 100%) --- */
.po-badge-noi-dia {
  background-color: #0284C7 !important;
  color: #ffffff !important;
  border: 1px solid #0369A1 !important;
}

/* --- Banner Thành Công Bước 4 (Tương phản cao, viền xanh ngọc, bóng đổ nhẹ) --- */
.po-step4-banner {
  background: #ffffff !important;
  border: 2px solid rgba(16, 185, 129, 0.35) !important;
  box-shadow: 0 4px 16px -2px rgba(16, 185, 129, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

#wizard-step-4 {
  padding-top: 0.75rem;
}

/* ========================================================================= */
/* 11. PRINT MEDIA STYLESHEET                                                */
/* ========================================================================= */
@media print {
  body * {
    visibility: hidden !important;
  }

  #drawer-po-panel,
  #drawer-po-panel * {
    visibility: visible !important;
  }

  #drawer-po-panel {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
  }

  #drawer-po-backdrop,
  header,
  section,
  #modal-pr-detail,
  #modal-bang-gia-ncc,
  .app-sidebar,
  .app-header,
  .no-print {
    display: none !important;
  }

  #printable-po-area {
    padding: 0 !important;
    background: white !important;
  }

  .print\:border-none { border: none !important; }
  .print\:shadow-none { box-shadow: none !important; }
  .print\:p-0 { padding: 0 !important; }
}
