/* Purchase — reuses app.css primitives (.gcc-panel/-head/-title/-body,
   .gcc-split, .gcc-toolbar, .gcc-search, .gcc-table, .gcc-num, .gcc-center,
   .empty-state, .center-loading, .gcc-btn, .gcc-date, .gcc-select, .stat-card)
   plus requests.css's .req-badge / .req-cell-* / .req-dl / .req-dv /
   .req-detail-grid / .req-priority-dot, and cheques.css's .gcc-modal-head /
   -body / -close on the shared .modal-box sheet (modal-box-lpo width from
   accounts.css). This file only adds the module-specific bits: the in-panel
   tab strip, the tall split rows, the pagination bar, the price-trend chart
   wrapper, the LPO/request detail callouts, and print rules for the Material
   Requests panel print. */

.po-shell { height: 100%; }

/* ---------- Tab strip ---------- */
.po-tabs {
  display: flex; gap: 2px; padding: 8px 12px 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface-2, #f8fafc);
}
.po-tab {
  border: 1px solid transparent; border-bottom: none;
  background: transparent; color: var(--text-muted, #64748b);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  padding: 8px 14px; border-radius: 8px 8px 0 0;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.12s ease;
  position: relative; top: 1px;
}
.po-tab:hover { color: var(--text, #0f172a); background: var(--gray-50, #f8fafc); }
.po-tab.active {
  background: var(--surface, #fff); color: var(--primary, #6366f1);
  border-color: var(--border, #e5e7eb);
}
.po-tab-body { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px; }
.po-pane { display: none; height: 100%; }
.po-pane.active { display: flex; flex-direction: column; min-height: 0; }
.po-pane > .gcc-panel { flex: 1; min-height: 0; }

/* ---------- Tall split rows ---------- */
.po-split-tall { height: 100%; min-height: 540px; align-items: stretch; }
.po-split-tall > .gcc-panel { min-height: 0; }
.po-split-tall .gcc-table-scroll { max-height: none; }
.po-history-panel { }
.po-details-body { overflow-y: auto; padding: 14px 16px; }

/* ---------- Suppliers pagination ---------- */
.po-pagination {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 8px 12px; border-top: 1px solid var(--border, #e5e7eb);
}
.po-pagination button { padding: 3px 9px; font-size: 12px; }
.po-pagination button:disabled { opacity: 0.45; cursor: default; }

/* ---------- Truncation / cells ---------- */
.po-truncate { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-item-desc {
  font-size: 11px; color: var(--text-muted, #64748b); margin-top: 2px;
  max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.po-item-badge {
  max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-left: 8px; font-weight: 600;
}

/* ---------- LPO / request detail panels ---------- */
.po-lpo-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  font-size: 14px;
}
.po-info-grid { margin-bottom: 14px; }
.po-total { color: var(--primary, #6366f1); font-weight: 700; font-size: 14px; }
.po-items-section { min-width: 0; }
.po-callout {
  margin-bottom: 14px; padding: 10px 14px; border-radius: 8px;
  background: var(--surface-2, #f8fafc); border-left: 3px solid var(--primary, #6366f1);
  font-size: 12.5px; color: var(--text, #0f172a);
}
.po-callout.warning { background: #fffbeb; border-left-color: #f59e0b; }
.po-callout.success { background: #ecfdf5; border-left-color: #10b981; }
.po-callout .req-dl { display: block; margin-bottom: 4px; }

/* ---------- Price-trend chart ---------- */
.po-chart-wrap { border-bottom: 1px solid var(--border, #e5e7eb); padding: 10px 14px; flex-shrink: 0; }
.po-chart-head {
  font-size: 11.5px; font-weight: 650; color: var(--text-muted, #64748b);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px;
}
.po-chart-canvas { position: relative; height: 170px; }

.po-stats { display: flex; gap: 12px; margin-bottom: 12px; }

/* ---------- Print (Material Requests panel) ---------- */
@media print {
  .po-tabs, .po-toolbar, .gcc-toolbar, .po-pagination,
  #poPrintRequest, .sidebar, .top-header { display: none !important; }
  .po-pane { display: none; }
  .po-pane.active { display: block; }
}
