/* OmniVenta V63.28.03 R20 — global alignment layer for dynamic / Excel-like tables. */

/*
 * Applied only to tables detected by omniventa-dynamic-table-grid-v6328r20.js.
 * The main goal is to keep every value anchored to the same visual top line when
 * a neighbouring text cell wraps to two or more lines. This avoids the old
 * "floating number" effect produced by vertical-align:middle.
 */
body.ov-responsive table.omniventa-dynamic-grid {
	border-collapse: separate;
	border-spacing: 0;
	min-width: 100%;
}

body.ov-responsive table.omniventa-dynamic-grid > thead > tr > th,
body.ov-responsive table.omniventa-dynamic-grid > tbody > tr > td,
body.ov-responsive table.omniventa-dynamic-grid > tfoot > tr > td {
	box-sizing: border-box;
}

/* Headers and filter rows remain vertically centered; data rows are top-aligned. */
body.ov-responsive table.omniventa-dynamic-grid > thead > tr > th {
	vertical-align: middle !important;
	line-height: 1.25;
}
body.ov-responsive table.omniventa-dynamic-grid > tbody > tr > td,
body.ov-responsive table.omniventa-dynamic-grid > tfoot > tr > td {
	vertical-align: top !important;
	line-height: 1.35;
}

/* A light spreadsheet grid makes it easy to follow one row while scrolling sideways. */
body.ov-responsive table.omniventa-dynamic-grid > thead > tr > th,
body.ov-responsive table.omniventa-dynamic-grid > tbody > tr > td {
	border-right: 1px solid rgba(90, 96, 110, .12);
	border-bottom: 1px solid rgba(90, 96, 110, .12);
}
body.ov-responsive table.omniventa-dynamic-grid > thead > tr > th:last-child,
body.ov-responsive table.omniventa-dynamic-grid > tbody > tr > td:last-child {
	border-right: 0;
}

/* Search/filter controls must occupy exactly their own header cell. */
body.ov-responsive table.omniventa-dynamic-grid > thead input[type="search"],
body.ov-responsive table.omniventa-dynamic-grid > thead input[type="text"],
body.ov-responsive table.omniventa-dynamic-grid > thead input[type="number"],
body.ov-responsive table.omniventa-dynamic-grid > thead select,
body.ov-responsive table.omniventa-dynamic-grid > thead .form-control {
	display: block;
	width: 100% !important;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

/* Respect the table's own horizontal semantics and propagate them to header/filter/body. */
body.ov-responsive table.omniventa-dynamic-grid .omni-grid-align-right {
	text-align: right !important;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
body.ov-responsive table.omniventa-dynamic-grid .omni-grid-align-center {
	text-align: center !important;
	font-variant-numeric: tabular-nums;
}
body.ov-responsive table.omniventa-dynamic-grid .omni-grid-numeric {
	font-variant-numeric: tabular-nums;
}

/* data-col grids (Movements, No sales, Shelf gaps, Planner, Supplies) share a stable base. */
body.ov-responsive table.omniventa-dynamic-grid [data-col] {
	box-sizing: border-box;
}
body.ov-responsive table.omniventa-dynamic-grid > tbody > tr > td[data-col] > .label,
body.ov-responsive table.omniventa-dynamic-grid > tbody > tr > td[data-col] > .badge {
	display: inline-block;
	vertical-align: top;
}

/* Modern inventory reports: explicit width/alignment contract shared by both screens. */
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid {
	margin-bottom: 0 !important;
	table-layout: auto;
}
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid > tbody > tr > td {
	vertical-align: top !important;
}
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid [data-col="id"],
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid [data-col="item_id"],
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid [data-col="trans_id"] { min-width: 78px; }
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid [data-col="code"],
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid [data-col="item_number"] { min-width: 118px; }
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid [data-col="item"] {
	min-width: 175px;
	max-width: 245px;
	white-space: normal;
	overflow-wrap: break-word;
}
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid [data-col="category"] { min-width: 138px; }
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid [data-col="group"] { min-width: 130px; }
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid [data-col="quantity"],
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid [data-col="before"],
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid [data-col="after"] { min-width: 94px; }
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid [data-col="movement_qty"] { min-width: 128px; }
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid [data-col="cost"] { min-width: 105px; }
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid [data-col="value"] { min-width: 128px; }
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid [data-col="last_sale"] { min-width: 122px; }
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid [data-col="days"] { min-width: 112px; }
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid [data-col="aging"] { min-width: 122px; }
body.ov-responsive table.modern-report-table.omniventa-dynamic-grid [data-col="period_sales"] { min-width: 116px; }

/* On phones keep the grid compact, but never vertically recenter body values. */
@media (max-width: 767px) {
	body.ov-responsive table.omniventa-dynamic-grid { font-size: 12px; }
	body.ov-responsive table.omniventa-dynamic-grid > thead > tr > th {
		padding-top: 7px !important;
		padding-bottom: 7px !important;
		font-size: 11px;
	}
	body.ov-responsive table.omniventa-dynamic-grid > tbody > tr > td {
		vertical-align: top !important;
		padding-top: 8px !important;
		padding-bottom: 8px !important;
	}
	body.ov-responsive table.omniventa-dynamic-grid > thead input[type="search"],
	body.ov-responsive table.omniventa-dynamic-grid > thead input[type="text"],
	body.ov-responsive table.omniventa-dynamic-grid > thead input[type="number"],
	body.ov-responsive table.omniventa-dynamic-grid > thead select,
	body.ov-responsive table.omniventa-dynamic-grid > thead .form-control {
		height: 30px;
		font-size: 12px;
		padding: 4px 5px;
	}
}

@media print {
	body.ov-responsive table.omniventa-dynamic-grid > thead > tr > th,
	body.ov-responsive table.omniventa-dynamic-grid > tbody > tr > td {
		border-color: #ddd;
	}
}
