/* Reset & Base Setup */
.menu-container {
  position: relative;
}

/* The Toggle Button */
.menu-toggle {
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 15px;
}

/* The Slide-Out Menu */
.slide-menu {
  position: fixed;
  top: 0;
  right: -250px; /* Hidden off-screen by default */
  width: 250px;
  height: 100vh;
  background-color: #333;
  padding-top: 60px;
  transition: right 0.3s ease-in-out;
  z-index: 2000;
  box-shadow: 2px 0 5px rgba(0,0,0,0.3);
}

.slide-menu.active {
  right: 0; /* Slides into view */
}

/* Menu Links */
.slide-menu ul {
  list-style: none;
  padding: 0;
}

.slide-menu ul li a {
  display: block;
  padding: 15px 20px;
  color: #fff;
  text-decoration: none;
}

.slide-menu ul li a:hover {
  background-color: #555;
}

/* Close Button */
.menu-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 30px;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
}

.dashboard-header {
  /* Crucial properties for stickiness */
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  
  /* Ensures the header stays on top of page content and slide-out menu */
  z-index: 1000; 

  /* Design safety practices for sticky layouts */
  background-color: #f30c0c; /* Change to your dashboard background color */
  box-shadow: 0 2px 10px rgb(0 0 0 / 75%); /* Adds separation when scrolling */
  
  /* Flexbox to space out your logo area and menu button */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 24px;
}
/* Overlay Background */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  z-index: 999;
}

.menu-overlay.active {
  visibility: visible;
  opacity: 1;
}

/* --- Header Panel Styling --- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn.success {
    background-color: #71e546;
    color: var(--primary, #000000);
}

/* --- Section Deck Containers --- */
#section-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

#block-order-cards {
    width: 100%;
}

/* --- Stat Card Custom Rule Exceptions --- */
.stat-card {
    height: 100%;
    box-sizing: border-box;
}

.interactive-dark-card {
    cursor: pointer;
    background-color: #2c3e50;
    color: white;
}

.urgent-radar-card {
    cursor: pointer;
    background-color: #fff;
    border: 1px solid #f87171;
}

.urgent-label {
    color: #dc2626;
    font-weight: 700;
}

/* --- Block Log Panel Styles --- */
.log-deck-card {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.log-title-label {
    color: #475569;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
}

.log-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.log-item {
    padding: 6px 10px;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
}

.blue-arrow {
    color: #2563eb;
}

/* --- Legacy UI Modals --- */
.legacy-save-container {
    margin-top: 10px;
}

#poModal {
    display: none;
    position: fixed;
    top: 10%;
    left: 20%;
    width: 60%;
    background: white;
    padding: 20px;
    border: 1px solid #ccc;
    z-index: 1000;
}

/* --- Header Actions Area --- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn--success {
    background-color: #71e546;
    color: var(--primary, #000000);
}

.btn--secondary {
    /* Fallback styles if .btn secondary isn't fully defined */
}

.btn--danger {
    /* Fallback styles if .btn danger isn't fully defined */
}

/* --- Executive Control Deck Structure --- */
.command-deck {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.command-deck__cards-slot {
    width: 100%;
}

/* --- Stat Card Modifier Variations --- */
.stat-card {
    height: 100%;
    box-sizing: border-box;
}

.stat-card--interactive-dark {
    cursor: pointer;
    background-color: #2c3e50;
    color: #ffffff;
}

.stat-card--interactive-warning {
    cursor: pointer;
    background-color: #ffffff;
    border: 1px solid #f87171;
}

.stat-card--log-deck {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* --- Label Elements --- */
.label--warning {
    color: #dc2626;
    font-weight: 700;
}

.label--log-title {
    color: #475569;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
}

/* --- Embedded Placed Orders Log Grid --- */
.log-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.log-grid__item {
    padding: 6px 10px;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
}

.log-grid__arrow {
    color: #2563eb;
}

/* --- Legacy Actions & Positioning Panels --- */
.legacy-actions {
    margin-top: 10px;
}

.legacy-po-modal {
    display: none;
    position: fixed;
    top: 10%;
    left: 20%;
    width: 60%;
    background: white;
    padding: 20px;
    border: 1px solid #ccc;
    z-index: 1000;
}

/* --- Modal Main Content Layout --- */
.modal-workspace {
    padding: 24px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background-color: #ffffff;
}

/* --- Metadata Dashboard Cards --- */
.modal-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.modal-meta-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 14px 16px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.modal-meta-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.modal-meta-value {
    font-size: 15px;
    font-weight: 600;
    color: #334155;
}

.modal-meta-value--primary {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary, #2c3e50);
}

.modal-meta-value--flex {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-urgency-wrapper {
    transform: scale(0.9);
    transform-origin: left;
}

/* --- Structural Table Layout --- */
.modal-table-wrapper {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.modal-data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.modal-header-row {
    background-color: var(--primary, #2c3e50);
    color: #ffffff;
}

.modal-th {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
}

.modal-th--center {
    text-align: center;
}

/* Table Header Width Constraints */
.modal-th--w15 { width: 15%; }
.modal-th--w40 { width: 40%; }
.modal-th--w10 { width: 10%; }

.modal-table-body {
    background-color: #ffffff;
}

/* --- Dynamic Table Rows & Cells --- */
.modal-table-row {
    background-color: var(--status-bg, transparent);
    border-bottom: 1px solid #edf2f7;
    transition: background 0.15s;
}

.modal-cell {
    padding: 14px 16px;
    vertical-align: middle;
    font-size: 13px;
}

.modal-cell--sku {
    font-weight: 600;
    color: #1e293b;
    font-family: monospace;
}

.modal-cell--desc {
    color: #334155;
    font-weight: 500;
    line-height: 1.4;
}

.modal-desc-text {
    font-size: 14px;
}

.modal-alias-tag {
    margin-top: 4px;
    display: inline-block;
    background: #e8f4fd;
    color: var(--accent, #3498db);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.modal-cell--numeric {
    text-align: center;
    font-weight: 600;
    color: #475569;
}

.modal-cell--ordered {
    color: var(--accent, #3498db);
    font-weight: 700;
}

.modal-cell--delivered {
    color: #64748b;
}

.modal-cell--center {
    text-align: center;
    font-weight: 700;
}

/* --- Balance Status Badges --- */
.modal-status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    display: inline-block;
}

.modal-status-badge--danger {
    background: #fef2f2;
    color: var(--danger, #e74c3c);
}

.modal-status-badge--success {
    background: #f0fdf4;
    color: var(--success, #27ae60);
}
/* --- Outer Accordion Framework --- */
.orders-accordion-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.orders-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #f8fafc;
    cursor: pointer;
    transition: background 0.2s;
}
.orders-accordion-header:hover {
    background: #f1f5f9;
}

.orders-accordion-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.orders-po-key {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary, #2c3e50);
    letter-spacing: 0.5px;
    font-family: monospace;
}

.orders-status-pill {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

/* --- Accordion Header Right Controls --- */
.orders-accordion-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-view-order {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--primary, #2c3e50);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-view-order:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.accordion-arrow {
    color: #94a3b8;
    font-size: 14px;
    padding-left: 4px;
    transform: scale(1.2);
}

/* --- Expanded Panel & Table Layout --- */
.orders-accordion-panel {
    display: none;
    border-top: 1px solid #e2e8f0;
    padding: 16px;
    background: #ffffff;
}

.inner-table-wrapper {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.01);
}

.grid-data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13.5px;
}

.inner-table-header-row {
    background-color: var(--primary, #2c3e50);
    color: #ffffff;
}

.inner-th {
    padding: 10px 16px;
    font-weight: 600;
    font-size: 12.5px;
    text-transform: uppercase;
}
.inner-th--center { text-align: center; }

/* Table Column Header Width Metrics */
.inner-th--w20 { width: 20%; }
.inner-th--w45 { width: 45%; }
.inner-th--w11 { width: 11%; }
.inner-th--w13 { width: 13%; }

/* --- Table Body Rows & Cells --- */
.inner-table-row {
    background-color: var(--row-bg, transparent);
    border-bottom: 1px solid #edf2f7;
    transition: background 0.15s;
}

.inner-cell {
    padding: 12px 16px;
    vertical-align: middle;
}

.inner-cell--sku {
    font-weight: 600;
    color: #1e293b;
    font-family: monospace;
    font-size: 13px;
}

.inner-cell--desc {
    color: #334155;
    font-weight: 500;
    font-size: 13.5px;
    line-height: 1.4;
}

.inner-cell--numeric {
    text-align: center;
    font-weight: 600;
    color: #475569;
}


/********************************
/ function renderProcurementRequired(list)
/*********************************


/* --- Global Fallbacks & Dynamic Layout Elements --- */
.empty-materials-notice {
    text-align: center;
    color: #27ae60;
}

.proc-accordion-header {
    display: flex;
    align-items: center;
    width: 100%;
}

.proc-print-wrapper {
    margin-left: auto;
}

.proc-commence-badge {
    margin-left: 20px;
    font-weight: 500;
    color: #1e40af;
    background: #eff6ff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
}

/* --- Internal Procurement Row Cells --- */
.proc-cell-center {
    text-align: center;
}

.proc-header-received {
    color: #16a34a;
}

.proc-cell-received {
    font-weight: 700;
}
.proc-cell-received--active {
    color: #16a34a;
}
.proc-cell-received--inactive {
    color: #64748b;
}

.proc-input-qty {
    width: 70px;
    text-align: center;
}

/* --- Nested Material Header Strips --- */
.group-header-row {
    background-color: #f1f5f9;
    font-weight: bold;
}

.group-header-cell {
    padding: 10px 12px;
    color: #1e293b;
}

.group-header-title {
    font-size: 14px;
}

.group-header-timeline {
    margin-left: 20px;
    font-weight: normal;
    color: #64748b;
    font-size: 12.5px;
}

.group-header-date-alert {
    color: #dc2626;
}

/* --- Action Trays Under Material Blocks --- */
.group-actions-cell {
    text-align: right;
}

.inner-cell--delivered {
    color: var(--accent, #3498db);
    font-weight: 700;
}

.inner-cell--center {
    text-align: center;
    font-weight: 700;
}

/* --- Row Fulfillment Badges --- */
.fill-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 600;
    display: inline-block;
}

.fill-badge--pending {
    background: #fffbeb;
    color: #b45309;
}

.fill-badge--complete {
    background: #dcfce7;
    color: var(--success, #27ae60);
}


/********************************
/ renderQuotesModal(filterBlock)
/*********************************


/* --- Empty Fallback State --- */
.pending-empty-state {
    padding: 40px;
    text-align: center;
    color: #64748b;
    font-family: sans-serif;
}

.pending-empty-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.pending-empty-text {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

/* --- Row Structure & Variations --- */
.quote-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    font-family: 'Segoe UI', system-ui, sans-serif;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1px solid #e2e8f0;
}

.quote-row--pending {
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
}

.quote-row--completed {
    background: #f8fafc;
    border-left: 4px solid var(--success, #27ae60);
}

/* --- Left ID & Badge Elements --- */
.quote-left-panel {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 140px;
}

.quote-display-id {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary, #2c3e50);
    font-family: monospace;
    letter-spacing: 0.5px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-badge--rfq {
    background: #e0f2fe;
    color: #0369a1;
}

.status-badge--priced {
    background: #fef3c7;
    color: #b45309;
}

.status-badge--po {
    background: #dcfce7;
    color: var(--success, #27ae60);
}

/* --- Central Meta Layout --- */
.quote-center-panel {
    flex: 1;
    padding: 0 24px;
    color: #475569;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.quote-supplier-name {
    color: #1e293b;
}

.quote-separator {
    color: #cbd5e1;
}

.quote-location-tag {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    color: #334155;
    font-weight: 600;
}

/* --- Global Action Tray Buttons --- */
.procurement-action-group {
    display: flex;
    gap: 8px;
}

.base-proc-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-enter-pricing {
    background: #ffffff;
    color: var(--primary, #2c3e50);
}

.btn-view-rfq {
    background: #ffffff;
    color: #64748b;
}

.btn-create-po {
    background: var(--success, #27ae60);
    border: none;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(39,174,96,0.15);
}

.btn-view-po {
    background: #ffffff;
    color: var(--primary, #2c3e50);
}

.btn-delete-quote {
    background: #fff5f5;
    color: #dc2626;
    border-color: #fca5a5 !important;
}
.btn-delete-quote:hover {
    background: #fee2e2;
    border-color: #ef4444 !important;
    color: #b91c1c;
}
/**********************************************
/ function generateRFQ(qKey)
/**********************************************
/* --- RFQ Layout Container --- */
.rfq-container {
    padding: 20px;
    max-width: 900px;
    margin: auto;
    font-family: Arial, sans-serif;
}

.rfq-title {
    margin-bottom: 5px;
}

.rfq-subtitle {
    color: #555;
    margin-bottom: 20px;
}

.rfq-meta {
    margin-bottom: 15px;
    line-height: 1.5;
}

/* --- Document Grid Table --- */
.rfq-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #cbd5e1; /* Replaces vintage border="1" */
}

.rfq-table-header-row {
    background: #f4f4f4;
}

.rfq-table-header-row th {
    padding: 8px 6px;
    text-align: left;
    border: 1px solid #cbd5e1;
}

.rfq-table-row {
    border-bottom: 1px solid #cbd5e1;
}

.rfq-cell {
    padding: 6px;
    border: 1px solid #cbd5e1;
}

.rfq-cell-center {
    text-align: center;
}

.rfq-table-header-row th.rfq-cell-center {
    text-align: center;
}

/* --- Instructions & Action Panels --- */
.rfq-instructions {
    margin-top: 20px;
    line-height: 1.5;
}

.rfq-actions {
    margin-top: 25px;
    text-align: right;
}

.rfq-btn-secondary {
    margin-left: 10px;
}

/********************************************
/ EXPORTPO
/********************************************
/* --- Immediate Processing Loader State --- */
.procurement-loader-container {
    padding: 40px;
    text-align: center;
    font-family: sans-serif;
}

.procurement-loader-text {
    font-size: 16px;
    font-weight: bold;
    color: #2a0c4b;
}

/* --- Document Success Panel Layout --- */
.po-success-panel {
    padding: 40px;
    font-family: sans-serif;
    background: #fff;
}

.po-success-title {
    margin-top: 0;
    color: #2a0c4b;
    border-bottom: 2px solid #ff5722;
    padding-bottom: 10px;
    text-transform: uppercase;
}

.po-success-body {
    margin: 30px 0;
    text-align: center;
}

.po-success-icon {
    font-size: 54px;
    margin-bottom: 15px;
}

.po-success-ref {
    color: #222;
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 8px;
}

.po-success-subtext {
    color: #666;
    font-size: 13.5px;
    max-width: 420px;
    margin: 0 auto 25px auto;
    line-height: 1.5;
}

/* --- Interactive Action Links and Buttons --- */
.po-download-link {
    display: inline-block;
    background: #2a0c4b;
    color: #fff;
    padding: 12px 28px;
    font-weight: bold;
    border-radius: 4px;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: background 0.15s ease-in-out;
}

.po-download-link:hover {
    background: #1e0836;
}

.po-success-footer {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
    text-align: right;
}

.po-btn-close {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.15s ease-in-out;
}

.po-btn-close:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

/***********************************************
/ ExportRFQwithSupplier
/***********************************************
/* --- Request for Quotation Success Panel --- */
.rfq-success-panel {
    padding: 40px;
    font-family: sans-serif;
    background: #fff;
}

.rfq-success-title {
    margin-top: 0;
    color: #2a0c4b;
    border-bottom: 2px solid #ff5722;
    padding-bottom: 10px;
    text-transform: uppercase;
}

.rfq-success-body {
    margin: 30px 0;
    text-align: center;
}

.rfq-success-icon {
    font-size: 54px;
    margin-bottom: 15px;
}

.rfq-success-ref {
    color: #222;
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 8px;
}

.rfq-success-subtext {
    color: #666;
    font-size: 13.5px;
    max-width: 420px;
    margin: 0 auto 25px auto;
    line-height: 1.5;
}

/* --- Action Control Trays --- */
.rfq-download-link {
    display: inline-block;
    background: #2a0c4b;
    color: #fff;
    padding: 12px 28px;
    font-weight: bold;
    border-radius: 4px;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: background 0.15s ease-in-out;
}

.rfq-download-link:hover {
    background: #1e0836;
}

.rfq-success-footer {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
    text-align: right;
}

.rfq-btn-close {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.15s ease-in-out;
}

.rfq-btn-close:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}


/************************************************
/async function openRFQPreview(data) 
/************************************************
/* --- Main Workspace Core Framework --- */
.rfq-preview-panel {
    padding: 24px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background-color: #ffffff;
}

/* --- Document Heading Header Banner Strip --- */
.rfq-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--accent, #3498db);
    padding-bottom: 12px;
    margin-bottom: 24px;
}

.rfq-preview-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary, #2c3e50);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rfq-preview-project-badge {
    font-size: 12px;
    background: #e8f4fd;
    color: var(--accent, #3498db);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

/* --- Parameter Selection Input Grid Layer --- */
.rfq-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(345px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.rfq-preview-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    display: flex;
    gap: 16px;
}

.rfq-flex-main {
    flex: 1;
}

.rfq-flex-side {
    flex: 1;
    min-width: 120px;
}

.rfq-preview-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Input & Dropdown Configurations --- */
.rfq-preview-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: #fff;
    font-size: 14px;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s;
    font-weight: 500;
}
.rfq-preview-select:focus {
    border-color: var(--accent, #3498db);
}

.rfq-preview-card .rfq-preview-select {
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.rfq-input-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 10px;
    height: 38px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.rfq-input-prefix {
    color: #94a3b8;
    font-weight: 600;
    margin-right: 4px;
}

.rfq-date-field,
.rfq-numeric-field {
    width: 100%;
    border: none;
    outline: none;
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    text-align: right;
    background: #fff;
    padding: 10px 0;
}

/* --- Core Data Listing Grid Assistant Table --- */
.rfq-table-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.rfq-assistant-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.rfq-assistant-header-row {
    background-color: var(--primary, #2c3e50);
    color: #ffffff;
}

.rfq-assistant-header-row th {
    padding: 8px;
}

.rfq-th-checkbox {
    width: 3%;
    text-align: center;
    vertical-align: middle;
}

.rfq-master-chk {
    transform: scale(1.2);
    cursor: pointer;
}

.rfq-th-sortable {
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    width: 9%;
    text-align: center;
}

.rfq-th-desc {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    width: 36%;
    cursor: pointer;
}

.rfq-th-qty {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    width: 10%;
    text-align: center;
}

.rfq-th-price {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    width: 8%;
    text-align: right;
}

.rfq-th-total {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    width: 15%;
    text-align: right;
}

#po-items-table-body-container tr {
    background-color: #ffffff;
    border-bottom: 1px solid #edf2f7;
    transition: background 0.15s;
}
#po-items-table-body-container td {
    padding: 10px;
    color: #1e293b;
    font-size: 13px;
    vertical-align: middle;
}
#po-items-table-body-container input {
    width: 75px;
    text-align: center;
    padding: 4px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-weight: 700;
}
/* --- Generated Items Body Rows & Checkboxes --- */
#input-assistant-rows-body {
    background-color: #ffffff;
}

.rfq-assistant-row {
    border-bottom: 1px solid #edf2f7;
    transition: background 0.15s;
}

.rfq-row--even { background-color: #ffffff; }
.rfq-row--odd { background-color: #f8fafc; }

.rfq-assistant-row td {
    padding: 14px 16px;
    vertical-align: middle;
}

.rfq-td-checkbox {
    text-align: center;
}

.rfq-row-chk {
    transform: scale(1.1);
    cursor: pointer;
}

.rfq-td-sku {
    font-weight: 600;
    color: #1e293b;
    font-family: monospace;
    font-size: 13px;
}

.rfq-td-mssheet {
    color: #64748b;
    font-size: 13px;
}

.rfq-td-desc {
    color: #334155;
    font-weight: 500;
    line-height: 1.4;
}
/* --- Table Dynamic Input Cells --- */
.po-td-qty {
    text-align: center;
    font-weight: 700;
    color: #0f172a;
    vertical-align: middle;
}

.rfq-input-clean-qty {
    width: 70px;
    text-align: center;
    padding: 4px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-weight: 700;
}

.po-td-price-input {
    text-align: right;
    vertical-align: middle;
    padding: 10px 16px;
}

.rfq-price-input-box {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 4px 8px;
}

.rfq-price-symbol {
    color: #94a3b8;
    margin-right: 4px;
    font-weight: 600;
}

.rfq-price-field-raw {
    width: 75px;
    border: none;
    outline: none;
    text-align: right;
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    background: transparent;
}

.po-td-total-value {
    padding: 14px 16px;
    text-align: right;
    font-weight: 600;
    color: #1e293b;
    font-size: 13.5px;
    vertical-align: middle;
    width: 90px;
}

/* --- Table Calculation Summary Footer --- */
.po-summary-total-row {
    background: #f1f5f9;
    border-top: 2px solid #cbd5e1;
}

.po-summary-label-cell {
    padding: 16px;
    text-align: right;
    font-weight: bold;
    color: #475569;
    font-size: 14px;
}

.po-summary-value-cell {
    padding: 16px;
    text-align: right;
    font-weight: 800;
    color: #2a0c4b;
    font-size: 16px;
    border-left: 1px solid #e2e8f0;
}

/* --- Ad-Hoc Inline Injection Elements --- */
.rfq-adhoc-trigger-container {
    margin-top: -12px;
    margin-bottom: 24px;
    text-align: left;
}

.rfq-btn-adhoc-inject {
    background: #ffffff;
    border: 1px dashed var(--accent, #3498db);
    color: var(--accent, #3498db);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.rfq-btn-adhoc-inject:hover {
    background: #f0f9ff;
    border-color: #2563eb;
    color: #2563eb;
}

/* --- Modal Base Panel Control Footer --- */
.rfq-modal-action-footer {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.rfq-btn-modal-cancel {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.rfq-btn-modal-cancel:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #1e293b;
}

/* Base button properties for fallback clarity or extension */
.rfq-btn-modal-submit {
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

/************************************************
/function injectManualAdHocRow(mode) 
/************************************************
/* --- Table Injection Base Cells --- */
.adhoc-td-checkbox {
    padding: 10px 16px;
    text-align: center;
    vertical-align: middle;
}

.adhoc-td-checkbox input[type="checkbox"] {
    transform: scale(1.1);
    cursor: pointer;
}

.adhoc-td-field {
    padding: 8px 12px;
    vertical-align: middle;
}

.adhoc-td-field--wide {
    width: 40%; /* Matches structural alignment weight */
}

.adhoc-td-qty {
    padding: 8px 12px;
    text-align: center;
    vertical-align: middle;
}

.adhoc-td-price {
    padding: 8px 12px;
    text-align: right;
    vertical-align: middle;
}

/* --- Interactive Code & Value Text Fields --- */
.adhoc-input-text-code {
    width: 90%;
    padding: 6px 8px;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12.5px;
    font-weight: 600;
    text-transform: uppercase;
}

.adhoc-input-text-desc {
    width: 95%;
    padding: 6px 8px;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

/* --- Quantities & Pricing Input Infrastructure --- */
.adhoc-input-numeric-qty {
    width: 60px;
    padding: 6px 4px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    text-align: center;
    font-weight: 700;
    color: #1e293b;
}

.adhoc-price-wrapper {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 4px 8px;
}

.adhoc-price-currency {
    color: #94a3b8;
    margin-right: 4px;
    font-weight: 600;
}

.adhoc-input-numeric-price {
    width: 75px;
    border: none;
    outline: none;
    text-align: right;
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    background: transparent;
}

/********************************************
/ function renderPricingFields(quote) 
/********************************************
/* --- Edit Pricing Grid Table --- */
.pricing-edit-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 14px;
}

.pricing-edit-header-row th {
    padding: 10px 12px;
    text-align: left;
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 600;
    border-bottom: 2px solid #cbd5e1;
}

.pricing-edit-row {
    border-bottom: 1px solid #e2e8f0;
}

.pricing-edit-row td {
    padding: 10px 12px;
    vertical-align: middle;
}

.pricing-edit-cell-desc {
    color: #1e293b;
    font-weight: 500;
}

.pricing-edit-cell-qty {
    color: #475569;
    font-weight: 600;
}

.pricing-edit-cell-input {
    width: 110px;
}

.pricing-input-raw {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 13.5px;
    text-align: right;
    box-sizing: border-box;
}

/* --- Form Fields & Metadata Layout --- */
.pricing-meta-fields-container {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 14px;
    color: #334155;
}

.pricing-meta-field-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pricing-meta-field-group label {
    font-weight: 600;
    min-width: 130px;
}

.pricing-meta-input {
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 13.5px;
    width: 120px;
}

.pricing-meta-field-group--textarea {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
}

.pricing-textarea-raw {
    width: 100%;
    min-height: 80px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13.5px;
    resize: vertical;
    box-sizing: border-box;
}
/***************************************
/function openCommercialAnalyticsModal()
/***************************************
/* --- Analytics Layout Framework --- */
.analytics-layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    width: 100%;
}

.analytics-chart-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.analytics-chart-title {
    margin: 0 0 16px 0;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- Progress Bar Deck Assemblies --- */
.analytics-bar-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.analytics-bar-stack.gap-sm {
    gap: 14px;
}

.analytics-bar-row {
    width: 100%;
}

.analytics-bar-label-group {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.analytics-bar-label-group.text-sm {
    font-size: 12.5px;
    margin-bottom: 4px;
}

.analytics-label-main {
    color: #0f172a;
}

.analytics-bar-label-group.text-sm .analytics-label-main {
    color: #334155;
}

.analytics-value-monospace {
    font-family: monospace;
    color: #1e293b;
}

.analytics-bar-label-group.text-sm .analytics-value-monospace {
    color: #0f172a;
}

.analytics-pct-sub {
    color: #64748b;
    font-size: 11px;
    font-weight: 500;
    margin-left: 4px;
}

/* --- Progress Bar Track Elements --- */
.analytics-progress-container {
    width: 100%;
    background: #f1f5f9;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
}

.analytics-progress-container.height-sm {
    height: 10px;
    border-radius: 50px;
}

.analytics-progress-bar {
    width: var(--bar-width, 0%);
    height: 100%;
    transition: width 0.4s ease-out;
}

.analytics-progress-bar--blue {
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 6px;
}

.analytics-progress-bar--pink {
    background: linear-gradient(90deg, #ec4899, #db2777);
    border-radius: 50px;
}

/* --- Lower Info Status Grid --- */
.analytics-metrics-strip {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.analytics-metric-tile {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 14px;
    border-radius: 6px;
    text-align: center;
}

.analytics-tile-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.analytics-tile-value {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin-top: 4px;
}

.analytics-tile-value.value-mono {
    font-family: monospace;
}

/* --- Utility Class rules --- */
.truncate-text {
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/***************************************
/window.togglePlacedOrdersView = function() 
/***************************************

/* --- Empty Fallback Notice --- */
.backlog-empty-notice {
    text-align: center;
    color: #7f8c8d;
    padding: 40px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
}

/* --- Layout Wrappers --- */
.backlog-wrapper {
    margin-bottom: 25px;
    display: block !important;
}

.backlog-content {
    display: block !important;
}

/* --- Upper Green Actions Banner --- */
.backlog-banner {
    background: #27ae60;
    color: white;
    padding: 12px;
    font-weight: bold;
    margin-bottom: 15px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.backlog-btn-close {
    background: white;
    color: #27ae60;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: background-color 0.15s ease;
}
.backlog-btn-close:hover {
    background: #f8fafc;
}

/* --- Accordion Rows Framework --- */
.backlog-accordion-item {
    border: 1px solid #cbd5e1;
    margin-bottom: 10px;
    border-radius: 4px;
    background: #fff;
    display: block !important;
    overflow: hidden;
}

.backlog-accordion-header {
    display: flex;
    padding: 12px;
    background: #f4fbf7;
    cursor: pointer;
    font-weight: 600;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}
.backlog-accordion-header:hover {
    background: #eaf8f0;
}

.backlog-po-id {
    color: #27ae60;
    font-weight: bold;
    margin-right: 15px;
    font-size: 1.05em;
}

.backlog-location-text {
    color: #334155;
    margin-right: 20px;
    font-size: 13.5px;
}

.backlog-vendor-text {
    color: #64748b;
    font-weight: normal;
    font-size: 13.5px;
}

.backlog-expand-indicator {
    margin-left: auto;
    font-size: 12px;
    color: #a1a1aa;
    font-weight: normal;
}

.backlog-accordion-panel {
    display: none;
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
}

/* --- Internal Read-Only Table Layout --- */
.backlog-inner-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.backlog-table-header {
    background: #f8fafc;
    text-align: left;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

.backlog-table-header th {
    padding: 8px;
}

.backlog-th-center {
    text-align: center;
}

.backlog-th-right {
    text-align: right;
    padding-right: 10px !important;
}

.backlog-table-body {
    color: #334155;
}

.backlog-table-row {
    border-bottom: 1px solid #f1f5f9;
}

.backlog-table-row td {
    padding: 8px;
    vertical-align: middle;
}

.backlog-cell-sku {
    font-family: monospace;
}

.backlog-cell-ms {
    color: #475569;
}

.backlog-cell-desc {
    color: #334155;
}

.backlog-cell-volume {
    text-align: center;
    font-weight: bold;
    color: #27ae60;
}

.backlog-cell-rate {
    text-align: right;
    font-weight: normal;
    padding-right: 10px !important;
}

/******************************************************
/window.sortInputAssistantRows = function(criterion)
/******************************************************
/* --- Assistant Row Layouts --- */
.assistant-table-row {
    background-color: var(--assistant-bg, transparent);
    border-bottom: 1px solid #edf2f7;
    transition: background 0.15s;
    padding: 0px;
}

.assistant-table-row td {
    padding: 14px 16px;
    vertical-align: middle;
}

/* --- Core Cell Customisations --- */
.assistant-cell-checkbox {
    text-align: center;
}

.assistant-cell-checkbox input[type="checkbox"] {
    transform: scale(1.1);
    cursor: pointer;
}

.assistant-cell-sku {
    font-weight: 600;
    color: #1e293b;
    font-family: monospace;
    font-size: 13px;
}

.assistant-cell-mssheet {
    color: #64748b;
    font-size: 13px;
}

.assistant-cell-desc {
    color: #334155;
    font-weight: 500;
    line-height: 1.4;
}

/* --- Quantities & Pricing Elements --- */
.assistant-cell-qty {
    text-align: center;
}

.assistant-qty-input {
    width: 70px;
    text-align: center;
    padding: 4px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-weight: 700;
}

.assistant-cell-price-input {
    text-align: right;
    padding: 10px 16px !important;
}

.assistant-price-box {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 4px 8px;
}

.assistant-currency-symbol {
    color: #94a3b8;
    margin-right: 4px;
    font-weight: 600;
}

.assistant-price-input-field {
    width: 75px;
    border: none;
    outline: none;
    text-align: right;
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    background: transparent;
}

.assistant-cell-total-value {
    text-align: right;
    font-weight: 600;
    color: #1e293b;
    font-size: 13.5px;
    width: 90px;
}
.assistant-cell-pool, .assistant-cell-req {
    text-align:center;
}
.surplus-text {
    font-size: 10px;
    color: #ff5722;
    font-weight: 700;
    margin-top: 3px;
}
.moq-text{
    font-size: 9px;
    color: #0d07a2;
    text-align: center;
    margin-top: 2px;
}
/* --- Table Calculation Summary Footer --- */
.assistant-totals-row {
    background: #f1f5f9;
    border-top: 2px solid #cbd5e1;
}

.assistant-totals-label {
    padding: 16px;
    text-align: right;
    font-weight: bold;
    color: #475569;
    font-size: 14px;
}

.assistant-totals-value {
    padding: 16px;
    text-align: right;
    font-weight: 800;
    color: #2a0c4b;
    font-size: 16px;
    border-left: 1px solid #e2e8f0;
}

/***************************************************
/export function toggleUrgentRadarWarningView()
/***************************************************
/* --- Empty Cover Fallback State --- */
.radar-empty-notice-cell {
    text-align: center; 
    padding: 40px; 
    color: #16a34a; 
    font-weight: bold; 
    background: #f0fdf4;
}

/* --- Active Alert Row Structural Configurations --- */
.radar-alert-row {
    background-color: #fff5f5; 
    border-left: 4px solid #dc2626;
}

.radar-alert-row td {
    padding: 12px 8px;
    vertical-align: middle;
}

.radar-alert-row span {
    background: #fff7ed;
    color: #c2410c;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-right: 8px;
    display: inline-block;
    min-width: 134px;
}
/* --- Internal Table Data Column Details --- */
.radar-alert-cell-date {
    color: #b91c1c; 
    font-weight: 700;
}

.radar-alert-cell-location {
    font-weight: 600; 
    color: #1e293b;
}

.radar-alert-cell-task {
    line-height: 1.4;
}

.radar-alert-countdown-badge {
    color: #7f1d1d; 
    background: #fecaca; 
    padding: 2px 6px; 
    border-radius: 3px; 
    font-size: 11px; 
    font-weight: bold; 
    margin-right: 8px; 
    display: inline-block;
}

.radar-alert-cell-received {
    text-align: center; 
    font-weight: 500;
    color: #334155;
}

.radar-alert-cell-missing {
    text-align: center; 
    font-weight: 700; 
    color: #dc2626;
}

.radar-alert-cell-actions {
    text-align: center;
}

/* --- Urgent Immediate Procurement Trigger Action --- */
.radar-btn-emit-urgent {
    background: #dc2626; 
    color: white; 
    border: none; 
    padding: 6px 12px; 
    border-radius: 4px; 
    font-weight: bold; 
    cursor: pointer; 
    font-size: 11.5px; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: background-color 0.15s ease, transform 0.1s ease;
}
.radar-btn-emit-urgent:hover {
    background: #b91c1c;
}
.radar-btn-emit-urgent:active {
    transform: scale(0.98);
}
/**********************************************
/
/**********************************************
/* Overlay */
.bo-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  backdrop-filter: blur(2px);
}

/* Modal shell */
.bo-modal {
  background: #fff;
  width: 1400px;
  max-height: 85%;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
}

.bo-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #2563eb;
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.bo-modal-title {
  margin: 0;
  color: #0f172a;
  font-size: 17px;
  text-transform: uppercase;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bo-close {
  background: none;
  border: none;
  font-size: 24px;
  font-weight: 700;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  margin: 0;
}

.bo-modal-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 6px;
  margin-bottom: 15px;
}

.bo-modal-footer {
  border-top: 1px solid #e2e8f0;
  padding-top: 15px;
  text-align: right;
}
/* --- Accordion Trigger Configuration --- */
.bo-accordion-trigger {
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.bo-accordion-trigger:hover {
    background-color: #f1f5f9;
}

/* --- Nested Container Management Trays --- */
.bo-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto; /* Aligns controls perfectly to the right border edge */
}

.bo-header-btn {
    padding: 4px 10px;
    font-size: 12px;
}

.bo-accordion-arrow {
    color: #94a3b8;
    font-size: 12px;
    font-weight: bold;
    transform: scale(1.1);
    padding-right: 4px;
}

.bo-accordion-panel {
    border-top: 1px solid #e2e8f0;
}
/* --- Base Accordion Arrow Configuration --- */
.bo-accordion-arrow {
    display: inline-block;
    color: #94a3b8;
    font-size: 12px;
    font-weight: bold;
    transform: scale(1.1) rotate(0deg);
    transition: transform 0.2s ease-in-out; /* Handles the fluid motion when clicked */
}

/* --- Rotated Active State Modifier --- */
.bo-accordion-arrow--rotated {
    /* Rotates the indicator arrow 180 degrees backwards or forwards smoothly */
    transform: scale(1.1) rotate(-180deg);
    color: var(--primary, #2c3e50); /* Subtle visual anchor hint that the box is active */
}

/* Buttons */
.bo-btn {
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  padding: 10px 24px;
  border: none;
}

.bo-btn--primary {
  background: #0f172a;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.bo-btn--ghost {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  width: 100%;
  padding: 9px 22px;
}

/* Cards */
.bo-card {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  margin-bottom: 16px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.bo-card--empty {
  width: 460px;
  padding: 35px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.15);
}

.bo-empty-icon {
  font-size: 52px;
  margin-bottom: 12px;
}

.bo-empty-title {
  margin: 0;
  color: #1e293b;
  font-size: 18px;
  font-weight: 700;
}

.bo-empty-text {
  color: #64748b;
  font-size: 13.5px;
  margin: 0 auto 25px auto;
  line-height: 1.5;
  max-width: 320px;
}

/* Card header/body */
.bo-card-header {
  padding: 11px 14px;
  background: #f8fafc;
  display: grid;
  gap: 52px;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  grid-template-columns: 289px 99px 188px 230px 149px 1fr;
}

.bo-ref__id {
  color: #2563eb;
}

.bo-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
}

.bo-chip--level {
  background: #e0f2fe;
  color: #0369a1;
}

.bo-chip--block {
  background: #dbeafe;
  color: #1e40af;
}

.bo-card-body {
  padding: 12px;
  background: #fff;
}
/* --- Accordion Parent Card Border Accents --- */
.bo-accordion-item {
    border-left: 5px solid #cbd5e1; /* Default outstanding grey */
}
.bo-accordion-item--state-partial {
    border-left: 5px solid #f59e0b; /* Part-delivered amber */
}
.bo-accordion-item--state-full {
    border-left: 5px solid #10b981; /* Fully-received emerald green */
}

/* --- Dynamic Card Header Text Badges --- */
.bo-card-state-badge {
    /* font-size: 11.5px; */
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
    margin-left: 16px;
    display: inline-block;
    letter-spacing: 0.3px;
}
.bo-card-state-badge--none {
    background-color: #f1f5f9;
    color: #64748b;
}
.bo-card-state-badge--partial {
    background-color: #fffbeb;
    color: #b45309;
}
.bo-card-state-badge--full {
    background-color: #ecfdf5;
    color: #047857;
}
/* Table */
.bo-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.bo-th, .bo-td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
}

.bo-th {
  border-bottom: 2px solid #cbd5e1;
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
}

.bo-th--num, .bo-td--num {
  text-align: right;
  white-space: nowrap;
}

.bo-th--green {
  color: #16a34a;
}

.bo-td--sku {
  font-family: monospace;
  font-weight: 600;
  color: #0f172a;
  font-size: 12.5px;
}

.bo-td--mss {
  color: #475569;
  font-size: 12.5px;
  font-family: monospace;
}

.bo-td--desc {
  color: #334155;
  font-size: 12.5px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bo-td--ordered {
  font-weight: 700;
  color: #1e40af;
  font-size: 13px;
}

.bo-td--received {
  font-weight: 800;
  font-size: 13px;
}

/* Row states */
.bo-row--none .bo-td--received { color: #64748b; background: transparent; }
.bo-row--partial .bo-td--received { color: #d97706; background: #fffbeb; }
.bo-row--full .bo-td--received { color: #16a34a; background: #f0fdf4; }


