/* Inventory ledger: toolbar (search + stock-mode chips). */
.local-pos-inventory-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px 20px;
	margin: 18px 0 4px;
}

.local-pos-inventory-toolbar .local-pos-search {
	margin: 0;
	flex: 1 1 340px;
}

.local-pos-inventory-mode {
	display: grid;
	gap: 8px;
	flex: 0 0 auto;
}

.local-pos-inventory-mode .local-pos-chip-bar {
	margin: 0;
}

.local-pos-section-label {
	font-size: 13px;
	font-weight: 700;
}

/* Inventory ledger: one row per product inside a single bordered table. */
.local-pos-inventory-table {
	--local-pos-inv-columns: minmax(220px, 1.6fr) minmax(90px, 110px) 120px 120px 150px minmax(200px, 230px);
	border: 1px solid var(--local-pos-border);
	border-radius: var(--local-pos-radius-lg);
	background: #ffffff;
	box-shadow: var(--local-pos-shadow);
	overflow: hidden;
}

/* Empty state keeps its own card look, without the table chrome. */
.local-pos-inventory-table.is-empty {
	border: 0;
	box-shadow: none;
	background: transparent;
	overflow: visible;
}

.local-pos-inventory-header {
	display: grid;
	grid-template-columns: var(--local-pos-inv-columns);
	gap: 12px;
	align-items: center;
	padding: 10px 16px;
	background: var(--local-pos-bg);
	border-bottom: 1px solid var(--local-pos-border);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--local-pos-muted);
}

/* The stock column currently targeted by the adjustment chips. */
.local-pos-inventory-table:not(.is-mode-global) .local-pos-inv-col-local,
.local-pos-inventory-table.is-mode-global .local-pos-inv-col-global {
	color: var(--local-pos-accent-strong);
}

.local-pos-inv-col-actions {
	text-align: right;
}

.local-pos-inventory-row {
	display: grid;
	grid-template-columns: var(--local-pos-inv-columns);
	gap: 12px;
	align-items: center;
	padding: 12px 16px;
	border-bottom: 1px solid var(--local-pos-border);
	transition: background 140ms ease;
}

.local-pos-inventory-row:last-child {
	border-bottom: 0;
}

.local-pos-inventory-row:hover {
	background: var(--local-pos-bg);
}

.local-pos-inv-product {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.local-pos-inv-thumb {
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	border-radius: var(--local-pos-radius-md);
	background: var(--local-pos-accent-soft);
	color: var(--local-pos-accent-strong);
	font-weight: 700;
	font-size: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.local-pos-inv-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.local-pos-inv-name {
	min-width: 0;
	display: grid;
	gap: 2px;
}

.local-pos-inv-name h4 {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.local-pos-inv-meta {
	font-size: 12px;
	color: var(--local-pos-muted);
	overflow-wrap: anywhere;
}

.local-pos-inv-cell {
	min-width: 0;
	display: grid;
	gap: 4px;
	justify-items: start;
}

.local-pos-inv-price .local-pos-price-current {
	font-size: 15px;
	font-variant-numeric: tabular-nums;
}

/* Column labels repeated inside each row: hidden on desktop (the header
   row already names the columns), shown when rows stack on smaller screens. */
.local-pos-inv-cell-label {
	display: none;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--local-pos-muted);
}

/* Stock health pill styles are shared and live in base.css. */

.local-pos-inv-adjust-buttons {
	display: flex;
	gap: 6px;
}

.local-pos-inv-adjust-buttons .local-pos-mini-button {
	width: 42px;
	padding: 6px 0 !important;
	text-align: center;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.local-pos-inv-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: flex-end;
	justify-self: end;
}

.local-pos-inv-actions .local-pos-mini-button {
	padding: 6px 12px !important;
	font-size: 13px;
	font-weight: 600;
}

.local-pos-inv-sell {
	color: var(--local-pos-accent-strong) !important;
	border-color: rgba(124, 58, 237, 0.35) !important;
	font-weight: 700 !important;
}

.local-pos-inv-toggle {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	color: var(--local-pos-muted) !important;
}

.local-pos-inv-caret {
	width: 7px;
	height: 7px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	transition: transform 140ms ease;
}

.local-pos-inventory-row.is-expanded .local-pos-inv-caret {
	transform: rotate(-135deg) translateY(-2px);
}

/* Expandable per-row detail: categories live here instead of inflating
   every row. */
.local-pos-inv-detail {
	grid-column: 1 / -1;
	display: none;
}

.local-pos-inventory-row.is-expanded .local-pos-inv-detail {
	display: grid;
	gap: 10px;
	padding: 12px 0 4px;
	border-top: 1px dashed var(--local-pos-border);
}

.local-pos-category-save-button {
	width: auto !important;
	justify-self: start;
	padding: 8px 12px !important;
	font-size: 13px !important;
}

.local-pos-inv-danger-zone {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding-top: 10px;
	border-top: 1px dashed var(--local-pos-border);
}

.local-pos-inv-danger-zone .local-pos-history-meta {
	width: 100%;
	margin: 0;
}

.local-pos-inv-danger-zone .local-pos-mini-button {
	width: auto !important;
}

/* Prev/next paging for the global catalog. Empty (no results, or a single
   page) collapses to nothing rather than a class toggle, since .is-hidden
   in this project is a wired per-component selector list, not a generic
   display:none. */
.local-pos-inventory-pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 14px;
}

.local-pos-inventory-pagination:empty {
	display: none;
}

.local-pos-inventory-pagination-info {
	font-size: 13px;
	color: var(--local-pos-muted);
}

.local-pos-inventory-pagination-buttons {
	display: flex;
	gap: 8px;
}

.local-pos-inventory-pagination-buttons .local-pos-button {
	width: auto !important;
	padding: 8px 16px !important;
}

@media (max-width: 1100px) {
	.local-pos-inventory-header {
		display: none;
	}

	.local-pos-inv-cell-label {
		display: block;
	}

	.local-pos-inventory-row {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"product price"
			"stockl stockg"
			"adjust actions"
			"detail detail";
		align-items: start;
		row-gap: 14px;
		padding: 14px 16px;
	}

	.local-pos-inv-product {
		grid-area: product;
	}

	.local-pos-inv-price {
		grid-area: price;
		justify-items: end;
	}

	.local-pos-inv-stock-local {
		grid-area: stockl;
	}

	.local-pos-inv-stock-global {
		grid-area: stockg;
		justify-items: end;
	}

	.local-pos-inv-adjust {
		grid-area: adjust;
	}

	.local-pos-inv-actions {
		grid-area: actions;
		align-self: end;
	}

	.local-pos-inv-detail {
		grid-area: detail;
	}
}

@media (max-width: 720px) {
	.local-pos-inventory-row {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"product"
			"price"
			"stockl"
			"stockg"
			"adjust"
			"actions"
			"detail";
	}

	.local-pos-inv-price,
	.local-pos-inv-stock-global {
		justify-items: start;
	}

	.local-pos-inv-adjust-buttons {
		width: 100%;
	}

	.local-pos-inv-adjust-buttons .local-pos-mini-button {
		flex: 1;
		width: auto;
	}

	.local-pos-inv-actions {
		width: 100%;
		justify-content: stretch;
		justify-self: stretch;
	}

	.local-pos-inv-actions .local-pos-mini-button {
		flex: 1;
		justify-content: center;
		text-align: center;
	}
}
