/**
 * Smart Purchase Order Generator – BusinessZindagi original styles
 */
.bz-po { overflow-x: hidden; }
.bz-po-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.bz-po-toolbar .bz-btn {
	display: inline-flex !important; align-items: center !important; justify-content: center !important;
	min-height: 44px !important; padding: 10px 16px !important; border-radius: 12px !important; font-weight: 600 !important;
}
.bz-po-history { margin-bottom: 20px; }
.bz-po-history-list { display: grid; gap: 10px; margin: 12px 0 16px; }
.bz-po-hist-card {
	display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
	padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff;
}
.bz-po-hist-meta { font-size: 0.8rem; color: var(--bz-text-muted); }

.bz-po-layout {
	display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
	gap: 22px; align-items: start;
}
.bz-po-h { margin: 0 0 14px; font-size: 1.08rem; font-weight: 700; padding-bottom: 10px; border-bottom: 1px solid rgba(0,0,0,.07); }
.bz-po-subh { margin: 16px 0 10px; font-size: 0.95rem; font-weight: 700; color: #1e40af; }
.bz-po-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 16px; }
.bz-po-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px 16px; }
.bz-po-span2 { grid-column: 1 / -1; }
.bz-po .bz-form-group { margin-bottom: 0; }
.bz-po .bz-input { min-height: 44px; }
.bz-po-intl {
	margin-top: 14px; padding: 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px;
}

.bz-po-table-wrap {
	overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 12px; background: #fff;
}
.bz-po-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 0.85rem; }
.bz-po-table th {
	background: #eff6ff; padding: 10px 6px; text-align: left; font-weight: 700; font-size: 0.72rem;
	color: #1e40af; border-bottom: 1px solid #dbeafe;
}
.bz-po-table td { padding: 6px 4px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.bz-po-table .bz-input { min-height: 38px; padding: 6px 8px; font-size: 13px; width: 100%; }
.po-amt { font-weight: 700; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.bz-po-totals {
	display: grid; gap: 8px; background: #f8fafc; border: 1px solid #e2e8f0;
	padding: 14px 16px; border-radius: 12px; margin-top: 12px;
}
.bz-po-totals > div { display: flex; justify-content: space-between; gap: 12px; }
.bz-po-grand { font-size: 1.08rem; font-weight: 700; color: var(--bz-primary); padding-top: 8px; border-top: 1px solid #e2e8f0; }
.bz-po-words { flex-direction: column !important; align-items: flex-start !important; gap: 4px !important; font-size: 0.85rem; }
.bz-po-words em { font-style: normal; font-weight: 600; color: #334155; }

.bz-po-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 8px; }
.bz-po-actions .bz-po-btn, .bz-po-actions .bz-btn {
	display: inline-flex !important; align-items: center !important; justify-content: center !important;
	min-height: 52px !important; padding: 12px 18px !important; line-height: 1.25 !important;
	border-radius: 12px !important; font-weight: 600 !important; white-space: nowrap;
}

.bz-po-preview-sticky { position: sticky; top: 16px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.bz-po-preview-bar { display: flex; justify-content: space-between; margin-bottom: 10px; }
.bz-po-a4 { font-size: 0.7rem; font-weight: 700; padding: 4px 10px; border-radius: 6px; background: #dbeafe; color: #1e40af; }
.bz-po-sheet {
	background: #fff; color: #111; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px;
	font-size: 0.78rem; line-height: 1.45; overflow: auto; flex: 1; min-height: 240px; max-height: calc(100vh - 100px);
}
.bz-po-sheet .po-doc-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.bz-po-sheet .po-doc-title { font-size: 1.2rem; font-weight: 800; color: #1e40af; letter-spacing: 0.03em; }
.bz-po-sheet .po-doc-co { font-weight: 700; }
.bz-po-sheet .po-doc-muted { color: #555; font-size: 0.72rem; }
.bz-po-sheet .po-doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.bz-po-sheet .po-doc-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.bz-po-sheet .po-doc-table th, .bz-po-sheet .po-doc-table td { border: 1px solid #ccc; padding: 6px; font-size: 0.72rem; }
.bz-po-sheet .po-doc-table th { background: #eff6ff; }
.bz-po-sheet .po-doc-totals { text-align: right; }
.bz-po-sheet .po-doc-grand { font-weight: 700; font-size: 0.95rem; }
.bz-po-sheet .po-doc-sign { display: flex; gap: 40px; margin-top: 28px; flex-wrap: wrap; }
.bz-po-sheet .po-sign-box { border-top: 1px solid #999; min-width: 140px; padding-top: 6px; font-size: 0.7rem; }
.bz-po-sheet .po-badge {
	display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.65rem; font-weight: 700;
	background: #dbeafe; color: #1e40af; margin-left: 6px;
}

@media (max-width: 1024px) {
	.bz-po-layout { grid-template-columns: 1fr; }
	.bz-po-preview-sticky { position: static; max-height: none; }
	.bz-po-sheet { max-height: none; }
	.bz-po-grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
	.bz-po-grid2, .bz-po-grid3 { grid-template-columns: 1fr; }
	.bz-po-actions .bz-btn { width: 100%; }
}
@media print {
	.bz-back-link, .bz-po-toolbar, .bz-po-form, .bz-po-actions, .bz-calc-note, .bz-po-preview-bar, .bz-po-history {
		display: none !important;
	}
	.bz-po-sheet { box-shadow: none !important; border: none !important; max-height: none !important; }
}
