:root {
	--bg-0: #06111f;
	--bg-1: #0b1930;
	--bg-2: #102846;
	--card: rgba(255, 255, 255, 0.10);
	--card-2: rgba(255, 255, 255, 0.16);
	--stroke: rgba(255, 255, 255, 0.16);
	--stroke-2: rgba(255, 255, 255, 0.26);
	--text: #f4f8ff;
	--muted: #a9bbd3;
	--soft: #dce8f8;
	--accent: #38bdf8;
	--accent-2: #8b5cf6;
	--accent-3: #22c55e;
	--danger: #fb7185;
	--warning: #fbbf24;
	--shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
	--radius-xl: 30px;
	--radius-lg: 22px;
	--radius-md: 16px;
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	background:
		radial-gradient(circle at top left, rgba(56, 189, 248, 0.22), transparent 32%),
		radial-gradient(circle at top right, rgba(139, 92, 246, 0.24), transparent 30%),
		linear-gradient(135deg, var(--bg-0), var(--bg-1) 45%, #050b16);
	color: var(--text);
	overflow-x: hidden;
}

body::before {
	content: "";
	position: fixed;
	inset: 0;
	background-image:
		linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
	background-size: 42px 42px;
	mask-image: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
	pointer-events: none;
	z-index: -2;
}

.liquid-bg {
	position: fixed;
	inset: -25%;
	background:
		radial-gradient(circle at 20% 25%, rgba(56, 189, 248, 0.34), transparent 27%),
		radial-gradient(circle at 80% 18%, rgba(139, 92, 246, 0.36), transparent 26%),
		radial-gradient(circle at 45% 90%, rgba(34, 197, 94, 0.20), transparent 30%),
		radial-gradient(circle at 5% 85%, rgba(251, 191, 36, 0.12), transparent 20%);
	filter: blur(48px);
	animation: liquidMove 16s ease-in-out infinite alternate;
	z-index: -3;
}

@keyframes liquidMove {
	0% {
		transform: translate3d(-2%, -1%, 0) scale(1);
	}
	50% {
		transform: translate3d(2%, 1%, 0) scale(1.04) rotate(1deg);
	}
	100% {
		transform: translate3d(3%, 3%, 0) scale(1.08) rotate(-1deg);
	}
}

a {
	color: inherit;
}

.app-shell {
	display: grid;
	grid-template-columns: 292px minmax(0, 1fr);
	min-height: 100vh;
}

.sidebar {
	position: sticky;
	top: 0;
	height: 100vh;
	padding: 24px 18px;
	background: rgba(4, 12, 24, 0.68);
	border-right: 1px solid var(--stroke);
	backdrop-filter: blur(26px);
	box-shadow: 18px 0 70px rgba(0, 0, 0, 0.24);
}

.brand {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px;
	margin-bottom: 24px;
	border-radius: 24px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--stroke);
}

.brand-mark {
	width: 52px;
	height: 52px;
	border-radius: 18px;
	display: grid;
	place-items: center;
	background:
		linear-gradient(135deg, rgba(56, 189, 248, 1), rgba(139, 92, 246, 1));
	color: white;
	font-weight: 900;
	letter-spacing: -0.5px;
	box-shadow: 0 16px 34px rgba(56, 189, 248, 0.28);
}

.brand-logo {
	width: 52px;
	height: 52px;
	border-radius: 18px;
	object-fit: cover;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid var(--stroke);
	box-shadow: 0 16px 34px rgba(56, 189, 248, 0.18);
}

.brand strong {
	display: block;
	font-size: 18px;
	line-height: 1.15;
	letter-spacing: -0.4px;
}

.brand span {
	display: block;
	margin-top: 3px;
	font-size: 12px;
	color: var(--muted);
}

.sidebar nav {
	display: grid;
	gap: 9px;
}

.sidebar nav a {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 13px 14px;
	border-radius: 18px;
	color: #dbeafe;
	text-decoration: none;
	background: transparent;
	border: 1px solid transparent;
	font-size: 15px;
	font-weight: 650;
	transition: 0.22s ease;
}

.sidebar nav a::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 99px;
	background: rgba(255,255,255,0.26);
	transition: 0.22s ease;
}

.sidebar nav a:hover {
	background: rgba(255, 255, 255, 0.09);
	border-color: var(--stroke);
	transform: translateX(4px);
}

.sidebar nav a:hover::before {
	background: var(--accent);
	box-shadow: 0 0 18px rgba(56,189,248,.8);
}

.main-content {
	padding: 30px;
	min-width: 0;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	margin-bottom: 24px;
	padding: 20px 22px;
	border-radius: var(--radius-xl);
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid var(--stroke);
	backdrop-filter: blur(24px);
	box-shadow: var(--shadow);
}

.topbar h1 {
	margin: 0;
	font-size: clamp(32px, 4.6vw, 62px);
	line-height: 1;
	letter-spacing: -2.8px;
}

.topbar p {
	margin: 10px 0 0;
	color: var(--muted);
	font-size: 16px;
}

.glass-card,
.login-card {
	background: linear-gradient(145deg, rgba(255,255,255,0.13), rgba(255,255,255,0.065));
	border: 1px solid var(--stroke);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow);
	backdrop-filter: blur(26px);
	padding: 24px;
	position: relative;
	overflow: hidden;
}

.glass-card::after,
.login-card::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(120deg, rgba(255,255,255,.16), transparent 32%);
	pointer-events: none;
	opacity: .42;
}

.glass-card > *,
.login-card > * {
	position: relative;
	z-index: 1;
}

.glass-card h2 {
	margin: 0 0 10px;
	font-size: 28px;
	letter-spacing: -0.8px;
}

.glass-card p {
	color: var(--muted);
	font-size: 16px;
	line-height: 1.6;
}

.dashboard-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
	margin-bottom: 20px;
}

.stat-card {
	min-height: 150px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	transition: .22s ease;
}

.stat-card:hover {
	transform: translateY(-4px);
	border-color: var(--stroke-2);
}

.stat-card span {
	color: var(--muted);
	font-weight: 650;
}

.stat-card strong {
	font-size: 36px;
	letter-spacing: -1.4px;
}

.module-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 18px;
}

.module-pills a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0 18px;
	border-radius: 999px;
	text-decoration: none;
	background: rgba(255,255,255,0.10);
	border: 1px solid var(--stroke);
	color: var(--text);
	font-weight: 750;
	transition: .22s ease;
}

.module-pills a:hover {
	transform: translateY(-2px);
	background: rgba(56, 189, 248, 0.18);
	border-color: rgba(56, 189, 248, 0.42);
}

.grid-form,
.filter-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
	margin-top: 20px;
}

.grid-form .full {
	grid-column: 1 / -1;
}

label {
	display: block;
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 750;
	color: #c8d8ed;
	letter-spacing: 0.2px;
}

input,
select,
textarea {
	width: 100%;
	min-height: 48px;
	border: 1px solid var(--stroke);
	border-radius: 16px;
	background: rgba(3, 9, 20, 0.58);
	color: var(--text);
	padding: 12px 14px;
	outline: none;
	font-size: 15px;
	transition: .2s ease;
	box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

input:focus,
select:focus,
textarea:focus {
	border-color: rgba(56,189,248,.75);
	box-shadow: 0 0 0 4px rgba(56,189,248,.14);
	background: rgba(3, 9, 20, 0.74);
}

input[type="file"] {
	padding: 10px;
	background: rgba(3, 9, 20, 0.42);
}

button,
.soft-btn,
.success-btn {
	appearance: none;
	border: 0;
	border-radius: 16px;
	min-height: 48px;
	padding: 0 18px;
	color: white;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	font-weight: 850;
	font-size: 15px;
	cursor: pointer;
	box-shadow: 0 16px 36px rgba(56, 189, 248, 0.22);
	transition: .22s ease;
	width: auto;
}

button:hover,
.soft-btn:hover,
.success-btn:hover {
	transform: translateY(-2px);
	filter: brightness(1.08);
}

.success-btn {
	width: 100%;
	background: linear-gradient(135deg, #22c55e, #14b8a6);
	box-shadow: 0 16px 36px rgba(34, 197, 94, 0.18);
	margin-top: 16px;
}

.wizard-card {
	max-width: 980px;
}

.pos-layout {
	display: grid;
	grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
	gap: 18px;
}

.scanner-panel,
.cart-panel {
	min-height: 520px;
}

#barcodeInput {
	min-height: 64px;
	font-size: 26px;
	font-weight: 800;
	letter-spacing: 1.6px;
	text-align: center;
	border-radius: 22px;
	background: rgba(0,0,0,.34);
}

.scan-result {
	margin-top: 14px;
	padding: 14px;
	border-radius: 16px;
	background: rgba(255,255,255,.07);
	font-weight: 800;
}

.success-text {
	color: #86efac;
	border: 1px solid rgba(34,197,94,.28);
}

.error-text {
	color: #fecdd3;
	border: 1px solid rgba(251,113,133,.28);
}

.data-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0 10px;
}

.data-table th {
	text-align: left;
	color: var(--muted);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .8px;
	padding: 0 12px 4px;
}

.data-table td {
	padding: 14px 12px;
	background: rgba(255,255,255,.075);
	border-top: 1px solid var(--stroke);
	border-bottom: 1px solid var(--stroke);
}

.data-table td:first-child {
	border-left: 1px solid var(--stroke);
	border-radius: 16px 0 0 16px;
}

.data-table td:last-child {
	border-right: 1px solid var(--stroke);
	border-radius: 0 16px 16px 0;
}

.cart-total {
	margin-top: 18px;
	padding: 18px;
	border-radius: 20px;
	background: rgba(0,0,0,.24);
	border: 1px solid var(--stroke);
	text-align: right;
	font-size: 18px;
	color: var(--muted);
}

.cart-total strong {
	color: var(--text);
	font-size: 30px;
	margin-left: 10px;
}

.login-body {
	display: grid;
	place-items: center;
	padding: 22px;
}

.login-card {
	width: min(460px, 100%);
}

.login-card h1 {
	margin: 0;
	font-size: 38px;
	letter-spacing: -1.6px;
}

.login-card p {
	margin: 8px 0 20px;
	color: var(--muted);
}

.login-card form {
	display: grid;
	gap: 14px;
}

.login-card button {
	width: 100%;
	margin-top: 6px;
}

.alert {
	padding: 13px 15px;
	border-radius: 16px;
	margin: 14px 0;
	font-weight: 700;
}

.alert.error {
	background: rgba(251, 113, 133, 0.14);
	color: #fecdd3;
	border: 1px solid rgba(251, 113, 133, 0.28);
}

@media (max-width: 1100px) {
	.dashboard-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.pos-layout {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 820px) {
	.app-shell {
		grid-template-columns: 1fr;
	}

	.sidebar {
		position: relative;
		height: auto;
		border-right: 0;
		border-bottom: 1px solid var(--stroke);
	}

	.sidebar nav {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.main-content {
		padding: 18px;
	}

	.topbar {
		align-items: flex-start;
		flex-direction: column;
	}

	.topbar h1 {
		font-size: 38px;
	}

	.grid-form,
	.filter-grid,
	.dashboard-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 480px) {
	.sidebar nav {
		grid-template-columns: 1fr;
	}

	.glass-card,
	.login-card,
	.topbar {
		border-radius: 22px;
		padding: 18px;
	}

	.topbar h1 {
		font-size: 32px;
	}
}

/*=====================================PRODUCTS UPDATE=========================================*/

.product-page {
	display: grid;
	gap: 22px;
}

.section-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	margin-bottom: 18px;
}

.section-head h2 {
	margin: 0;
}

.section-head p {
	margin: 6px 0 0;
}

.section-head input {
	max-width: 360px;
}

.form-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.secondary-btn {
	background: rgba(255,255,255,0.10);
	border: 1px solid var(--stroke);
	box-shadow: none;
}

.table-wrap {
	width: 100%;
	overflow-x: auto;
}

.table-sub {
	font-size: 12px;
	color: var(--muted);
	margin-top: 4px;
}

.table-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.mini-btn {
	min-height: 34px;
	padding: 0 12px;
	border-radius: 12px;
	font-size: 12px;
	width: auto;
	box-shadow: none;
}

.mini-btn.danger {
	background: linear-gradient(135deg, #fb7185, #ef4444);
}

.status-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 74px;
	padding: 6px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 800;
	text-transform: capitalize;
}

.status-pill.active {
	background: rgba(34,197,94,.14);
	color: #86efac;
	border: 1px solid rgba(34,197,94,.28);
}

.status-pill.inactive {
	background: rgba(251,113,133,.14);
	color: #fecdd3;
	border: 1px solid rgba(251,113,133,.28);
}

.alert.success {
	background: rgba(34,197,94,.14);
	color: #bbf7d0;
	border: 1px solid rgba(34,197,94,.28);
}

@media (max-width: 820px) {
	.section-head {
		flex-direction: column;
	}

	.section-head input {
		max-width: 100%;
	}

	.form-actions {
		flex-direction: column;
	}

	.form-actions button {
		width: 100%;
	}
}

/*=====================================SUPPLIERS UPDATE=========================================*/

.supplier-page {
	display: grid;
	gap: 22px;
}

textarea {
	resize: vertical;
}

/*=====================================PURCHASES UPDATE=========================================*/

.purchase-page {
	display: grid;
	gap: 22px;
}

.purchase-item-row {
	display: grid;
	grid-template-columns: 2fr .8fr 1fr 1fr 1fr 1fr auto;
	gap: 10px;
	align-items: center;
	margin-bottom: 10px;
}

.purchase-item-head {
	color: var(--muted);
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .8px;
	margin-bottom: 8px;
}

.purchase-summary {
	display: flex;
	justify-content: flex-end;
	gap: 18px;
	flex-wrap: wrap;
	padding: 16px;
	border-radius: 18px;
	background: rgba(0,0,0,.22);
	border: 1px solid var(--stroke);
}

.purchase-summary div {
	color: var(--muted);
	font-weight: 700;
}

.purchase-summary strong {
	color: var(--text);
	font-size: 22px;
	margin-left: 8px;
}

@media (max-width: 1100px) {
	.purchase-item-row {
		grid-template-columns: 1fr 1fr;
	}

	.purchase-item-head {
		display: none;
	}
}

/*=====================================INVENTORY UPDATE=========================================*/

.inventory-page {
	display: grid;
	gap: 22px;
}

.inventory-filters {
	display: flex;
	gap: 12px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}

/*=====================================REPORTS UPDATE=========================================*/

.reports-page {
	display: grid;
	gap: 22px;
}

.report-filters {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	align-items: end;
}

.report-button-wrap {
	display: flex;
	align-items: end;
}

.report-button-wrap button {
	width: 100%;
}

.report-stat-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
}

@media (max-width: 1100px) {
	.report-stat-grid,
	.report-filters {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 680px) {
	.report-stat-grid,
	.report-filters {
		grid-template-columns: 1fr;
	}
}

/*=====================================POS UPDATE=========================================*/

.pos-controls {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
	margin-top: 18px;
}

.full-width-btn {
	width: 100%;
	margin-top: 12px;
	background: rgba(255,255,255,0.10);
	border: 1px solid var(--stroke);
	box-shadow: none;
}

.cart-qty-input {
	width: 90px;
	min-height: 38px;
	padding: 8px 10px;
	text-align: center;
}

.cart-total-box {
	display: grid;
	gap: 10px;
	margin-top: 18px;
	padding: 18px;
	border-radius: 22px;
	background: rgba(0,0,0,.25);
	border: 1px solid var(--stroke);
}

.cart-total-box div {
	display: flex;
	align-items: center;
	justify-content: space-between;
	color: var(--muted);
	font-weight: 700;
}

.cart-total-box strong {
	color: var(--text);
	font-size: 20px;
}

.cart-total-box .grand-total {
	margin-top: 10px;
	padding-top: 14px;
	border-top: 1px solid var(--stroke);
}

.cart-total-box .grand-total strong {
	font-size: 34px;
}

.recent-sale-card {
	margin-top: 18px;
	background: rgba(34,197,94,.12);
	border-color: rgba(34,197,94,.28);
}

.recent-sale-card h3 {
	margin-top: 0;
}

/*=====================================SALES UPDATE=========================================*/

.sales-page { display:grid; gap:22px; }

.sales-filters {
	display:flex;
	gap:10px;
	margin-bottom:14px;
	flex-wrap:wrap;
}

.invoice-modal {
	position:fixed;
	inset:0;
	background:rgba(0,0,0,.6);
	display:flex;
	align-items:center;
	justify-content:center;
	z-index:999;
}

.invoice-box {
	background:#fff;
	color:#000;
	padding:20px;
	border-radius:10px;
	width:600px;
	max-height:80vh;
	overflow:auto;
}

.invoice-header {
	display:flex;
	justify-content:space-between;
}

/*=====================================SideBar Bulb UPDATE=========================================*/

/* DEFAULT LINK */
.sidebar nav a {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	border-radius: 14px;
	color: var(--muted);
	transition: all 0.25s ease;
}

/* DOT (LEFT BULB) */
.sidebar nav a::before {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(255,255,255,0.3);
	display: inline-block;
	transition: all 0.25s ease;
}

/* HOVER → FULL BOX */
.sidebar nav a:hover {
	background: rgba(255, 255, 255, 0.12);
	color: var(--text);
}

/* ACTIVE → ONLY GLOW DOT */
.sidebar nav a.active {
	background: transparent; /* remove box */
	color: var(--text);
}

/* ACTIVE DOT GLOW */
.sidebar nav a.active::before {
	background: var(--accent);
	box-shadow: 0 0 14px rgba(56,189,248,.9);
}

/* HOVER DOT */
.sidebar nav a:hover::before {
	background: var(--accent);
}

.sidebar nav a.active::before {
	background: var(--accent);
	box-shadow: 0 0 18px rgba(56,189,248,.95);
}

/*=====================================GLOBAL SUPPLIER SEARCH DROPDOWN UPDATE=========================================*/

.search-dropdown {
	position: relative;
	width: 100%;
	min-width: 0;
}

.search-dropdown-toggle {
	width: 100%;
	min-height: 48px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	border: 1px solid var(--stroke);
	border-radius: 16px;
	background: rgba(3, 9, 20, 0.72);
	color: var(--text);
	padding: 12px 14px;
	font-size: 15px;
	font-weight: 700;
	box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
	cursor: pointer;
}

.search-dropdown-panel {
	display: none;
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	z-index: 1001;
	padding: 10px;
	border-radius: 18px;
	background: rgba(11, 18, 32, 0.98);
	border: 1px solid var(--stroke);
	box-shadow: 0 22px 60px rgba(0,0,0,.55);
}

.search-dropdown.open {
	z-index: 1000;
}

.search-dropdown.open .search-dropdown-panel {
	display: block;
}

.search-dropdown-panel input {
	width: 100%;
	margin: 0;
}

.search-dropdown-results {
	max-height: 240px;
	overflow-y: auto;
	margin-top: 8px;
	display: grid;
	gap: 6px;
}

.search-dropdown-item,
.search-dropdown-empty {
	width: 100%;
	text-align: left;
	padding: 11px 12px;
	border-radius: 12px;
	background: transparent;
	color: var(--text);
	border: 0;
	box-shadow: none;
	cursor: pointer;
}

.search-dropdown-item:hover {
	background: rgba(255,255,255,.10);
}

.search-dropdown-empty {
	color: var(--muted);
	cursor: default;
}

/* Inventory filter dropdown should push table down instead of covering it */
.inventory-filters {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
	align-items: start;
	overflow: visible;
}

.inventory-filters > select,
.inventory-filters > .search-dropdown {
	width: 100%;
	min-width: 0;
}

.inventory-filters .search-dropdown.open .search-dropdown-panel {
	position: static;
	margin-top: 8px;
}

@media (max-width: 900px) {
	.inventory-filters {
		grid-template-columns: 1fr;
	}
}


/*=====================================DASHBOARD MODULE BUILDER=========================================*/

.dashboard-builder {
	display: grid;
	gap: 20px;
}

.dashboard-module-editor {
	overflow: visible;
}

.dashboard-module-form {
	margin-top: 18px;
}

.dashboard-module-grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 18px;
	align-items: stretch;
}

.dashboard-module,
.dashboard-module-loading {
	grid-column: span var(--module-span, 3);
	min-height: calc(118px * var(--module-height, 2));
	display: flex;
	flex-direction: column;
	gap: 16px;
	overflow: hidden;
}

.dashboard-module.is-hidden {
	opacity: .52;
}

.dashboard-module.is-dragging {
	outline: 2px solid rgba(56,189,248,.8);
	transform: scale(.99);
}

.dashboard-module[draggable="true"] {
	cursor: grab;
}

.dashboard-module-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 14px;
}

.dashboard-module-head h3 {
	margin: 0 0 6px;
	font-size: 19px;
	line-height: 1.15;
}

.dashboard-module-head span,
.dashboard-stat-caption {
	color: var(--muted);
	font-size: 13px;
	font-weight: 700;
}

.dashboard-module-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.dashboard-module-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 0;
}

.dashboard-stat-value {
	font-size: clamp(34px, 4vw, 58px);
	line-height: 1;
	font-weight: 900;
	letter-spacing: 0;
	color: var(--text);
}

.dashboard-stat-caption {
	margin-top: 10px;
}

.dashboard-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 120px;
	color: var(--muted);
	font-weight: 800;
	text-align: center;
}

.dashboard-chart {
	width: 100%;
	height: min(280px, calc(92px * var(--module-height, 2)));
	min-height: 180px;
	display: block;
}

.dashboard-pie-chart {
	max-width: 420px;
	margin: 0 auto;
}

.dashboard-axis,
.dashboard-grid-line {
	stroke: rgba(203,213,225,.22);
	stroke-width: 1;
}

.dashboard-grid-line {
	stroke-dasharray: 5 7;
}

.dashboard-axis-label {
	fill: rgba(203,213,225,.72);
	font-size: 12px;
	font-weight: 700;
}

.dashboard-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
	margin-top: 12px;
}

.dashboard-legend span {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--muted);
	font-size: 13px;
	font-weight: 800;
}

.dashboard-legend i {
	width: 11px;
	height: 11px;
	border-radius: 999px;
	box-shadow: 0 0 12px currentColor;
}

.dashboard-module-table-wrap {
	overflow: auto;
	max-height: calc(98px * var(--module-height, 2));
	padding-bottom: 4px;
}

.dashboard-module-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 520px;
}

.dashboard-module-table th,
.dashboard-module-table td {
	padding: 11px 12px;
	text-align: left;
	border-bottom: 1px solid rgba(255,255,255,.10);
	white-space: nowrap;
}

.dashboard-module-table th {
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: .08em;
	font-size: 11px;
}

.dashboard-module-table td {
	color: var(--text);
	font-weight: 750;
}

@media (max-width: 1200px) {
	.dashboard-module {
		grid-column: span 6;
	}
}

@media (max-width: 760px) {
	.dashboard-module-grid {
		grid-template-columns: 1fr;
	}

	.dashboard-module,
	.dashboard-module-loading {
		grid-column: 1 / -1;
	}

	.dashboard-module-head {
		display: grid;
	}
}

/*=====================================INVENTORY FIELDS INLINER=========================================*/

.inventory-filters {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
	align-items: start;
}

.inventory-filters > select,
.inventory-filters > .search-dropdown {
	width: 100%;
	min-width: 0;
}

.inventory-filters .search-dropdown-toggle {
	width: 100%;
	min-height: 48px;
	justify-content: space-between;
	border: 1px solid var(--stroke);
	border-radius: 16px;
	background: rgba(3, 9, 20, 0.58);
	color: var(--text);
	padding: 12px 14px;
	font-size: 15px;
	font-weight: 600;
	box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.inventory-filters .search-dropdown-panel {
	width: 100%;
}

@media (max-width: 900px) {
	.inventory-filters {
		grid-template-columns: 1fr;
	}
}


/*=====================================POS-SALE DISCOUNT FIELDS INLINER=========================================*/

.discount-inline-control {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 140px;
	gap: 10px;
	align-items: center;
}

.discount-inline-control input,
.discount-inline-control select {
	width: 100%;
	margin: 0;
}

.cart-line-input {
	width: 110px;
	min-width: 90px;
	padding: 12px 14px;
	font-size: 15px;
}

@media (max-width: 700px) {
	.discount-inline-control {
		grid-template-columns: 1fr;
	}
}

/*=====================================CUSTOMER AND PAYMENT UPDATE=========================================*/

.pos-customer-card {
	margin-bottom: 18px;
}

.pos-customer-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
}

.pos-customer-summary,
.customer-detail-card,
.customer-last-order,
.customer-notes {
	margin-top: 16px;
	padding: 16px;
	border-radius: 18px;
	background: rgba(0,0,0,.22);
	border: 1px solid var(--stroke);
}

.pos-customer-summary {
	display: grid;
	gap: 4px;
}

.pos-customer-summary span,
.customer-notes p,
.customer-detail-head p {
	color: var(--muted);
	margin: 0;
}

.customer-detail-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 14px;
}

.customer-detail-head h3 {
	margin: 0 0 4px;
	font-size: 26px;
}

.customer-last-order {
	border-color: rgba(56,189,248,.35);
	background: rgba(56,189,248,.10);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
}

.customer-info-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin-top: 14px;
}

.customer-info-grid > div {
	padding: 14px;
	border-radius: 16px;
	background: rgba(255,255,255,.07);
	border: 1px solid var(--stroke);
	display: grid;
	gap: 6px;
}

.customer-info-grid span {
	color: var(--muted);
	font-size: 13px;
	font-weight: 700;
}

.search-dropdown-item span {
	display: block;
	color: var(--muted);
	font-size: 13px;
	margin-top: 3px;
}

@media (max-width: 1100px) {
	.pos-customer-grid,
	.customer-info-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 700px) {
	.pos-customer-grid,
	.customer-info-grid {
		grid-template-columns: 1fr;
	}

	.customer-last-order,
	.customer-detail-head {
		display: grid;
	}
}

/*=====================================INVENTORY PRICE COMPARISON COLOR UPDATE=========================================*/

.inventory-price-band {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 86px;
	padding: 7px 12px;
	border-radius: 999px;
	font-weight: 900;
	border: 1px solid rgba(255,255,255,.18);
}

.inventory-price-neutral {
	color: #e5e7eb;
	background: rgba(148, 163, 184, .16);
}

.inventory-price-same {
	color: #bae6fd;
	background: rgba(14, 165, 233, .22);
	border-color: rgba(56, 189, 248, .38);
}

.inventory-price-lowest {
	color: #bbf7d0;
	background: rgba(34, 197, 94, .24);
	border-color: rgba(34, 197, 94, .48);
}

.inventory-price-good {
	color: #d9f99d;
	background: rgba(132, 204, 22, .22);
	border-color: rgba(132, 204, 22, .45);
}

.inventory-price-mid {
	color: #fef08a;
	background: rgba(234, 179, 8, .22);
	border-color: rgba(234, 179, 8, .45);
}

.inventory-price-warn {
	color: #fed7aa;
	background: rgba(249, 115, 22, .24);
	border-color: rgba(249, 115, 22, .48);
}

.inventory-price-highest {
	color: #fecaca;
	background: rgba(239, 68, 68, .26);
	border-color: rgba(239, 68, 68, .55);
}

/*=====================================SETTINGS PAGE UPDATE=========================================*/

.settings-form {
	display: grid;
	gap: 22px;
}

.theme-settings-card {
	margin-top: 0;
}

.theme-settings-panel h3 {
	margin: 28px 0 14px;
	font-size: 22px;
}

.settings-grid,
.settings-color-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.settings-zoom-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 72px;
	gap: 12px;
	align-items: center;
}

.settings-zoom-row strong {
	text-align: right;
	font-size: 18px;
}

.theme-picker {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
}

.theme-picker label {
	min-height: 110px;
	padding: 18px;
	border-radius: 22px;
	border: 1px solid var(--stroke);
	background: rgba(255,255,255,.08);
	cursor: pointer;
	display: flex;
	align-items: flex-end;
	position: relative;
	overflow: hidden;
}

.theme-picker label::before {
	content: "";
	position: absolute;
	inset: 12px;
	border-radius: 18px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	opacity: .42;
}

.theme-picker input {
	position: absolute;
	top: 14px;
	right: 14px;
	width: auto;
}

.theme-picker span {
	position: relative;
	font-weight: 900;
	font-size: 18px;
}

.settings-color-grid label {
	display: grid;
	grid-template-columns: 1fr 70px;
	align-items: center;
	gap: 12px;
	padding: 14px;
	border-radius: 18px;
	background: rgba(255,255,255,.06);
	border: 1px solid var(--stroke);
}

.settings-color-grid input[type="color"] {
	width: 64px;
	height: 42px;
	padding: 0;
	border-radius: 12px;
	cursor: pointer;
}

.theme-actions {
	justify-content: flex-start;
	margin-top: 18px;
}

.settings-save-actions {
	justify-content: flex-end;
	margin-top: 0;
}


/* CHROME-LIKE ZOOM: WHOLE POS SCALES */
html,
body {
	font-size: 16px;
	width: 100%;
	min-height: 100%;
	margin: 0;
	overflow-x: auto;
}

body {
	--sidebar-width: 292px;
	--zoomed-vw: calc(100vw / var(--pos-zoom, 1));
	--zoomed-vh: calc(100vh / var(--pos-zoom, 1));
	--sidebar-rail-width: calc(var(--sidebar-width) * var(--pos-zoom, 1));
	--sidebar-bg: rgba(4, 12, 24, 0.82);
}

/* This is ONLY the full-height sidebar background */
body::after {
	content: "";
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: var(--sidebar-rail-width);
	background: var(--sidebar-bg);
	border-right: 1px solid var(--stroke);
	z-index: -1;
	pointer-events: none;
}

/* Whole app scales like Chrome */
body .app-shell {
	display: grid !important;
	grid-template-columns: var(--sidebar-width) minmax(0, 1fr) !important;
	width: var(--zoomed-vw) !important;
	min-width: var(--zoomed-vw) !important;
	min-height: var(--zoomed-vh) !important;
	zoom: var(--pos-zoom, 1) !important;
	transform: none !important;
	transform-origin: top left;
}

/* Sidebar content scales with the app */
body .sidebar {
	position: sticky !important;
	top: 0;
	width: var(--sidebar-width) !important;
	min-width: var(--sidebar-width) !important;
	height: 100vh;
	min-height: 100vh;
	overflow-y: auto;
	background: transparent !important;
}

/* Main content scales with the app too */
body .main-content {
	min-width: 0;
	overflow: visible;
}

body input,
body select,
body textarea,
body button {
	font-size: 1rem;
}

/* Theme rail colors */
body.theme-clinical {
	--sidebar-bg: rgba(255, 255, 255, 0.96);
}

body.theme-touch {
	--sidebar-bg: #ffffff;
}

/* Mobile reset */
@media (max-width: 820px) {
	body::after {
		display: none;
	}

	body .app-shell {
		grid-template-columns: 1fr !important;
		width: 100% !important;
		min-width: 100% !important;
		zoom: 1 !important;
	}

	body .sidebar {
		position: relative !important;
		width: 100% !important;
		min-width: 0 !important;
		height: auto !important;
		min-height: 0 !important;
		background: var(--sidebar-bg) !important;
	}

	body .main-content {
		width: 100%;
		min-width: 0;
	}
}




/* ZOOM ADDITIONAL UPDATE FOR SETTINGS*/
.settings-page {
	max-width: 100%;
	overflow-x: hidden;
}

.settings-card {
	max-width: 100%;
	overflow: hidden;
}
.theme-settings-card {
	max-width: 100%;
	overflow: hidden;
}

.settings-grid,
.settings-color-grid,
.theme-picker {
	min-width: 0;
}

.settings-grid > *,
.settings-color-grid > *,
.theme-picker > * {
	min-width: 0;
}



/* CUSTOM COLOR OVERRIDES */
body {
	--bg-0: var(--custom-bg-0);
	--bg-1: var(--custom-bg-1);
	--card: color-mix(in srgb, var(--custom-card) 72%, transparent);
	--card-2: color-mix(in srgb, var(--custom-card) 86%, transparent);
	--text: var(--custom-text);
	--muted: var(--custom-muted);
	--accent: var(--custom-accent);
	--accent-2: var(--custom-accent-2);
	--accent-3: var(--custom-success);
	--warning: var(--custom-warning);
	--danger: var(--custom-danger);
}

/* THEME 1: LIQUID DARK */
body.theme-liquid {
	background:
		radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 24%, transparent), transparent 32%),
		radial-gradient(circle at top right, color-mix(in srgb, var(--accent-2) 26%, transparent), transparent 30%),
		linear-gradient(135deg, var(--bg-0), var(--bg-1) 45%, #050b16);
}

body.theme-liquid .glass-card,
body.theme-liquid .topbar {
	background: linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.065));
	backdrop-filter: blur(26px);
}

/* FINAL CLINICAL LIGHT THEME CLEANUP */
body.theme-clinical {
	--bg-0: #f3f7fb;
	--bg-1: #ffffff;
	--bg-2: #eaf1f8;
	--card: #ffffff;
	--card-2: #f8fbff;
	--stroke: rgba(15, 23, 42, .12);
	--stroke-2: rgba(15, 23, 42, .20);
	--text: #0f172a;
	--muted: #52637a;
	--soft: #334155;
	--accent: #37a7f2;
	--accent-2: #6d5dfc;
	--accent-3: #18b981;
	--danger: #ef5b68;
	--warning: #f6b73c;
	background: linear-gradient(135deg, #edf4fb, #ffffff 42%, #f7fbff);
	color: var(--text);
}

/* readable labels everywhere */
body.theme-clinical label,
body.theme-clinical .purchase-item-head,
body.theme-clinical .data-table th,
body.theme-clinical .dashboard-module-table th,
body.theme-clinical .section-head p,
body.theme-clinical .table-sub,
body.theme-clinical .dashboard-module-head span,
body.theme-clinical .settings-color-grid label span,
body.theme-clinical .theme-picker span {
	color: var(--muted) !important;
	opacity: 1 !important;
}

/* cards */
body.theme-clinical .glass-card,
body.theme-clinical .topbar,
body.theme-clinical .login-card,
body.theme-clinical .dashboard-module,
body.theme-clinical .dashboard-module-loading {
	background: #ffffff !important;
	border-color: rgba(15, 23, 42, .10) !important;
	box-shadow: 0 20px 60px rgba(15, 23, 42, .08) !important;
	backdrop-filter: none !important;
	color: var(--text) !important;
}

/* inputs/selects/textareas */
body.theme-clinical input,
body.theme-clinical select,
body.theme-clinical textarea {
	background: #f8fafc !important;
	color: var(--text) !important;
	border-color: rgba(15, 23, 42, .14) !important;
	box-shadow: inset 0 1px 0 rgba(255,255,255,.9) !important;
}

body.theme-clinical input::placeholder,
body.theme-clinical textarea::placeholder {
	color: #7b8798 !important;
}

body.theme-clinical input:focus,
body.theme-clinical select:focus,
body.theme-clinical textarea:focus {
	background: #ffffff !important;
	border-color: rgba(55, 167, 242, .72) !important;
	box-shadow: 0 0 0 4px rgba(55, 167, 242, .14) !important;
}

/* global searchable dropdowns */
body.theme-clinical .search-dropdown-toggle,
body.theme-clinical .inventory-filters .search-dropdown-toggle {
	background: #f8fafc !important;
	color: var(--text) !important;
	border-color: rgba(15, 23, 42, .14) !important;
	box-shadow: inset 0 1px 0 rgba(255,255,255,.9) !important;
}

body.theme-clinical .search-dropdown-panel {
	background: #ffffff !important;
	color: var(--text) !important;
	border-color: rgba(15, 23, 42, .12) !important;
	box-shadow: 0 22px 60px rgba(15, 23, 42, .18) !important;
}

body.theme-clinical .search-dropdown-item,
body.theme-clinical .search-dropdown-empty {
	color: var(--text) !important;
	background: transparent !important;
}

body.theme-clinical .search-dropdown-item:hover {
	background: #eef6ff !important;
	color: #075985 !important;
}

body.theme-clinical .search-dropdown-empty,
body.theme-clinical .search-dropdown-item span {
	color: var(--muted) !important;
}

/* POS customer/cart/summary boxes */
body.theme-clinical .cart-total-box,
body.theme-clinical .purchase-summary,
body.theme-clinical .pos-customer-summary,
body.theme-clinical .customer-detail-card,
body.theme-clinical .customer-last-order,
body.theme-clinical .customer-notes {
	background: #f8fafc !important;
	border-color: rgba(15, 23, 42, .10) !important;
	color: var(--text) !important;
}

body.theme-clinical .cart-total-box div,
body.theme-clinical .purchase-summary div,
body.theme-clinical .pos-customer-summary span,
body.theme-clinical .customer-notes p,
body.theme-clinical .customer-detail-head p {
	color: var(--muted) !important;
}

body.theme-clinical .cart-total-box strong,
body.theme-clinical .purchase-summary strong {
	color: var(--text) !important;
}

/* tables */
body.theme-clinical .data-table td,
body.theme-clinical .dashboard-module-table td {
	background: #f8fafc !important;
	color: var(--text) !important;
	border-color: rgba(15, 23, 42, .10) !important;
}

/* scanner */
body.theme-clinical #barcodeInput {
	background: #eef6ff !important;
	color: var(--text) !important;
	border-color: rgba(55, 167, 242, .24) !important;
}

/* secondary / blank buttons */
body.theme-clinical .secondary-btn,
body.theme-clinical .full-width-btn {
	background: #f8fafc !important;
	color: var(--text) !important;
	border: 1px solid rgba(15, 23, 42, .14) !important;
	box-shadow: none !important;
}

/* theme cards */
body.theme-clinical .theme-picker label {
	background: #ffffff !important;
	border-color: rgba(15, 23, 42, .12) !important;
	box-shadow: 0 14px 35px rgba(15, 23, 42, .07) !important;
}

body.theme-clinical .theme-picker label::before {
	background: linear-gradient(135deg, #dff1ff, #c8dcff, #d8ccff) !important;
	opacity: 1 !important;
}

body.theme-clinical .theme-picker span {
	color: #334155 !important;
	text-shadow: none !important;
}

/* settings color rows */
body.theme-clinical .settings-color-grid label {
	background: #ffffff !important;
	border-color: rgba(15, 23, 42, .10) !important;
	color: var(--text) !important;
}

body.theme-clinical .settings-color-grid input[type="color"] {
	background: #ffffff !important;
	border: 1px solid rgba(15, 23, 42, .16) !important;
}

/* pills */
body.theme-clinical .status-pill.active {
	background: #e7f8ef !important;
	color: #087443 !important;
	border-color: #b8e8cc !important;
}

body.theme-clinical .status-pill.inactive {
	background: #fff1f2 !important;
	color: #be123c !important;
	border-color: #fecdd3 !important;
}

/* price comparison pills */
body.theme-clinical .inventory-price-lowest {
	color: #087443 !important;
	background: #dcfce7 !important;
	border-color: #86efac !important;
}

body.theme-clinical .inventory-price-highest {
	color: #b91c1c !important;
	background: #fee2e2 !important;
	border-color: #fecaca !important;
}

body.theme-clinical .inventory-price-mid,
body.theme-clinical .inventory-price-warn {
	color: #92400e !important;
	background: #fef3c7 !important;
	border-color: #fde68a !important;
}

body.theme-clinical .inventory-price-neutral,
body.theme-clinical .inventory-price-same {
	color: #075985 !important;
	background: #e0f2fe !important;
	border-color: #bae6fd !important;
}


/* THEME 3: TOUCH POS */
body.theme-touch {
	--bg-0: #215f9a;
	--bg-1: #2f74b9;
	--card: rgba(255,255,255,.95);
	--card-2: rgba(255,255,255,1);
	--stroke: rgba(8,40,80,.18);
	--stroke-2: rgba(8,40,80,.28);
	--text: #0f2f52;
	--muted: #55708c;
	--accent: #e83f6f;
	--accent-2: #f59e0b;
	--accent-3: #22c55e;
	background: #2f74b9;
	color: var(--text);
}

body.theme-touch .liquid-bg {
	display: none;
}

body.theme-touch .app-shell {
	grid-template-columns: 250px minmax(0, 1fr);
}

body.theme-touch .sidebar {
	background: #ffffff;
	color: #0f2f52;
	border-right: 0;
	box-shadow: 14px 0 30px rgba(15,47,82,.18);
}

body.theme-touch .brand {
	background: #f1f7fd;
}

body.theme-touch .sidebar nav a {
	color: #0f2f52;
	border-radius: 10px;
}

body.theme-touch .sidebar nav a.active,
body.theme-touch .sidebar nav a:hover {
	background: #dbeafe;
	color: #174f86;
	transform: none;
}

body.theme-touch .topbar {
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 10px 24px rgba(15,47,82,.16);
}

body.theme-touch .topbar h1 {
	font-size: clamp(34px, 4vw, 58px);
	letter-spacing: -1px;
}

body.theme-touch .glass-card {
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 10px 28px rgba(15,47,82,.14);
	backdrop-filter: none;
}

body.theme-touch input,
body.theme-touch select,
body.theme-touch textarea {
	background: #f8fafc;
	color: #0f2f52;
	border-color: #cbd5e1;
	border-radius: 10px;
}

body.theme-touch button,
body.theme-touch .soft-btn {
	border-radius: 10px;
}

@media (max-width: 900px) {
	.settings-grid,
	.settings-color-grid,
	.theme-picker {
		grid-template-columns: 1fr;
	}
}

/*=====================================FORMS DROPDOWN UPDATE=========================================*/

/* PAGE CARD SPACING */
.product-page,
.purchase-page,
.supplier-page,
.customer-page,
.user-page {
	display: grid;
	gap: 26px;
	align-content: start;
}

/* COLLAPSIBLE FORM BANNERS */
.collapsible-form-card {
	padding: 0;
	overflow: hidden;
}

.collapsible-form-card > .section-head {
	margin: 0;
	padding: 24px 28px;
	min-height: 112px;
	align-items: center;
	cursor: pointer;
	border-radius: var(--radius-xl);
	transition: background .2s ease, border-color .2s ease;
}

.collapsible-form-card > .section-head:hover {
	background: rgba(255,255,255,.055);
}

.collapsible-form-card > .section-head h2 {
	font-size: 30px;
}

.collapsible-form-card > .section-head p {
	font-size: 17px;
}

.collapsible-form-card:not(.form-collapsed) > .section-head {
	border-bottom: 1px solid var(--stroke);
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	margin-bottom: 24px;
}

.collapsible-form-card:not(.form-collapsed) > :not(.section-head) {
	margin-left: 24px;
	margin-right: 24px;
	margin-bottom: 24px;
}

.collapsible-form-card.form-collapsed > :not(.section-head) {
	display: none !important;
}

.form-collapse-btn {
	min-width: 150px;
	min-height: 58px;
	border: 0;
	border-radius: 16px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #fff;
	box-shadow: 0 16px 34px color-mix(in srgb, var(--accent) 28%, transparent);
	font-size: 17px;
	font-weight: 900;
	padding: 14px 22px;
}

.form-collapse-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 20px 42px color-mix(in srgb, var(--accent) 34%, transparent);
}

.collapsible-form-card:not(.form-collapsed) .form-collapse-btn {
	background: linear-gradient(135deg, var(--danger), #f97316);
	box-shadow: 0 16px 34px color-mix(in srgb, var(--danger) 26%, transparent);
}


@media (max-width: 760px) {
	.collapsible-form-card > .section-head {
		display: grid;
		gap: 16px;
	}

	.form-collapse-btn {
		width: 100%;
	}
}
















/* =========================================================
   FINAL THEME + CUSTOM COLOR FIX
   Paste at VERY END of app.css
   ========================================================= */

/* ---------- Sidebar background rail should fill full screen ---------- */

body {
	position: relative;
	--sidebar-width: 292px;
	--sidebar-rail-width: calc(var(--sidebar-width) * var(--pos-zoom, 1));
}

body::after {
	content: "";
	position: fixed;
	top: 0;
	left: 0;
	width: var(--sidebar-rail-width);
	height: 100vh;
	background: var(--sidebar-bg, rgba(4, 12, 24, 0.82));
	z-index: 0;
	pointer-events: none;
	border-right: 1px solid var(--stroke);
	box-shadow: 18px 0 60px rgba(15, 23, 42, 0.10);
}

body .app-shell {
	position: relative;
	z-index: 1;
}

body .sidebar {
	background: transparent !important;
}


/* ---------- Theme defaults, overridden by custom colors if present ---------- */

body.theme-liquid {
	--bg-0: var(--custom-bg-0, #06111f);
	--bg-1: var(--custom-bg-1, #0b1930);
	--card: color-mix(in srgb, var(--custom-card, #18273a) 78%, transparent);
	--card-solid: var(--custom-card, #18273a);
	--text: var(--custom-text, #f4f8ff);
	--heading: var(--custom-heading, #f4f8ff);
	--muted: var(--custom-muted, #a9bbd3);
	--sidebar-bg: var(--custom-sidebar-bg, #07111f);
	--sidebar-text: var(--custom-sidebar-text, #c8d8ed);
	--field-bg: var(--custom-input-bg, #07111f);
	--field-border: var(--custom-border, rgba(255,255,255,.16));
	--accent: var(--custom-accent, #38bdf8);
	--accent-2: var(--custom-accent-2, #8b5cf6);
	--success: var(--custom-success, #22c55e);
	--warning: var(--custom-warning, #fbbf24);
	--danger: var(--custom-danger, #fb7185);
	--button-text: var(--custom-button-text, #ffffff);

	background:
		radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 24%, transparent), transparent 32%),
		radial-gradient(circle at top right, color-mix(in srgb, var(--accent-2) 26%, transparent), transparent 30%),
		linear-gradient(135deg, var(--bg-0), var(--bg-1) 45%, #050b16) !important;
}

body.theme-clinical {
	--bg-0: var(--custom-bg-0, #edf4fb);
	--bg-1: var(--custom-bg-1, #ffffff);
	--card: var(--custom-card, #ffffff);
	--card-solid: var(--custom-card, #ffffff);
	--text: var(--custom-text, #0f172a);
	--heading: var(--custom-heading, #0f172a);
	--muted: var(--custom-muted, #52637a);
	--sidebar-bg: var(--custom-sidebar-bg, #ffffff);
	--sidebar-text: var(--custom-sidebar-text, #334155);
	--field-bg: var(--custom-input-bg, #f8fafc);
	--field-border: var(--custom-border, rgba(15, 23, 42, .14));
	--accent: var(--custom-accent, #37a7f2);
	--accent-2: var(--custom-accent-2, #6d5dfc);
	--success: var(--custom-success, #16a34a);
	--warning: var(--custom-warning, #f59e0b);
	--danger: var(--custom-danger, #ef4444);
	--button-text: var(--custom-button-text, #ffffff);

	background:
		linear-gradient(135deg, var(--bg-0), #ffffff 42%, #f7fbff) !important;
	color: var(--text) !important;
}

body.theme-touch {
	--bg-0: var(--custom-bg-0, #2f74b9);
	--bg-1: var(--custom-bg-1, #eaf3fb);
	--card: var(--custom-card, #ffffff);
	--card-solid: var(--custom-card, #ffffff);
	--text: var(--custom-text, #10233f);
	--heading: var(--custom-heading, #10233f);
	--muted: var(--custom-muted, #536987);
	--sidebar-bg: var(--custom-sidebar-bg, #ffffff);
	--sidebar-text: var(--custom-sidebar-text, #24364f);
	--field-bg: var(--custom-input-bg, #f8fafc);
	--field-border: var(--custom-border, #cbd8e8);
	--accent: var(--custom-accent, #e83f6f);
	--accent-2: var(--custom-accent-2, #f59e0b);
	--success: var(--custom-success, #22c55e);
	--warning: var(--custom-warning, #f59e0b);
	--danger: var(--custom-danger, #ef4444);
	--button-text: var(--custom-button-text, #ffffff);

	background:
		linear-gradient(135deg, var(--bg-0) 0%, #407fc2 38%, var(--bg-1) 38%, #ffffff 100%) !important;
	color: var(--text) !important;
}


/* ---------- Global readable colors ---------- */

body,
body.theme-liquid,
body.theme-clinical,
body.theme-touch {
	color: var(--text) !important;
}

.topbar h1,
.glass-card h2,
.glass-card h3,
.section-head h2,
.section-head h3,
.dashboard-module-head h3,
.dashboard-stat-value,
.settings-card h3 {
	color: var(--heading) !important;
}

.topbar p,
.glass-card p,
.section-head p,
.table-sub,
.dashboard-stat-caption,
.dashboard-module-head span,
.customer-detail-head p,
.customer-notes p {
	color: var(--muted) !important;
}

label,
.data-table th,
.dashboard-module-table th,
.purchase-item-head {
	color: var(--muted) !important;
	opacity: 1 !important;
}


/* ---------- Cards / panels ---------- */

.glass-card,
.login-card,
.topbar,
.dashboard-module,
.dashboard-module-loading,
.stat-card,
.collapsible-form-card {
	background: var(--card) !important;
	border-color: var(--field-border) !important;
	color: var(--text) !important;
}

body.theme-liquid .glass-card,
body.theme-liquid .login-card,
body.theme-liquid .topbar,
body.theme-liquid .dashboard-module,
body.theme-liquid .stat-card,
body.theme-liquid .collapsible-form-card {
	background: linear-gradient(
		145deg,
		color-mix(in srgb, var(--card-solid) 76%, transparent),
		color-mix(in srgb, var(--card-solid) 48%, transparent)
	) !important;
	backdrop-filter: blur(26px);
}

body.theme-clinical .glass-card,
body.theme-clinical .login-card,
body.theme-clinical .topbar,
body.theme-clinical .dashboard-module,
body.theme-clinical .stat-card,
body.theme-clinical .collapsible-form-card,
body.theme-touch .glass-card,
body.theme-touch .login-card,
body.theme-touch .topbar,
body.theme-touch .dashboard-module,
body.theme-touch .stat-card,
body.theme-touch .collapsible-form-card {
	background: var(--card) !important;
	backdrop-filter: none !important;
}


/* ---------- Inputs / selects / textareas ---------- */

input,
select,
textarea,
.search-dropdown-toggle,
.inventory-filters .search-dropdown-toggle {
	background: var(--field-bg) !important;
	color: var(--text) !important;
	border-color: var(--field-border) !important;
}

input::placeholder,
textarea::placeholder {
	color: color-mix(in srgb, var(--muted) 70%, transparent) !important;
}

input:focus,
select:focus,
textarea:focus,
.search-dropdown.open .search-dropdown-toggle {
	background: var(--field-bg) !important;
	color: var(--text) !important;
	border-color: var(--accent) !important;
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent) !important;
}


/* ---------- Search dropdowns, suppliers, customers ---------- */

.search-dropdown-panel {
	background: var(--card-solid) !important;
	color: var(--text) !important;
	border-color: var(--field-border) !important;
	box-shadow: 0 22px 60px rgba(15, 23, 42, .22) !important;
}

body.theme-liquid .search-dropdown-panel {
	background: #07111f !important;
}

.search-dropdown-panel input {
	background: var(--field-bg) !important;
	color: var(--text) !important;
	border-color: var(--accent) !important;
}

.search-dropdown-item,
.search-dropdown-empty {
	color: var(--text) !important;
	background: transparent !important;
	box-shadow: none !important;
}

.search-dropdown-item span,
.search-dropdown-empty {
	color: var(--muted) !important;
}

.search-dropdown-item:hover {
	background: color-mix(in srgb, var(--accent) 14%, transparent) !important;
	color: var(--text) !important;
}


/* ---------- Tables / totals / POS blocks ---------- */

.data-table td,
.dashboard-module-table td,
.cart-total-box,
.purchase-summary,
.pos-customer-summary,
.customer-detail-card,
.customer-last-order,
.customer-notes {
	background: color-mix(in srgb, var(--card-solid) 82%, var(--bg-1)) !important;
	color: var(--text) !important;
	border-color: var(--field-border) !important;
}

.cart-total-box div,
.purchase-summary div,
.pos-customer-summary span {
	color: var(--muted) !important;
}

.cart-total-box strong,
.purchase-summary strong {
	color: var(--heading) !important;
}


/* ---------- Buttons: theme-aware and readable ---------- */

button,
.primary-btn,
.refresh-btn,
.form-collapse-btn,
.checkout-btn,
.success-btn,
.soft-btn,
.mini-btn:not(.danger) {
	background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
	color: var(--button-text) !important;
	border: 0 !important;
	box-shadow: 0 16px 34px color-mix(in srgb, var(--accent) 24%, transparent) !important;
}

.secondary-btn,
.full-width-btn {
	background: color-mix(in srgb, var(--card-solid) 86%, var(--bg-1)) !important;
	color: var(--text) !important;
	border: 1px solid var(--field-border) !important;
	box-shadow: none !important;
}

.danger,
.danger-btn,
.mini-btn.danger {
	background: linear-gradient(135deg, var(--danger), #ef4444) !important;
	color: #ffffff !important;
}


/* ---------- Sidebar text ---------- */

.sidebar nav a,
.sidebar .brand strong,
.sidebar .brand span {
	color: var(--sidebar-text) !important;
}

.sidebar nav a.active,
.sidebar nav a:hover {
	color: var(--heading) !important;
	background: color-mix(in srgb, var(--accent) 14%, transparent) !important;
}


/* ---------- Settings page theme cards and color rows ---------- */

.theme-picker label {
	background: color-mix(in srgb, var(--card-solid) 92%, var(--bg-1)) !important;
	border-color: var(--field-border) !important;
	color: var(--text) !important;
}

.theme-picker label::before {
	opacity: 1 !important;
}

.theme-picker label.theme-swatch-liquid::before {
	background: linear-gradient(135deg, #123d5b, #08111f 54%, #2d1f59) !important;
}

.theme-picker label.theme-swatch-clinical::before {
	background: linear-gradient(135deg, #dff1ff, #d8e6ff 48%, #d8ccff) !important;
}

.theme-picker label.theme-swatch-touch::before {
	background: linear-gradient(135deg, #e83f6f, #f59e0b) !important;
}

.theme-picker label.theme-swatch-top-pos::before {
	background: linear-gradient(135deg, #0f3f78, #2e75b6 55%, #e43f6f) !important;
}

.theme-picker label.theme-swatch-iconbar::before {
	background: linear-gradient(135deg, #0b0b0f, #1f2937 42%, #2563eb 43%, #db2777) !important;
}

.theme-picker label.theme-swatch-compact-sidebar::before {
	background: linear-gradient(135deg, #030712, #111827 52%, #22d3ee) !important;
}

.theme-picker span {
	color: var(--heading) !important;
	text-shadow: none !important;
}

.settings-color-grid label {
	background: color-mix(in srgb, var(--card-solid) 90%, var(--bg-1)) !important;
	border-color: var(--field-border) !important;
	color: var(--text) !important;
}

.settings-color-grid input[type="color"] {
	background: var(--field-bg) !important;
	border: 1px solid var(--field-border) !important;
}


/* ---------- Form banner buttons exactly like Refresh style ---------- */

.form-collapse-btn {
	min-width: 150px;
	min-height: 58px;
	border-radius: 16px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
	color: var(--button-text) !important;
	font-size: 17px;
	font-weight: 900;
	box-shadow: 0 16px 34px color-mix(in srgb, var(--accent) 28%, transparent) !important;
}

.collapsible-form-card:not(.form-collapsed) .form-collapse-btn {
	background: linear-gradient(135deg, var(--danger), #f97316) !important;
	color: #ffffff !important;
}


/* ---------- Mobile reset ---------- */

@media (max-width: 820px) {
	body::after {
		display: none;
	}

	body .sidebar {
		background: var(--sidebar-bg) !important;
	}
}



/* =========================================================
   POS Customer collapsible banner + dropdown z-index fix
   ========================================================= */

.pos-customer-card {
	position: relative;
	z-index: 80;
}

.pos-customer-card.collapsible-form-card:not(.form-collapsed) {
	overflow: visible !important;
}

.pos-customer-form-body {
	position: relative;
	z-index: 2;
}

.pos-customer-toolbar {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 16px;
}

.pos-customer-card .search-dropdown {
	position: relative;
	z-index: 200;
}

.pos-customer-card .search-dropdown.open {
	z-index: 9999;
}

.pos-customer-card .search-dropdown-panel {
	z-index: 10000 !important;
}

.pos-customer-card .pos-customer-summary {
	position: relative;
	z-index: 1;
}

.pos-layout {
	position: relative;
	z-index: 1;
}

/* Keep POS customer banner behaving like the other collapsed form banners */
.pos-customer-card.form-collapsed {
	overflow: hidden !important;
}

.pos-customer-card.form-collapsed + .pos-layout {
	margin-top: 0;
}

.pos-customer-card:not(.form-collapsed) + .pos-layout {
	margin-top: 22px;
}


/* =========================================================
   FINAL OPTIMIZED BACKGROUND + SIDEBAR RAIL FIX
   Keeps all existing theme styling, but normalizes the page
   rail and Touch POS split background behavior.
   ========================================================= */

html,
body {
	min-height: 100%;
}

body {
	--sidebar-width: 292px;
	--active-sidebar-width: var(--sidebar-width);
	--sidebar-rail-width: calc(var(--active-sidebar-width) * var(--pos-zoom, 1));
	background-attachment: fixed;
}

/* Fixed viewport rail + document-height rail work together:
   - body::after covers the visible viewport while scrolling.
   - .app-shell::before covers the full content height. */
body::after {
	content: "";
	position: fixed;
	inset: 0 auto 0 0;
	width: var(--sidebar-rail-width);
	height: 100vh;
	background: var(--sidebar-bg, rgba(4, 12, 24, 0.82));
	border-right: 1px solid var(--stroke);
	box-shadow: 18px 0 60px rgba(15, 23, 42, 0.10);
	z-index: 0;
	pointer-events: none;
}

body .app-shell {
	position: relative;
	z-index: 1;
	isolation: isolate;
	min-height: max(100vh, var(--zoomed-vh, 100vh)) !important;
}

body .app-shell::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	width: var(--active-sidebar-width);
	min-height: 100%;
	background: var(--sidebar-bg, rgba(4, 12, 24, 0.82));
	border-right: 1px solid var(--stroke);
	box-shadow: 18px 0 60px rgba(15, 23, 42, 0.10);
	z-index: 0;
	pointer-events: none;
}

body .sidebar,
body .main-content {
	position: relative;
	z-index: 1;
}

body .sidebar {
	background: transparent !important;
}

/* Touch POS only: Background 1 controls the upper-left half,
   Background 2 controls the bottom-right half, with a hard diagonal split. */
body.theme-touch {
	background: linear-gradient(
		135deg,
		var(--bg-0) 0%,
		var(--bg-0) 50%,
		var(--bg-1) 50%,
		var(--bg-1) 100%
	) fixed !important;
}

@media (max-width: 820px) {
	body::after,
	body .app-shell::before {
		display: none !important;
	}

	body .sidebar {
		background: var(--sidebar-bg) !important;
	}
}

/* =========================================================
   TOUCH POS READABILITY + SIDEBAR / BACKGROUND FINAL FIX
   Paste remains safe at end: fixes only layout rail, Touch POS
   background split, purchase-price pills and status pills.
   ========================================================= */

/* Sidebar rail must match the real sidebar column in every theme */
body {
	--active-sidebar-width: var(--sidebar-width, 292px);
	--sidebar-rail-width: calc(var(--active-sidebar-width) * var(--pos-zoom, 1));
}

body.theme-touch {
	--active-sidebar-width: 292px;
}

body .app-shell {
	grid-template-columns: var(--active-sidebar-width) minmax(0, 1fr) !important;
	min-height: max(100vh, var(--zoomed-vh, 100vh)) !important;
}

body .sidebar {
	width: var(--active-sidebar-width) !important;
	min-width: var(--active-sidebar-width) !important;
	min-height: max(100vh, var(--zoomed-vh, 100vh)) !important;
	background: transparent !important;
}

/* Full-height sidebar background: viewport + full document height */
body::after {
	width: var(--sidebar-rail-width) !important;
	background: var(--sidebar-bg, rgba(4, 12, 24, 0.82)) !important;
	z-index: 0 !important;
}

body .app-shell::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	width: var(--active-sidebar-width) !important;
	min-height: 100% !important;
	background: var(--sidebar-bg, rgba(4, 12, 24, 0.82)) !important;
	border-right: 1px solid var(--stroke);
	box-shadow: 18px 0 60px rgba(15, 23, 42, 0.10);
	z-index: 0;
	pointer-events: none;
}

body .sidebar,
body .main-content {
	position: relative;
	z-index: 1;
}

/* Touch POS only: keep diagonal background out of the sidebar.
   Background 1 = upper-left page area, Background 2 = bottom-right page area. */
body.theme-touch {
	background: var(--sidebar-bg, #ffffff) !important;
}

body.theme-touch .main-content {
	background:
		linear-gradient(
			135deg,
			var(--bg-0) 0%,
			var(--bg-0) 50%,
			var(--bg-1) 50%,
			var(--bg-1) 100%
		) fixed !important;
	min-height: max(100vh, var(--zoomed-vh, 100vh));
}

/* Touch POS purchase price pills: stronger text + clearer fills */
body.theme-touch .inventory-price-band {
	font-weight: 950 !important;
	opacity: 1 !important;
	box-shadow: inset 0 1px 0 rgba(255,255,255,.55) !important;
}

body.theme-touch .inventory-price-neutral {
	color: #334155 !important;
	background: #e2e8f0 !important;
	border-color: #cbd5e1 !important;
}

body.theme-touch .inventory-price-same {
	color: #075985 !important;
	background: #dff3ff !important;
	border-color: #7dd3fc !important;
}

body.theme-touch .inventory-price-lowest {
	color: #087443 !important;
	background: #d8f8e5 !important;
	border-color: #74d99a !important;
}

body.theme-touch .inventory-price-good {
	color: #3f6212 !important;
	background: #ecfccb !important;
	border-color: #bef264 !important;
}

body.theme-touch .inventory-price-mid {
	color: #854d0e !important;
	background: #fef3c7 !important;
	border-color: #facc15 !important;
}

body.theme-touch .inventory-price-warn {
	color: #9a3412 !important;
	background: #ffedd5 !important;
	border-color: #fb923c !important;
}

body.theme-touch .inventory-price-highest {
	color: #991b1b !important;
	background: #fee2e2 !important;
	border-color: #f87171 !important;
}

/* Touch POS status pills: paid/unpaid/partial must be readable */
body.theme-touch .status-pill {
	font-weight: 950 !important;
	opacity: 1 !important;
	text-shadow: none !important;
	box-shadow: inset 0 1px 0 rgba(255,255,255,.55) !important;
}

body.theme-touch .status-pill.active,
body.theme-touch .status-pill.paid,
body.theme-touch .status-pill.completed,
body.theme-touch .status-pill.valid {
	color: #087443 !important;
	background: #d8f8e5 !important;
	border-color: #74d99a !important;
}

body.theme-touch .status-pill.inactive,
body.theme-touch .status-pill.unpaid,
body.theme-touch .status-pill.failed,
body.theme-touch .status-pill.invalid {
	color: #be123c !important;
	background: #ffe4e6 !important;
	border-color: #fda4af !important;
}

body.theme-touch .status-pill.partial,
body.theme-touch .status-pill.pending,
body.theme-touch .status-pill.warning {
	color: #92400e !important;
	background: #fef3c7 !important;
	border-color: #fbbf24 !important;
}

@media (max-width: 820px) {
	body .app-shell {
		grid-template-columns: 1fr !important;
	}

	body .sidebar {
		width: 100% !important;
		min-width: 0 !important;
		min-height: 0 !important;
		background: var(--sidebar-bg) !important;
	}

	body.theme-touch .main-content {
		background:
			linear-gradient(
				135deg,
				var(--bg-0) 0%,
				var(--bg-0) 50%,
				var(--bg-1) 50%,
				var(--bg-1) 100%
			) fixed !important;
	}
}


/*=================================SIDEBAR NO SCROLL UPDATE=====================================*/

html, body {
	height: 100%;
}

body {
	min-height: 100vh;
}


/* =========================================================
   RETURNS PAGES FIXED CSS
   Sales Returns + Purchase Returns
   Paste at VERY END of app.css
   ========================================================= */

.return-page {
	display: grid;
	gap: 22px;
	align-content: start;
}

.return-page .glass-card {
	overflow: visible !important;
}

.return-page .section-head {
	margin-bottom: 18px;
}

#salesReturnBarcode,
#purchaseReturnBarcode {
	min-height: 64px;
	font-size: 24px;
	font-weight: 850;
	letter-spacing: 1px;
	text-align: center;
	border-radius: 22px;
	background: var(--field-bg) !important;
	color: var(--text) !important;
	border: 2px solid color-mix(in srgb, var(--accent) 45%, var(--field-border)) !important;
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent) !important;
}

#salesReturnBarcode::placeholder,
#purchaseReturnBarcode::placeholder {
	color: color-mix(in srgb, var(--muted) 72%, transparent) !important;
}

.return-page h3 {
	margin: 8px 0 14px;
	color: var(--heading, var(--text)) !important;
	font-size: 22px;
	letter-spacing: -0.4px;
}

/* 7 visible columns:
   Product | Barcode | Qty | Price | Condition | Reason | Button
*/
.return-item-row {
	display: grid;
	grid-template-columns:
		minmax(170px, 1.6fr)
		minmax(130px, 1fr)
		minmax(82px, .55fr)
		minmax(105px, .75fr)
		minmax(130px, .95fr)
		minmax(150px, 1.15fr)
		44px;
	gap: 10px;
	align-items: center;
	margin-bottom: 10px;
}

.return-item-row input,
.return-item-row select {
	min-height: 44px;
	border-radius: 12px;
	padding: 10px 12px;
}

.return-item-row .return-qty,
.return-item-row .return-unit-price {
	text-align: right;
	font-weight: 800;
}

.return-item-row .return-product-name[readonly] {
	opacity: 1;
	cursor: not-allowed;
}

.return-item-head {
	color: var(--muted) !important;
	font-size: 12px;
	font-weight: 850;
	text-transform: uppercase;
	letter-spacing: .8px;
	margin-bottom: 8px;
}

.return-item-head span {
	color: var(--muted) !important;
}

.return-item-row .mini-btn.danger {
	width: 44px;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	border-radius: 12px;
	background: linear-gradient(135deg, var(--danger), #ef4444) !important;
	color: #ffffff !important;
	box-shadow: none !important;
}

/* Summary */
.return-summary {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
	padding: 16px;
	border-radius: 18px;
	background: color-mix(in srgb, var(--card-solid, var(--card)) 82%, var(--bg-1)) !important;
	border: 1px solid var(--field-border, var(--stroke)) !important;
}

.return-summary div {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	color: var(--muted) !important;
	font-weight: 800;
}

.return-summary strong {
	color: var(--heading, var(--text)) !important;
	font-size: 22px;
	font-weight: 900;
}

/* History status readability */
.return-page .status-pill,
body.theme-touch .return-page .status-pill {
	font-weight: 900 !important;
	min-width: 82px;
	padding: 7px 12px;
	border-radius: 999px;
	opacity: 1 !important;
}

.return-page .status-pill.active,
body.theme-touch .return-page .status-pill.active {
	background: #dcfce7 !important;
	color: #065f46 !important;
	border: 1px solid #86efac !important;
}

.return-page .status-pill.inactive,
body.theme-touch .return-page .status-pill.inactive {
	background: #fee2e2 !important;
	color: #991b1b !important;
	border: 1px solid #fecaca !important;
}

/* Touch POS specific readability */
body.theme-touch .return-page input,
body.theme-touch .return-page select,
body.theme-touch .return-page textarea {
	background: #f8fafc !important;
	color: #10233f !important;
	border-color: #cbd8e8 !important;
}

body.theme-touch .return-summary {
	background: #f8fafc !important;
	border-color: #d6e2ef !important;
}

body.theme-touch .return-summary div {
	color: #536987 !important;
}

body.theme-touch .return-summary strong {
	color: #10233f !important;
}

/* Responsive */
@media (max-width: 1200px) {
	.return-item-row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.return-item-head {
		display: none;
	}

	.return-item-row .mini-btn.danger {
		width: 100%;
	}
}

@media (max-width: 900px) {
	.return-summary {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 620px) {
	.return-item-row,
	.return-summary {
		grid-template-columns: 1fr;
	}
}

















}

/* ================================
   NEW THEME SHELLS + CALCULATOR
   Paste at the very end of app.css.
   ================================ */

body {
	--heading: var(--custom-heading, var(--text));
	--input-bg-final: var(--custom-input-bg, rgba(3, 9, 20, 0.58));
	--border-final: var(--custom-border, var(--stroke));
}

body h1,
body h2,
body h3,
body h4,
body h5,
body h6 {
	color: var(--heading);
}

body input,
body select,
body textarea,
body .search-dropdown-toggle {
	background: var(--input-bg-final);
	border-color: var(--border-final);
	color: var(--text);
}

body button,
body .soft-btn,
body .success-btn,
body .form-collapse-btn {
	color: var(--custom-button-text, #ffffff);
}

.topbar-tools {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	flex-wrap: wrap;
}

.top-clock,
.top-user-pill,
.top-customer-pill,
.cart-drawer-toggle {
	min-height: 42px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 9px 14px;
	border-radius: 14px;
	background: color-mix(in srgb, var(--card) 72%, transparent);
	border: 1px solid var(--stroke);
	color: var(--text);
	font-weight: 850;
	box-shadow: none;
}

.top-user-pill {
	display: grid;
	gap: 1px;
	line-height: 1.1;
}

.top-user-pill span,
.top-customer-pill span + span {
	color: var(--muted);
	font-size: 11px;
	font-weight: 800;
}

.top-customer-pill[hidden],
.cart-drawer-toggle {
	display: none;
}

body.has-pos-cart .cart-drawer-toggle {
	display: inline-flex;
}

.top-customer-pill b {
	width: 22px;
	height: 22px;
	display: inline-grid;
	place-items: center;
	border-radius: 999px;
	background: var(--danger);
	color: #fff;
	font-size: 12px;
	font-style: normal;
}

.cart-drawer-toggle span {
	min-width: 24px;
	height: 24px;
	display: inline-grid;
	place-items: center;
	border-radius: 999px;
	background: var(--accent-2);
	color: #fff;
	font-size: 12px;
}

.sidebar-collapse-btn {
	display: none;
	width: 46px;
	height: 46px;
	min-height: 46px;
	padding: 0;
	margin: 0 0 14px;
	border-radius: 14px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	box-shadow: none;
}

.sidebar-collapse-btn span {
	width: 20px;
	height: 2px;
	display: block;
	margin: 4px auto;
	border-radius: 99px;
	background: currentColor;
}

/* Theme tabs always show their own design colors */
.theme-picker .theme-swatch::before {
	opacity: 1 !important;
}

.theme-swatch-liquid::before {
	background: linear-gradient(135deg, #123d5b, #08111f 54%, #2d1f59) !important;
}

.theme-swatch-clinical::before {
	background: linear-gradient(135deg, #dff1ff, #d8e6ff 48%, #d8ccff) !important;
}

.theme-swatch-touch::before {
	background: linear-gradient(135deg, #df6b83, #ee9278 48%, #f6c05f) !important;
}

.theme-swatch-top-pos::before {
	background: linear-gradient(135deg, #0f3f78, #2e75b6 55%, #e43f6f) !important;
}

.theme-swatch-iconbar::before {
	background: linear-gradient(135deg, #0b0b0f, #1f2937 42%, #2563eb 43%, #db2777) !important;
}

.theme-swatch-compact-sidebar::before {
	background: linear-gradient(135deg, #030712, #111827 52%, #22d3ee) !important;
}

.theme-swatch-liquid span,
.theme-swatch-top-pos span,
.theme-swatch-iconbar span,
.theme-swatch-compact-sidebar span {
	color: #ffffff !important;
}

.theme-swatch-clinical span,
.theme-swatch-touch span {
	color: #172033 !important;
}

/* Theme 1: top banner restaurant POS */
body.theme-top-pos {
	--bg-0: var(--custom-bg-0, #0f3f78);
	--bg-1: var(--custom-bg-1, #2e75b6);
	--card: var(--custom-card, #ffffff);
	--text: var(--custom-text, #0f172a);
	--muted: var(--custom-muted, #52637a);
	--heading: var(--custom-heading, #0f172a);
	--sidebar-bg: var(--custom-sidebar-bg, #0b2f5f);
	--sidebar-text: var(--custom-sidebar-text, #ffffff);
	background: linear-gradient(135deg, var(--bg-0), var(--bg-1)) fixed !important;
	color: var(--text);
}

body.theme-top-pos::after,
body.theme-top-pos .app-shell::before,
body.theme-iconbar::after,
body.theme-iconbar .app-shell::before {
	display: none !important;
}

body.theme-top-pos .app-shell,
body.theme-iconbar .app-shell {
	grid-template-columns: 1fr !important;
	width: var(--zoomed-vw, 100vw) !important;
	min-width: var(--zoomed-vw, 100vw) !important;
}

body.theme-top-pos .sidebar,
body.theme-iconbar .sidebar {
	position: sticky !important;
	top: 0;
	z-index: 1500;
	width: 100% !important;
	min-width: 0 !important;
	height: auto !important;
	min-height: 0 !important;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 12px 18px;
	background: var(--sidebar-bg) !important;
	color: var(--sidebar-text);
	border-right: 0;
	border-bottom: 1px solid color-mix(in srgb, var(--sidebar-text) 22%, transparent);
	box-shadow: 0 18px 42px rgba(0, 0, 0, .18);
}

body.theme-top-pos .brand,
body.theme-iconbar .brand {
	flex: 0 0 auto;
	margin: 0;
	background: color-mix(in srgb, var(--sidebar-text) 12%, transparent);
	border-color: color-mix(in srgb, var(--sidebar-text) 18%, transparent);
}

body.theme-top-pos .sidebar nav,
body.theme-iconbar .sidebar nav {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	overflow-x: auto;
}

body.theme-top-pos .sidebar nav a,
body.theme-iconbar .sidebar nav a {
	min-height: 44px;
	flex: 0 0 auto;
	color: var(--sidebar-text);
	border-radius: 999px;
	background: transparent;
}

body.theme-top-pos .sidebar nav a.active,
body.theme-top-pos .sidebar nav a:hover {
	background: var(--custom-accent, #e43f6f);
	color: #fff;
	transform: none;
}

body.theme-top-pos .main-content,
body.theme-iconbar .main-content {
	padding: 24px;
}

body.theme-top-pos .topbar,
body.theme-top-pos .glass-card {
	background: var(--card) !important;
	color: var(--text);
	border-color: color-mix(in srgb, var(--custom-border, #cbd5e1) 78%, transparent) !important;
	backdrop-filter: none;
	box-shadow: 0 18px 48px rgba(15, 23, 42, .16);
}

body.theme-top-pos .cart-panel,
body.theme-iconbar .cart-panel {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 2200;
	width: min(560px, 96vw);
	max-height: 100vh;
	overflow: auto;
	transform: translateX(108%);
	transition: transform .24s ease;
	border-radius: 24px 0 0 24px;
}

body.theme-top-pos.cart-drawer-open .cart-panel,
body.theme-iconbar.cart-drawer-open .cart-panel {
	transform: translateX(0);
}

.cart-drawer-close {
	display: none;
	position: sticky;
	top: 0;
	z-index: 5;
	float: right;
	width: 42px;
	height: 42px;
	min-height: 42px;
	padding: 0;
	margin: -8px -8px 8px 8px;
	border-radius: 999px;
	background: var(--danger);
	box-shadow: none;
}

body.theme-top-pos .cart-drawer-close,
body.theme-iconbar .cart-drawer-close {
	display: inline-grid;
	place-items: center;
}

/* Theme 2: icon top bar */
body.theme-iconbar {
	--bg-0: var(--custom-bg-0, #f5f7fb);
	--bg-1: var(--custom-bg-1, #ffffff);
	--card: var(--custom-card, #ffffff);
	--text: var(--custom-text, #111827);
	--muted: var(--custom-muted, #64748b);
	--heading: var(--custom-heading, #111827);
	--sidebar-bg: var(--custom-sidebar-bg, #0b0b0f);
	--sidebar-text: var(--custom-sidebar-text, #f8fafc);
	background: linear-gradient(135deg, var(--bg-0), var(--bg-1)) fixed !important;
	color: var(--text);
}

body.theme-iconbar .sidebar nav a {
	min-width: 74px;
	display: grid;
	justify-items: center;
	gap: 4px;
	border-radius: 10px;
	font-size: 12px;
}

body.theme-iconbar .sidebar nav a::before,
body.theme-compact-sidebar .sidebar nav a::before {
	width: 34px;
	height: 34px;
	display: inline-grid;
	place-items: center;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #fff;
	font-size: 12px;
	font-weight: 950;
	box-shadow: none;
}

body.theme-iconbar .sidebar nav a[href$="/dashboard"]::before,
body.theme-compact-sidebar .sidebar nav a[href$="/dashboard"]::before { content: "D"; }
body.theme-iconbar .sidebar nav a[href$="/pos-sale"]::before,
body.theme-compact-sidebar .sidebar nav a[href$="/pos-sale"]::before { content: "POS"; }
body.theme-iconbar .sidebar nav a[href$="/sales"]::before,
body.theme-compact-sidebar .sidebar nav a[href$="/sales"]::before { content: "S"; }
body.theme-iconbar .sidebar nav a[href$="/products"]::before,
body.theme-compact-sidebar .sidebar nav a[href$="/products"]::before { content: "P"; }
body.theme-iconbar .sidebar nav a[href$="/inventory"]::before,
body.theme-compact-sidebar .sidebar nav a[href$="/inventory"]::before { content: "I"; }
body.theme-iconbar .sidebar nav a[href$="/purchases"]::before,
body.theme-compact-sidebar .sidebar nav a[href$="/purchases"]::before { content: "$"; }
body.theme-iconbar .sidebar nav a[href$="/suppliers"]::before,
body.theme-compact-sidebar .sidebar nav a[href$="/suppliers"]::before { content: "SUP"; }
body.theme-iconbar .sidebar nav a[href$="/customers"]::before,
body.theme-compact-sidebar .sidebar nav a[href$="/customers"]::before { content: "C"; }
body.theme-iconbar .sidebar nav a[href$="/reports"]::before,
body.theme-compact-sidebar .sidebar nav a[href$="/reports"]::before { content: "R"; }
body.theme-iconbar .sidebar nav a[href$="/users"]::before,
body.theme-compact-sidebar .sidebar nav a[href$="/users"]::before { content: "U"; }
body.theme-iconbar .sidebar nav a[href$="/settings"]::before,
body.theme-compact-sidebar .sidebar nav a[href$="/settings"]::before { content: "SET"; }
body.theme-iconbar .sidebar nav a[href$="/logout"]::before,
body.theme-compact-sidebar .sidebar nav a[href$="/logout"]::before { content: "OUT"; }

body.theme-iconbar .sidebar nav a.active,
body.theme-iconbar .sidebar nav a:hover {
	background: color-mix(in srgb, var(--accent) 20%, transparent);
	color: #fff;
	transform: none;
}

body.theme-iconbar .topbar,
body.theme-iconbar .glass-card {
	background: var(--card) !important;
	color: var(--text);
	border-color: var(--border-final) !important;
	backdrop-filter: none;
	box-shadow: 0 16px 40px rgba(15, 23, 42, .10);
}

/* Theme 3: collapsible left sidebar */
body.theme-compact-sidebar {
	--bg-0: var(--custom-bg-0, #08111f);
	--bg-1: var(--custom-bg-1, #111827);
	--card: color-mix(in srgb, var(--custom-card, #182233) 88%, transparent);
	--text: var(--custom-text, #eef2ff);
	--muted: var(--custom-muted, #a5b4c8);
	--heading: var(--custom-heading, #f8fafc);
	--sidebar-bg: var(--custom-sidebar-bg, #030712);
	--sidebar-text: var(--custom-sidebar-text, #dbeafe);
	background: linear-gradient(135deg, var(--bg-0), var(--bg-1)) fixed !important;
	color: var(--text);
}

body.theme-compact-sidebar .sidebar-collapse-btn {
	display: grid;
	place-items: center;
}

body.theme-compact-sidebar .sidebar {
	background: transparent !important;
	color: var(--sidebar-text);
}

body.theme-compact-sidebar .sidebar nav a {
	color: var(--sidebar-text);
}

body.theme-compact-sidebar.sidebar-collapsed {
	--active-sidebar-width: 96px;
	--sidebar-width: 96px;
}

body.theme-compact-sidebar.sidebar-collapsed .brand {
	justify-content: center;
	padding: 10px;
}

body.theme-compact-sidebar.sidebar-collapsed .brand strong,
body.theme-compact-sidebar.sidebar-collapsed .brand span {
	display: none;
}

body.theme-compact-sidebar.sidebar-collapsed .sidebar nav a {
	justify-content: center;
	padding: 12px 8px;
	font-size: 0;
}

body.theme-compact-sidebar.sidebar-collapsed .sidebar nav a::before {
	width: 46px;
	height: 46px;
	font-size: 13px;
}

/* Calculator */
.calculator-fab {
	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 3000;
	width: 64px;
	height: 64px;
	min-height: 64px;
	padding: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	box-shadow: 0 18px 40px rgba(0, 0, 0, .26);
	font-size: 15px;
}

body.calculator-off .calculator-fab {
	display: none !important;
}

.calculator-modal {
	position: fixed;
	inset: 0;
	z-index: 3100;
	display: grid;
	place-items: center;
	padding: 18px;
	background: rgba(0, 0, 0, .54);
}

.calculator-modal[hidden] {
	display: none;
}

.calculator-box {
	width: min(360px, 100%);
	padding: 18px;
	border-radius: 24px;
	background: var(--card);
	border: 1px solid var(--stroke);
	box-shadow: 0 24px 80px rgba(0, 0, 0, .34);
	color: var(--text);
}

.calculator-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.calculator-close {
	width: 42px;
	min-height: 42px;
	padding: 0;
	border-radius: 999px;
	background: var(--danger);
	box-shadow: none;
}

.calculator-display {
	width: 100%;
	min-height: 62px;
	margin-bottom: 12px;
	text-align: right;
	font-size: 30px;
	font-weight: 900;
}

.calculator-keys {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
}

.calculator-keys button {
	min-height: 56px;
	padding: 0;
	border-radius: 14px;
	background: color-mix(in srgb, var(--accent) 16%, var(--card));
	color: var(--text);
	border: 1px solid var(--stroke);
	box-shadow: none;
}

.calculator-keys .calculator-equals {
	grid-column: span 2;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #fff;
}

@media (max-width: 820px) {
	body.theme-top-pos .sidebar,
	body.theme-iconbar .sidebar {
		position: relative !important;
		display: grid;
	}

	body.theme-top-pos .sidebar nav,
	body.theme-iconbar .sidebar nav {
		justify-content: start;
	}
}














/* ICON SIDEBAR FINAL FIX */

.sidebar nav a .nav-svg-icon {
	display: none;
}

body.theme-top-pos .sidebar nav a .nav-svg-icon,
body.theme-iconbar .sidebar nav a .nav-svg-icon,
body.theme-compact-sidebar .sidebar nav a .nav-svg-icon {
	width: 44px;
	height: 44px;
	min-width: 44px;
	display: inline-grid;
	place-items: center;
	border-radius: 14px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	color: #fff;
	box-shadow: 0 10px 24px rgba(56, 189, 248, .18);
}

body.theme-top-pos .sidebar nav a .nav-svg-icon svg,
body.theme-iconbar .sidebar nav a .nav-svg-icon svg,
body.theme-compact-sidebar .sidebar nav a .nav-svg-icon svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

body.theme-iconbar .sidebar nav a::before,
body.theme-iconbar .sidebar nav a::after,
body.theme-compact-sidebar .sidebar nav a::before,
body.theme-compact-sidebar .sidebar nav a::after {
	display: none !important;
	content: none !important;
}

/* compact sidebar spacing */
body.theme-compact-sidebar {
	--compact-icon-size: 44px;
	--compact-nav-gap: 8px;
}

body.theme-compact-sidebar .sidebar {
	padding: 18px 16px !important;
}

body.theme-compact-sidebar .sidebar nav {
	gap: var(--compact-nav-gap) !important;
}

body.theme-compact-sidebar .sidebar nav a {
	min-height: calc(var(--compact-icon-size) + 8px);
	padding: 4px 10px !important;
	gap: 10px !important;
	border-radius: 16px;
}

body.theme-compact-sidebar .sidebar nav a .nav-svg-icon {
	width: var(--compact-icon-size);
	height: var(--compact-icon-size);
	min-width: var(--compact-icon-size);
}

/* collapse button same size/style as nav icons */
body.theme-compact-sidebar .sidebar-collapse-btn {
	width: var(--compact-icon-size) !important;
	height: var(--compact-icon-size) !important;
	min-height: var(--compact-icon-size) !important;
	margin: 0 0 var(--compact-nav-gap) 10px !important;
	padding: 0 !important;
	border-radius: 14px !important;
	background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
	border: 1px solid rgba(255,255,255,.38) !important;
	box-shadow: 0 10px 24px rgba(56,189,248,.18) !important;
}

body.theme-compact-sidebar .sidebar-collapse-btn span {
	width: 22px !important;
	height: 2px !important;
	margin: 3px auto !important;
	border-radius: 99px;
	background: #fff !important;
}

/* collapsed state: all icons equal, all gaps equal */
body.theme-compact-sidebar.sidebar-collapsed .sidebar {
	padding: 18px 12px !important;
}

body.theme-compact-sidebar.sidebar-collapsed .brand {
	width: 56px !important;
	height: 56px !important;
	min-height: 56px !important;
	margin: 0 auto 14px !important;
	padding: 6px !important;
	border-radius: 18px !important;
}

body.theme-compact-sidebar.sidebar-collapsed .brand-mark {
	width: 42px !important;
	height: 42px !important;
	border-radius: 14px !important;
}

body.theme-compact-sidebar.sidebar-collapsed .sidebar-collapse-btn {
	width: 56px !important;
	height: 56px !important;
	min-height: 56px !important;
	margin: 0 auto 12px !important;
	border-radius: 18px !important;
}

body.theme-compact-sidebar.sidebar-collapsed .sidebar nav {
	gap: 10px !important;
	align-items: center !important;
}

body.theme-compact-sidebar.sidebar-collapsed .sidebar nav a {
	width: 56px !important;
	height: 56px !important;
	min-height: 56px !important;
	margin: 0 auto !important;
	padding: 0 !important;
	display: grid !important;
	place-items: center !important;
	font-size: 0 !important;
	line-height: 0 !important;
	border-radius: 18px !important;
}

body.theme-compact-sidebar.sidebar-collapsed .sidebar nav a .nav-svg-icon {
	width: 56px !important;
	height: 56px !important;
	min-width: 56px !important;
	border-radius: 18px !important;
}

body.theme-compact-sidebar.sidebar-collapsed .sidebar nav a .nav-svg-icon svg {
	width: 25px !important;
	height: 25px !important;
}

/* calculator offset controlled from Settings */
.calculator-fab {
	left: var(--calculator-offset-x, 24px) !important;
	bottom: var(--calculator-offset-y, 24px) !important;
}

body.theme-compact-sidebar .calculator-fab {
	left: calc(var(--sidebar-rail-width, 292px) + var(--calculator-offset-x, 24px)) !important;
}

body.theme-compact-sidebar.sidebar-collapsed .calculator-fab {
	left: calc(var(--sidebar-rail-width, 96px) + var(--calculator-offset-x, 24px)) !important;
}

/* Purchase details popup */
.purchase-history-row {
	cursor: pointer;
	transition: .18s ease;
}

.purchase-history-row:hover,
.purchase-history-row:focus {
	background: color-mix(in srgb, var(--accent) 9%, transparent);
	outline: none;
}

.status-pill.partial,
.status-pill.warning {
	background: rgba(251, 191, 36, .16);
	color: #facc15;
	border: 1px solid rgba(251, 191, 36, .34);
}

.purchase-detail-modal {
	position: fixed;
	inset: 0;
	z-index: 2600;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(2, 6, 23, .68);
	backdrop-filter: blur(12px);
}

.purchase-detail-modal[hidden] {
	display: none !important;
}

.purchase-detail-box {
	width: min(1180px, calc(100vw - 32px));
	max-height: calc(100vh - 48px);
	overflow: auto;
	padding: 24px;
	border-radius: 24px;
	background: var(--card-solid, var(--card, #ffffff));
	color: var(--text);
	border: 1px solid var(--border-final, var(--stroke));
	box-shadow: 0 28px 90px rgba(0, 0, 0, .34);
}

.purchase-detail-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	margin-bottom: 16px;
}

.purchase-detail-header h3 {
	margin: 0;
	font-size: 28px;
}

.purchase-detail-header p {
	margin: 6px 0 0;
	color: var(--muted);
}

.purchase-detail-content {
	display: grid;
	gap: 18px;
}

.purchase-detail-grid,
.purchase-detail-totals {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.purchase-detail-totals {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

.purchase-detail-card,
.purchase-detail-totals > div,
.purchase-payment-panel {
	padding: 14px;
	border-radius: 16px;
	background: color-mix(in srgb, var(--card-solid, var(--card)) 88%, var(--bg-1));
	border: 1px solid var(--border-final, var(--stroke));
}

.purchase-detail-card span,
.purchase-detail-totals span,
.purchase-detail-muted {
	display: flex;
	color: var(--muted);
	font-size: 13px;
	font-weight: 750;
}

.purchase-detail-card strong,
.purchase-detail-totals strong {
	display: block;
	margin-top: 6px;
	color: var(--heading);
	font-size: 20px;
}

.purchase-detail-card small {
	display: block;
	margin-top: 6px;
	color: var(--muted);
	line-height: 1.45;
}

.purchase-detail-section h4 {
	margin: 0 0 10px;
	font-size: 18px;
}

.purchase-detail-table th,
.purchase-detail-table td {
	white-space: nowrap;
}

.purchase-detail-notes {
	margin: 0;
	padding: 14px;
	border-radius: 14px;
	background: color-mix(in srgb, var(--card-solid, var(--card)) 86%, var(--bg-1));
	border: 1px solid var(--border-final, var(--stroke));
	color: var(--text);
}

.purchase-payment-form {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
}

.purchase-payment-form .full {
	grid-column: 1 / -1;
}

@media (max-width: 900px) {
	.purchase-detail-modal {
		padding: 12px;
	}

	.purchase-detail-box {
		width: calc(100vw - 24px);
		max-height: calc(100vh - 24px);
		padding: 16px;
	}

	.purchase-detail-grid,
	.purchase-detail-totals,
	.purchase-payment-form {
		grid-template-columns: 1fr;
	}
}

/* User roles and session management */
.role-permission-card,
.active-sessions-card {
	margin-top: 22px;
}

.role-limit-pill,
.session-limit-row {
	display: inline-flex;
	align-items: center;
	min-height: 42px;
	padding: 0 14px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--accent) 12%, transparent);
	border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
	color: var(--heading);
	font-weight: 850;
}

.role-form {
	display: grid;
	gap: 16px;
	margin-bottom: 22px;
}

.role-form-top {
	display: grid;
	gap: 16px;
}

.role-form.is-selecting-role .role-form-top {
	grid-template-columns: minmax(0, 1fr);
}

.role-form.is-adding-role .role-form-top {
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(180px, .6fr);
}

.role-form [hidden] {
	display: none !important;
}

.permission-groups {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.permission-group {
	margin: 0;
	padding: 14px;
	border-radius: 16px;
	border: 1px solid var(--border-final, var(--stroke));
	background: color-mix(in srgb, var(--card-solid, var(--card)) 88%, var(--bg-1));
}

.permission-group legend {
	padding: 0 6px;
	color: var(--heading);
	font-weight: 900;
}

.permission-check {
	display: grid;
	grid-template-columns: 22px minmax(0, 1fr);
	gap: 10px;
	align-items: start;
	margin: 10px 0 0;
	color: var(--text);
}

.permission-check input {
	width: 18px;
	min-height: 18px;
	margin-top: 3px;
}

.permission-check strong,
.permission-check small {
	display: block;
}

.permission-check strong {
	color: var(--heading);
	font-size: 14px;
}

.permission-check small {
	margin-top: 2px;
	color: var(--muted);
	font-size: 12px;
	line-height: 1.35;
}

.role-table-wrap {
	margin-top: 10px;
}

.session-device {
	max-width: 320px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

@media (max-width: 900px) {
	.role-form-top,
	.permission-groups {
		grid-template-columns: 1fr;
	}
}
