* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: "DM Sans", sans-serif;
	background: linear-gradient(
		135deg,
		var(--body-bg-start) 0%,
		var(--body-bg-end) 100%
	);
	padding: 20px;
	min-height: 100vh;
}

.container {
	background-color: var(--surface);
	border-radius: 20px;
	max-width: 1400px;
	margin: 0 auto;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	border: 3px solid var(--accent-dark);
}

/* HEADER */
.header {
	background: linear-gradient(135deg, var(--accent), var(--accent-light));
	padding: 20px 30px;
	border-radius: 17px 17px 0 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 3px solid var(--accent-dark);
}
.header h1 {
	color: white;
	font-size: 26px;
	font-weight: bold;
}
.user-badge {
	background-color: var(--text-muted);
	padding: 10px 22px;
	border-radius: 25px;
	color: var(--text);
	font-weight: bold;
	font-size: 15px;
}

/* =============================================
   STEP BAR
   ============================================= */
.checkout-steps {
	display: flex;
	align-items: center;
	padding: 14px 28px;
	background: var(--surface-alt);
	border-bottom: 2px solid var(--surface-alt);
}
.step {
	display: flex;
	align-items: center;
	gap: 9px;
	flex-shrink: 0;
}
.step-circle {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 800;
	border: 2px solid transparent;
	transition: all 0.3s;
	position: relative;
}
.step-label {
	font-size: 11px;
	font-weight: 600;
	line-height: 1.3;
	transition: color 0.3s;
}
.step-active .step-circle {
	background: linear-gradient(
		135deg,
		var(--accent-dark),
		var(--accent-light)
	);
	color: white;
	box-shadow: 0 3px 10px rgba(90, 107, 66, 0.4);
}
.step-active .step-label {
	color: var(--accent-dark);
	font-weight: 700;
}
.step-done .step-circle {
	background: var(--success);
	color: transparent;
	font-size: 0;
	border-color: var(--accent);
}
.step-done .step-circle::after {
	content: "\2713";
	position: absolute;
	font-size: 12px;
	color: var(--surface);
	font-weight: 800;
}
.step-done .step-label {
	color: var(--accent);
	font-weight: 700;
}
.step-locked .step-circle {
	background: var(--surface-alt);
	color: var(--text-muted);
	border-color: var(--border);
}
.step-locked .step-label {
	color: var(--text-muted);
}
.step-connector {
	flex: 1;
	height: 3px;
	background: var(--surface-alt);
	margin: 0 8px;
	border-radius: 2px;
	transition: background 0.4s;
	min-width: 20px;
}
.step-connector.conn-done {
	background: var(--success);
}

.step-hint-bar {
	background: var(--surface-alt);
	border-bottom: 1px solid var(--surface-alt);
	padding: 8px 28px;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--accent-dark);
	font-weight: 500;
}
.shb-icon {
	font-size: 14px;
}

/* MAIN CONTENT */
.main-content {
	padding: 18px 22px;
	display: grid;
	grid-template-columns: 370px 128px 1fr;
	gap: 16px;
	align-items: start;
}

/* LEFT – item list */
.left-section {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.stock-top-bar {
	display: flex;
	gap: 7px;
}

.btn {
	padding: 9px 15px;
	border-radius: 20px;
	border: none;
	font-size: 13px;
	font-weight: bold;
	cursor: pointer;
	transition: all 0.3s;
	white-space: nowrap;
	font-family: inherit;
}
.btn:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18);
}
.btn:disabled {
	opacity: 0.45;
	cursor: default;
	transform: none !important;
}

.btn-primary {
	background: linear-gradient(135deg, var(--accent), var(--accent-light));
	color: white;
}
.btn-import {
	background: linear-gradient(135deg, var(--accent), var(--success));
	color: white;
	font-size: 12px;
}
.btn-secondary {
	background: linear-gradient(
		135deg,
		var(--accent-light),
		var(--accent-light)
	);
	color: white;
}

.item-list {
	background-color: var(--surface-alt);
	border-radius: 12px;
	padding: 12px;
	border: 2px solid var(--text-muted);
	min-height: 380px;
	max-height: 540px;
	overflow: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.item-list::-webkit-scrollbar {
	display: none;
}

.item-entry {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--text);
	padding: 5px 8px;
	border-radius: 5px;
	cursor: pointer;
	transition: color 0.2s;
	margin-bottom: 1px;
	white-space: nowrap;
}

/* ── SELECTED state only — NO hover background ── */
.item-entry.selected {
	color: var(--warning) !important;
	font-weight: bold;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
/* Hover: only change text colour, no background fill */
.item-entry:hover {
	color: var(--warning) !important;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

.item-stock-hint {
	opacity: 0.65;
	font-size: 12px;
}

.search-container {
	margin-top: 4px;
}
.search-input {
	width: 100%;
	padding: 10px 13px;
	border: 2px solid var(--text-muted);
	border-radius: 10px;
	font-size: 14px;
	background: var(--surface);
	font-family: inherit;
}
.search-input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 4px rgba(107, 124, 80, 0.3);
}

/* CENTER – action buttons */
.center-section {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-self: start;
	margin-top: 42px;
}
.action-btn {
	padding: 13px 8px;
	border-radius: 10px;
	border: none;
	font-weight: bold;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.3s;
	text-align: center;
	line-height: 1.2;
}
.action-btn:hover {
	transform: translateX(5px);
	box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18);
}
.btn-inventory {
	background-color: var(--surface-alt);
	color: var(--text);
}
.btn-edit-name {
	background-color: var(--warning);
	color: white;
}
.btn-delete {
	background-color: var(--success);
	color: var(--text);
}
.btn-adj-price {
	background-color: var(--primary);
	color: white;
}

/* RIGHT */
.right-section {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.top-right-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.order-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	align-items: center;
}
.order-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	align-items: center;
}

/* INVOICE AREA — bottom border removed so it flows into green section */
.invoice-area {
	background: linear-gradient(135deg, var(--warning), var(--accent-light));
	border-radius: 12px 12px 0 0;
	padding: 14px;
	border: 3px solid var(--text-muted);
	border-bottom: none;
}
.invoice-header {
	display: grid;
	grid-template-columns: 2fr 0.6fr 0.8fr 0.8fr 1fr 1fr;
	gap: 5px;
	margin-bottom: 6px;
}
.invoice-col {
	background-color: var(--danger);
	padding: 8px 5px;
	text-align: center;
	font-weight: bold;
	border-radius: 5px;
	color: var(--text);
	font-size: 12px;
}
#orderItems {
	display: grid;
	grid-template-columns: 2fr 0.6fr 0.8fr 0.8fr 1fr 1fr;
	gap: 5px;
	min-height: 50px;
	max-height: 360px;
	overflow-y: auto;
	margin-bottom: 8px;
	scrollbar-width: none;
	-ms-overflow-style: none;
}
#orderItems::-webkit-scrollbar {
	display: none;
}

.cart-cell {
	background-color: rgba(255, 255, 255, 0.7);
	padding: 7px 5px;
	border-radius: 5px;
	min-height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	color: var(--text);
	font-weight: 500;
	word-wrap: break-word;
	overflow: hidden;
	cursor: pointer;
}
.cart-cell.empty-row {
	background-color: rgba(255, 255, 255, 0.3);
	cursor: default;
}
.cart-cell.selected-cart-item {
	background-color: var(--warning);
	border: 2px solid var(--text);
}

.totals-area {
	margin-top: 6px;
}
.vat-line {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: rgba(255, 255, 255, 0.6);
	padding: 5px 10px;
	border-radius: 7px;
	margin-bottom: 4px;
	font-size: 12px;
}
.vat-label {
	font-weight: 600;
	color: var(--warning);
}
.vat-value {
	font-weight: 700;
	color: var(--warning);
}
.total-section {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.total-label {
	background-color: var(--text-muted);
	padding: 11px 12px;
	border-radius: 8px;
	font-size: 15px;
	font-weight: bold;
	color: var(--text);
	flex: 1;
	text-align: right;
	margin-right: 5px;
}
.total-value {
	background-color: var(--text-muted);
	padding: 11px 12px;
	border-radius: 8px;
	font-size: 15px;
	font-weight: bold;
	color: var(--text);
	white-space: nowrap;
}

.vat-toggle-row {
	background: var(--surface-alt);
	border: 1.5px solid var(--warning);
	border-radius: 0 0 8px 8px;
	padding: 7px 13px;
	font-size: 13px;
	border-top: none;
}
.vat-toggle-label {
	display: flex;
	align-items: center;
	gap: 7px;
	cursor: pointer;
	font-weight: 600;
	color: var(--warning);
}

.qty-inline-input {
	width: 58px;
	padding: 4px 5px;
	border: 2px solid var(--accent);
	border-radius: 5px;
	font-size: 13px;
	font-family: inherit;
	text-align: center;
	background: var(--surface);
}

/* =============================================
   INLINE SUPPLIER SECTION
   ============================================= */
.supplier-toggle-section {
	background-color: var(--accent);
	border: 3px solid var(--text-muted);
	border-top: none;
	border-radius: 0 0 14px 14px;
	padding: 10px 16px 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Top row */
.sts-top-row {
	display: flex;
	align-items: center;
	gap: 10px;
}
.sts-buttons-group {
	display: flex;
	gap: 12px;
	align-items: center;
}

.sts-btn {
	padding: 11px 28px;
	border-radius: 28px;
	border: none;
	font-weight: bold;
	font-size: 14px;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.25s;
	white-space: nowrap;
}
.sts-btn:hover {
	transform: scale(1.04);
	box-shadow: 0 5px 16px rgba(0, 0, 0, 0.22);
}
.sts-btn:disabled {
	opacity: 0.45;
	cursor: default;
	transform: none !important;
}

.sts-btn-supplier {
	background-color: var(--accent-light);
	color: var(--accent-dark);
}

/* Active state (panel open) */
.sts-btn-active {
	box-shadow:
		4px 0 0 0 rgba(0, 0, 0, 0.35) inset,
		0 5px 16px rgba(0, 0, 0, 0.25);
	outline: 3px solid rgba(255, 255, 255, 0.3);
	outline-offset: -3px;
	transform: scale(1.04);
}

.sts-label {
	color: rgba(255, 255, 255, 0.85);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
}

/* Panel wrapper */
.sts-panel {
	width: 100%;
}

/* Supplier panel header with collapse control */
.sts-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--accent-dark);
	border-radius: 8px 8px 0 0;
	padding: 7px 12px;
	margin-bottom: 0;
}
.sts-panel-title {
	font-size: 12px;
	font-weight: 700;
	color: var(--accent-light);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.sts-panel-collapse-btn {
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: var(--accent-light);
	font-size: 11px;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 10px;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.18s;
	white-space: nowrap;
}
.sts-panel-collapse-btn:hover {
	background: rgba(255, 255, 255, 0.28);
	color: var(--surface);
}

.sts-panel-inner {
	background: var(--surface);
	border-radius: 0 0 10px 10px;
	overflow: hidden;
	border: 1.5px solid var(--accent);
	border-top: none;
	padding: 10px;
	background: var(--surface-alt);
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Supplier search */
.sts-search-wrap {
	display: flex;
	align-items: center;
	gap: 7px;
	background: var(--surface);
	border: 1.5px solid var(--accent-light);
	border-radius: 8px;
	padding: 0 10px;
	transition:
		border-color 0.2s,
		box-shadow 0.2s;
}
.sts-search-wrap:focus-within {
	border-color: var(--accent);
	box-shadow: 0 0 0 2px rgba(107, 124, 80, 0.15);
}
.sts-search-icon {
	font-size: 12px;
	color: var(--text-muted);
	flex-shrink: 0;
}
.sts-search-input {
	border: none;
	outline: none;
	background: transparent;
	font-size: 12px;
	font-family: inherit;
	padding: 8px 0;
	width: 100%;
	color: var(--text);
}

/* Supplier results list */
.sts-list {
	background: var(--surface);
	border-radius: 8px;
	border: 1.5px solid var(--surface-alt);
	max-height: 160px;
	overflow-y: auto;
}
.sts-list::-webkit-scrollbar {
	width: 4px;
}
.sts-list::-webkit-scrollbar-thumb {
	background: var(--accent-light);
	border-radius: 4px;
}

.sts-list-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	cursor: pointer;
	border-bottom: 1px solid var(--surface-alt);
	transition: background 0.12s;
}
.sts-list-item:last-child {
	border-bottom: none;
}
.sts-list-item:hover {
	background: var(--surface-alt);
}
.sts-list-item.sts-list-item-sel {
	background: var(--surface-alt);
	border-left: 3px solid var(--accent-dark);
}

.sts-item-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: linear-gradient(
		135deg,
		var(--accent-dark),
		var(--accent-light)
	);
	color: white;
	font-weight: 800;
	font-size: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.sts-item-details {
	flex: 1;
}
.sts-item-name {
	font-size: 13px;
	font-weight: 600;
	color: var(--accent-dark);
}
.sts-item-meta {
	font-size: 10px;
	color: var(--text-muted);
	margin-top: 1px;
}
.sts-item-check {
	font-size: 15px;
	font-weight: 800;
	color: var(--accent-dark);
	width: 20px;
	text-align: center;
}
.sts-empty {
	padding: 16px;
	text-align: center;
	color: var(--text-muted);
	font-size: 12px;
}

/* Selected chips */
.sts-selected-label {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--accent-dark);
	margin-bottom: 5px;
}
#selectedSuppliersList {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 4px;
}
.sts-chip {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1px;
	background: var(--surface-alt);
	border: 1.5px solid var(--accent-light);
	border-radius: 6px;
	padding: 3px 7px;
	font-size: 10px;
	font-weight: 600;
	color: var(--accent-dark);
	overflow: hidden;
	min-width: 0;
}
.sts-chip span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex: 1;
	min-width: 0;
}
.sts-chip-remove {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--text-muted);
	font-size: 11px;
	padding: 0;
	line-height: 1;
	font-family: inherit;
	flex-shrink: 0;
}
.sts-chip-remove:hover {
	color: var(--danger);
}

/* Add depot row + form */
.sts-add-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--surface-alt);
	border-radius: 7px;
	padding: 6px 10px;
}
.sts-add-hint {
	font-size: 11px;
	color: var(--text-muted);
}
.sts-add-toggle-btn {
	background: linear-gradient(
		135deg,
		var(--accent-dark),
		var(--accent-light)
	);
	color: var(--surface);
	border: none;
	padding: 5px 14px;
	border-radius: 13px;
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.18s;
}
.sts-add-toggle-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 3px 8px rgba(90, 107, 66, 0.28);
}

.sts-add-form {
	background: var(--surface);
	border: 1.5px solid var(--accent-light);
	border-radius: 9px;
	padding: 12px;
	animation: fadeIn 0.18s ease;
}
.sts-add-form-title {
	font-size: 12px;
	font-weight: 700;
	color: var(--accent-dark);
	margin-bottom: 8px;
}
.sts-add-form-fields {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 10px;
}
.sts-input {
	width: 100%;
	padding: 7px 10px;
	border: 1.5px solid var(--accent-light);
	border-radius: 7px;
	font-size: 12px;
	font-family: inherit;
	background: var(--surface);
	color: var(--text);
}
.sts-input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 2px rgba(107, 124, 80, 0.12);
}
.sts-add-form-btns {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
}
.sts-form-cancel {
	padding: 6px 16px;
	border: none;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	background: var(--surface-alt);
	color: var(--text-muted);
}
.sts-form-save {
	padding: 6px 16px;
	border: none;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	background: linear-gradient(
		135deg,
		var(--accent-dark),
		var(--accent-light)
	);
	color: white;
}
.sts-form-cancel:hover,
.sts-form-save:hover {
	transform: translateY(-1px);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

/* Receipt numbers */
.sts-receipt-section {
	border-top: 1px solid var(--accent-light);
	padding-top: 8px;
}
.sts-receipt-title {
	font-size: 11px;
	font-weight: 700;
	color: var(--accent-dark);
	margin-bottom: 6px;
}
.sts-optional {
	background: var(--surface-alt);
	color: var(--text-muted);
	font-size: 10px;
	font-weight: 400;
	padding: 1px 7px;
	border-radius: 8px;
	margin-left: 5px;
}
.sts-receipt-entries {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.sts-receipt-entry {
	display: flex;
	align-items: center;
	gap: 7px;
}
/* Labeled variant — per-supplier */
.sts-receipt-entry-labeled {
	gap: 8px;
}
.sts-receipt-supplier-label {
	font-size: 11px;
	font-weight: 700;
	color: var(--accent-dark);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 90px;
	max-width: 120px;
	flex-shrink: 0;
}
.sts-receipt-input {
	flex: 1;
	padding: 6px 10px;
	border: 1.5px solid var(--accent-light);
	border-radius: 7px;
	font-size: 12px;
	font-family: inherit;
	background: var(--surface);
}
.sts-receipt-input:focus {
	outline: none;
	border-color: var(--accent);
}
.sts-receipt-add {
	padding: 5px 12px;
	background: var(--surface-alt);
	border: none;
	border-radius: 7px;
	font-size: 11px;
	font-weight: 600;
	color: var(--accent-dark);
	cursor: pointer;
	font-family: inherit;
	white-space: nowrap;
}
.sts-receipt-add:hover {
	background: var(--accent-light);
}

.sts-mp-name {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	margin-right: 10px;
	color: var(--text-muted);
}
.sts-mp-calc {
	white-space: nowrap;
	color: var(--text);
}
.sts-mp-calc strong {
	color: var(--accent-dark);
}
.sts-mp-more {
	font-size: 11px;
	color: var(--text-muted);
	text-align: center;
	padding-top: 5px;
}
.sts-mp-empty {
	font-size: 12px;
	color: var(--text-muted);
	text-align: center;
	padding: 8px 0;
}

/* Confirmed card (after supplier selected) */
.sts-confirmed-card {
	background: var(--surface);
	border-radius: 10px;
	border: 1.5px solid var(--accent);
	overflow: hidden;
}
.sts-cc-top {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	background: var(--surface-alt);
	border-bottom: 1px solid var(--accent-light);
}
.sts-cc-avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	font-size: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.sts-cc-details {
	flex: 1;
	min-width: 0;
}
.sts-cc-name {
	font-size: 14px;
	font-weight: 800;
	color: var(--accent-dark);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.sts-cc-meta {
	font-size: 11px;
	color: var(--text-muted);
	margin-top: 1px;
}
.sts-cc-change {
	flex-shrink: 0;
	background: rgba(90, 107, 66, 0.12);
	border: 1.5px solid var(--accent-light);
	color: var(--accent-dark);
	padding: 4px 12px;
	border-radius: 13px;
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.18s;
}
.sts-cc-change:hover {
	background: rgba(90, 107, 66, 0.25);
}
.sts-cc-fields {
	display: flex;
	padding: 8px 12px;
	background: var(--surface-alt);
	gap: 0;
}
.sts-cc-field {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding-right: 10px;
	border-right: 1px solid var(--accent-light);
}
.sts-cc-field:last-child {
	border-right: none;
	padding-right: 0;
}
.sts-cc-lbl {
	font-size: 9px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: var(--accent-dark);
}
.sts-cc-val {
	font-size: 12px;
	font-weight: 600;
	color: var(--text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ─── CONFIRM RECEIPT BUTTON ─── */
.confirm-btn {
	background: linear-gradient(135deg, var(--accent-dark), var(--accent));
	color: white;
	padding: 13px 22px;
	border-radius: 10px;
	border: none;
	font-weight: bold;
	font-size: 14px;
	cursor: pointer;
	transition: all 0.3s;
	display: block;
	margin-left: auto;
	width: fit-content;
}
.confirm-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* BOTTOM ACTIONS */
.bottom-actions {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
}
.action-box {
	padding: 12px;
	border-radius: 10px;
	text-align: center;
	font-weight: bold;
	font-size: 14px;
	cursor: pointer;
	transition: all 0.3s;
	border: none;
}
.action-box:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}
.btn-reports {
	background: linear-gradient(135deg, var(--accent-light), var(--accent));
	color: white;
}
.btn-back {
	background: linear-gradient(135deg, var(--success), var(--success));
	color: white;
}
.btn-dashboard {
	background: linear-gradient(
		135deg,
		var(--sidebar-bg-start),
		var(--sidebar-bg-end)
	);
	color: white;
}

/* FOOTER */
.footer {
	background: var(--surface);
	padding: 13px;
	text-align: center;
	border-radius: 0 0 17px 17px;
	border-top: 2px solid var(--text-muted);
	font-size: 13px;
}
.footer-link {
	color: var(--primary);
	text-decoration: none;
}
.footer-link:hover {
	text-decoration: underline;
}

/* =============================================
   MODALS
   ============================================= */
@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}
@keyframes slideUp {
	from {
		transform: translateY(28px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

.modal-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(3px);
	z-index: 1000;
	justify-content: center;
	align-items: center;
	animation: fadeIn 0.2s ease;
}
.modal-overlay.active {
	display: flex;
}

.modal-content {
	background: var(--surface-card, var(--surface));
	border-radius: 17px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	width: 90%;
	max-width: 510px;
	max-height: min(86vh, 900px);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	animation: slideUp 0.24s ease;
}
.modal-header {
	background: linear-gradient(
		135deg,
		var(--color-primary-dark, var(--accent-dark)),
		var(--color-primary, var(--accent-light))
	);
	padding: 19px 25px;
	font-size: 16px;
	font-weight: 700;
	color: var(--surface);
	display: flex;
	align-items: center;
	gap: 9px;
	flex-shrink: 0;
}
.modal-icon {
	font-size: 17px;
}
.modal-header-row {
	background: linear-gradient(
		135deg,
		var(--color-primary-dark, var(--accent-dark)),
		var(--color-primary, var(--accent-light))
	);
	padding: 18px 25px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.modal-header-item {
	font-size: 15px;
	font-weight: 700;
	color: var(--surface);
	flex: 1;
}
.modal-header-stock {
	background: rgba(255, 255, 255, 0.2);
	color: var(--surface);
	font-size: 12px;
	font-weight: 600;
	padding: 4px 12px;
	border-radius: 14px;
}
.modal-body {
	padding: 22px;
	background: var(--surface-bg, var(--surface-alt));
	color: var(--text-primary, var(--text));
	overflow-y: auto;
	flex: 1 1 auto;
	min-height: 0;
}
.modal-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 16px;
	align-items: start;
}
.modal-grid-3 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	align-items: start;
}
.modal-grid-2 {
	grid-template-columns: repeat(2, minmax(240px, 1fr));
}
.modal-grid-4 {
	grid-template-columns: repeat(4, minmax(180px, 1fr));
}
.modal-card {
	background: var(--surface);
	border: 1.5px solid var(--surface-alt);
	border-radius: 18px;
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}
.modal-card + .modal-card {
	margin-top: 20px;
}
.modal-card-header {
	font-size: 14px;
	font-weight: 800;
	color: var(--accent-dark);
	letter-spacing: 0.6px;
	text-transform: uppercase;
}
.modal-card-body {
	display: flex;
	flex-direction: column;
	gap: 18px;
}
.nested-card {
	background: #ffffff;
	border: 1px solid var(--border-color, var(--border));
	border-radius: 14px;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.nested-card.small {
	padding: 14px;
}
.nested-card .modal-card-header {
	font-size: 12px;
	color: var(--text-muted);
	letter-spacing: 0.5px;
}
#comboIngredientsContainer {
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-height: 260px;
	overflow-y: auto;
	overflow-x: auto;
	padding-right: 6px;
	background: #ffffff;
	border-radius: 12px;
}
#comboIngredientsContainer::-webkit-scrollbar {
	height: 8px;
	width: 8px;
}
#comboIngredientsContainer::-webkit-scrollbar-track {
	background: transparent;
}
#comboIngredientsContainer::-webkit-scrollbar-thumb {
	background: rgba(107, 124, 80, 0.35);
	border-radius: 999px;
}
#comboIngredientsContainer::-webkit-scrollbar-thumb:hover {
	background: rgba(107, 124, 80, 0.55);
}
.modal-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}
.modal-grid > .modal-field,
.modal-grid-3 > .modal-field {
	min-width: 0;
}
.modal-field.full {
	grid-column: 1 / -1;
}

.modal-label .required-star {
	color: #c0392b;
	margin-left: 4px;
	font-weight: 700;
}

.modal-label .optional-text {
	color: #666;
	margin-left: 6px;
	font-size: 12px;
	font-weight: 400;
}

.input-error {
	border-color: #c0392b !important;
	box-shadow: inset 0 0 0 1px rgba(192, 57, 43, 0.35);
}
.modal-label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--text-muted);
}
.modal-input {
	width: 100%;
	padding: 10px 14px;
	border: 1.5px solid var(--surface-alt);
	border-radius: 10px;
	font-size: 14px;
	font-family: inherit;
	background: var(--surface);
	color: var(--text);
	transition: border-color 0.18s;
}
.modal-input:focus {
	outline: none;
	border-color: var(--color-primary, var(--accent));
	box-shadow: var(--focus-ring, 0 0 0 3px rgba(107, 124, 80, 0.13));
}
.modal-input[readonly] {
	background: var(--surface-input, var(--surface-alt));
	color: var(--text-muted);
	cursor: default;
}
.modal-buttons {
	display: flex;
	gap: 9px;
	justify-content: flex-end;
	padding: 15px 22px;
	background: var(--surface-bg, var(--surface-alt));
	border-top: 1px solid var(--border-color, var(--border));
	flex-shrink: 0;
}
.modal-btn {
	padding: 9px 22px;
	border: none;
	border-radius: 9px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.18s;
}
.modal-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 5px 14px rgba(0, 0, 0, 0.14);
}
.modal-btn-cancel {
	background: var(--color-primary-light, var(--surface-alt));
	color: var(--text-muted);
}
.modal-btn-confirm {
	background: linear-gradient(
		135deg,
		var(--color-primary-dark, var(--accent-dark)),
		var(--color-primary, var(--accent-light))
	);
	color: var(--surface);
}
.modal-btn-secondary {
	background: var(--primary);
	color: var(--surface);
}
.modal-btn-delete {
	background: linear-gradient(135deg, var(--danger), var(--danger));
	color: var(--surface);
}
.modal-btn-add {
	align-self: flex-start;
	padding: 8px 12px;
	border-radius: 999px;
	background: var(--surface-alt);
	color: var(--accent-dark);
	border: 1px solid var(--border-color, var(--border));
}
.modal-btn-remove {
	padding: 8px 12px;
	border-radius: 8px;
	background: #f5f5f5;
	color: #333;
	border: 1px solid var(--surface-alt);
}
.modal-section {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 18px;
}
.checkbox-group {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}
.checkbox-group label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 14px;
	border: 1px solid var(--border-color, var(--border));
	border-radius: 999px;
	background: rgba(207, 214, 191, 0.16);
	color: var(--text);
	font-size: 13px;
	cursor: pointer;
	transition:
		background 0.18s ease,
		border-color 0.18s ease,
		transform 0.18s ease;
}
.checkbox-group label:hover {
	background: rgba(207, 214, 191, 0.24);
	border-color: var(--accent);
	transform: translateY(-1px);
}
.safety-tag-creator {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
	margin-bottom: 12px;
}
.safety-tag-creator .modal-input {
	flex: 1;
	min-width: 180px;
}
.safety-tag-creator .modal-btn {
	white-space: nowrap;
}
.checkbox-group input[type="checkbox"] {
	width: 16px;
	height: 16px;
	min-width: 16px;
	margin: 0;
	accent-color: var(--accent);
	cursor: pointer;
}
.checkbox-group input[type="checkbox"]:focus-visible {
	outline: 2px solid rgba(107, 124, 80, 0.35);
	outline-offset: 2px;
}
.edit-name-modal .modal-content {
	max-width: 980px;
	width: min(98vw, 980px);
}

.add-item-modal .modal-content {
	max-width: 560px;
	width: min(95vw, 560px);
}

.add-item-modal .modal-body {
	padding: 16px;
}

.add-item-modal .modal-grid,
.add-item-modal .modal-grid-2,
.add-item-modal .modal-grid-3,
.add-item-modal .modal-grid-4 {
	grid-template-columns: 1fr;
	gap: 12px;
}

.add-item-modal .modal-field {
	margin-bottom: 10px;
}

.add-item-modal .modal-note-block {
	font-size: 13px;
	line-height: 1.5;
	padding: 10px 12px;
}

@media (max-width: 760px) {
	.modal-content {
		width: 96vw;
		max-width: 96vw;
	}
	.add-item-modal .modal-content {
		max-width: 96vw;
	}
	.modal-grid,
	.modal-grid-3 {
		grid-template-columns: 1fr;
	}
}

/* Tag input styling used in Safety section */
.tag-input {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	min-height: 50px;
	padding: 10px 12px;
	border: 1.5px solid var(--accent-dark);
	border-radius: 12px;
	background: linear-gradient(
		180deg,
		rgba(255, 255, 255, 0.01),
		rgba(255, 255, 255, 0)
	);
}
.tag-input:focus-within {
	box-shadow: 0 6px 18px rgba(16, 24, 32, 0.06);
	border-color: var(--accent);
}
.tag-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--accent-dark), var(--accent));
	color: var(--surface);
	font-size: 14px;
	font-weight: 700;
	box-shadow: 0 6px 10px rgba(16, 24, 32, 0.08);
}
.tag-chip .tag-remove {
	background: rgba(255, 255, 255, 0.12);
	border-radius: 999px;
	border: none;
	color: rgba(255, 255, 255, 0.95);
	font-weight: 800;
	cursor: pointer;
	padding: 0 8px;
	line-height: 1;
}
.tag-entry {
	border: none;
	outline: none;
	min-width: 140px;
	padding: 10px 8px;
	font-size: 14px;
	background: transparent;
	color: var(--text);
}
.tag-entry::placeholder {
	color: var(--text-muted);
}

.active-ingredient-row {
	display: grid;
	grid-template-columns:
		minmax(220px, 2.2fr)
		minmax(160px, 1.4fr)
		minmax(220px, 1.9fr)
		100px;
	gap: 12px;
	align-items: end;
	margin-bottom: 12px;
	width: 100%;
	padding-bottom: 6px;
}
.active-ingredient-row.dosage-guideline-row {
	grid-template-columns:
		minmax(200px, 2.5fr)
		minmax(200px, 1.8fr)
		minmax(160px, 1.5fr)
		minmax(180px, 1.8fr)
		minmax(180px, 1.8fr)
		minmax(180px, 1.8fr)
		minmax(150px, 1.5fr)
		minmax(150px, 1.5fr)
		100px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
.active-ingredient-row.dosage-guideline-row::-webkit-scrollbar {
	height: 8px;
}
.active-ingredient-row.dosage-guideline-row::-webkit-scrollbar-track {
	background: transparent;
}
.active-ingredient-row.dosage-guideline-row::-webkit-scrollbar-thumb {
	background: rgba(107, 124, 80, 0.35);
	border-radius: 999px;
}
.active-ingredient-row.dosage-guideline-row::-webkit-scrollbar-thumb:hover {
	background: rgba(107, 124, 80, 0.55);
}
.active-ingredient-row.dosage-guideline-row {
	scrollbar-width: thin;
	scrollbar-color: rgba(107, 124, 80, 0.35) transparent;
}
.dosage-guideline-row .active-ingredient-field {
	min-width: 0;
}
@media (max-width: 980px) {
	.active-ingredient-row {
		grid-template-columns: 1fr;
	}
	.active-ingredient-row .modal-btn-remove {
		width: 100%;
	}
}
.active-ingredient-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	justify-content: flex-end;
}
.active-ingredient-field .modal-label {
	font-size: 12px;
	line-height: 1.3;
	margin-bottom: 0;
}
.active-ingredient-row .modal-input,
.active-ingredient-row .modal-btn-remove,
.active-ingredient-row .combo-remove-ingredient,
.active-ingredient-row select,
.active-ingredient-row input {
	min-height: 42px;
	height: 42px;
}
.active-ingredient-row .modal-input {
	width: 100%;
	padding: 10px 12px;
	box-sizing: border-box;
	font-size: 14px;
}
.active-ingredient-row .solid-strength-box,
.active-ingredient-row .liquid-strength-box,
.active-ingredient-row .liquid-ml-box {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	width: 100%;
}
.active-ingredient-row .liquid-strength-stack {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
	gap: 8px;
	align-items: end;
	width: 100%;
}
.active-ingredient-row .liquid-strength-box,
.active-ingredient-row .liquid-ml-box {
	min-width: 0;
}
.active-ingredient-row .combo-strength,
.active-ingredient-row .combo-ml-volume {
	width: 100%;
}
.active-ingredient-row .combo-remove-ingredient {
	padding: 10px 12px;
	min-width: 0;
	white-space: nowrap;
	background: #f5f5f5;
	color: #333;
	border: 1px solid var(--surface-alt);
	height: 42px;
	margin-top: 21px;
}
.active-ingredient-row .modal-btn-remove:hover {
	background: #e0e0e0;
}
.active-ingredient-empty {
	padding: 12px;
	border: 1px dashed var(--border-color, var(--border));
	border-radius: 10px;
	color: var(--text-muted);
	font-size: 13px;
}

/* Make Safety section two-column explicitly (fallback) */
.add-item-modal .modal-detail-section .modal-grid {
	grid-template-columns: 1fr 1fr;
}

/* Inventory modal */
.inventory-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 11px;
}
.inv-card {
	background: var(--surface);
	border: 1.5px solid var(--surface-alt);
	border-radius: 11px;
	padding: 11px 15px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.inv-card.full {
	grid-column: 1 / -1;
}
.inv-card-label {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: var(--text-muted);
}
.inv-card-value {
	font-size: 16px;
	font-weight: 700;
	color: var(--accent-dark);
}
.inv-card-value.big {
	font-size: 22px;
}
.status-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 14px;
	font-size: 11px;
	font-weight: 700;
	margin-top: 2px;
}
.status-ok {
	background: var(--surface-alt);
	color: var(--success);
}
.status-low {
	background: var(--surface-alt);
	color: var(--warning);
}
.status-critical {
	background: var(--surface-alt);
	color: var(--danger);
}
.status-expired {
	background: var(--surface-alt);
	color: var(--danger);
}
.status-expiring {
	background: var(--surface-alt);
	color: var(--warning);
}
.stock-bar-wrap {
	margin-top: 5px;
	background: var(--surface-alt);
	border-radius: 5px;
	height: 7px;
	overflow: hidden;
}
.stock-bar {
	height: 100%;
	border-radius: 5px;
	transition: width 0.4s;
}
.stock-bar.ok {
	background: linear-gradient(90deg, var(--accent-dark), var(--accent-light));
}
.stock-bar.low {
	background: linear-gradient(90deg, var(--warning), var(--warning));
}
.stock-bar.critical {
	background: linear-gradient(90deg, var(--danger), var(--danger));
}

/* Batch items in inventory modal */
.inv-batch-item {
	background: var(--surface-alt);
	border: 1px solid var(--surface-alt);
	border-radius: 6px;
	padding: 8px 10px;
	margin-bottom: 6px;
}
.inv-batch-item:last-child {
	margin-bottom: 0;
}
.inv-batch-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 4px;
}
.inv-batch-number {
	font-weight: 700;
	color: var(--accent-dark);
	font-size: 13px;
}
.inv-batch-qty {
	font-size: 12px;
	color: var(--text-muted);
}
.inv-batch-details {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: var(--text-muted);
}

/* Product Details Categories */
.inv-details-category {
	margin-bottom: 18px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--surface-alt);
}
.inv-details-category:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}
.inv-details-category-title {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: var(--text-muted);
	margin-bottom: 10px;
}
.inv-details-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
.inv-details-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	background: var(--surface);
	border: 1px solid var(--surface-alt);
	border-radius: 14px;
	padding: 12px 14px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.inv-details-label {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--text-muted);
}
.inv-details-value {
	font-size: 13px;
	font-weight: 600;
	color: var(--accent-dark);
	word-break: break-word;
	line-height: 1.4;
}

/* Confirm modal */
.confirm-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(3px);
	z-index: 2000;
	justify-content: center;
	align-items: center;
}
.confirm-modal.active {
	display: flex;
}
.confirm-content {
	background: var(--surface);
	border-radius: 17px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	width: 90%;
	max-width: 400px;
	overflow: hidden;
	animation: slideUp 0.24s ease;
}
.confirm-header {
	background: linear-gradient(
		135deg,
		var(--accent-dark),
		var(--accent-light)
	);
	padding: 17px 23px;
	font-size: 15px;
	font-weight: 700;
	color: var(--surface);
}
.confirm-body {
	padding: 21px 23px;
	background: var(--surface-alt);
}
.confirm-message {
	margin-bottom: 18px;
	font-size: 14px;
	color: var(--text);
	line-height: 1.6;
	white-space: pre-line;
}
.confirm-buttons {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}
.confirm-btn-no {
	padding: 9px 22px;
	border: none;
	border-radius: 9px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	background: var(--surface-alt);
	color: var(--text-muted);
}
.confirm-btn-yes {
	padding: 9px 22px;
	border: none;
	border-radius: 9px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	background: linear-gradient(135deg, var(--danger), var(--danger));
	color: var(--surface);
}
.confirm-btn-no:hover,
.confirm-btn-yes:hover {
	transform: translateY(-2px);
	box-shadow: 0 5px 13px rgba(0, 0, 0, 0.14);
}

/* Batch items in inventory modal */
.inv-batch-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 12px;
	margin-bottom: 6px;
	background: var(--surface-alt);
	border-radius: 6px;
	border: 1px solid var(--surface-alt);
}
.inv-batch-header {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.inv-batch-number {
	font-weight: 700;
	color: var(--accent-dark);
	font-size: 13px;
}
.inv-batch-qty {
	font-size: 11px;
	color: var(--text-muted);
}
.inv-batch-details {
	font-size: 11px;
	color: var(--text-muted);
}

/* ── Insurance prices in inventory modal (v2.1) ─────────────────────────── */
.inv-insurance-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 10px;
	margin-top: 8px;
}
.inv-ins-chip {
	background: rgba(26, 92, 74, 0.06);
	border: 1px solid rgba(26, 92, 74, 0.18);
	border-radius: 8px;
	padding: 10px 12px;
}
.inv-ins-label {
	font-size: 11px;
	font-weight: 700;
	color: var(--accent-dark);
	margin-bottom: 3px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}
.inv-ins-price {
	font-size: 18px;
	font-weight: 800;
	color: var(--primary-dark);
	margin-bottom: 2px;
}
.inv-ins-detail {
	font-size: 10px;
	color: var(--text-muted);
	line-height: 1.4;
}
.inv-ins-fixed-badge {
	background: var(--accent-dark);
	color: var(--surface);
	border-radius: 4px;
	padding: 1px 5px;
	font-size: 9px;
	font-weight: 700;
	margin-left: 3px;
}

/* ── Inventory modal — scrollable body so it never overflows the screen ─── */
#inventoryModal .modal-content {
	max-height: 90vh;
	display: flex;
	flex-direction: column;
}
#inventoryModal .modal-body {
	overflow-y: auto;
	flex: 1;
}
#inventoryModal .modal-body::-webkit-scrollbar {
	width: 5px;
}
#inventoryModal .modal-body::-webkit-scrollbar-thumb {
	background: var(--accent-light);
	border-radius: 4px;
}
