* {
	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%
	);
	min-height: 100vh;
}

a {
	.total-section {
		display: none !important;
	}
	text-decoration: none;
	color: rgb(0, 0, 0);
}

.container {
	background-color: var(--surface);
	width: 100%;
	padding-top: 4rem;
}

/* HEADER */
.header {
	background: linear-gradient(135deg, var(--accent), var(--accent-light));
	padding: 20px 30px;
	border-radius: 10px 10px 0 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 3px solid var(--accent-dark);
}

.header h1 {
	color: white;
	font-size: 28px;
	font-weight: bold;
}

.user-badge {
	background-color: var(--text-muted);
	padding: 12px 24px;
	border-radius: 10px;
	color: var(--text);
	font-weight: bold;
	font-size: 16px;
}

/* MAIN */
.main-content {
	padding: 25px;
	display: grid;
	grid-template-columns: 400px 140px 1fr;
	gap: 20px;
	align-items: start;
}

/* LEFT */
.left-section {
	display: flex;
	flex-direction: column;
	gap: 5px;
	width: 100%;
	max-width: 100%;
	min-width: 0;
}

.action-buttons {
	display: flex;
	gap: 15px;
	flex-wrap: wrap;
	width: 100%;
}

.action-buttons .btn,
.action-buttons button {
	flex: 1 1 0;
	max-width: none;
	min-width: 0;
	width: auto;
}

.btn {
	padding: 10px 24px;
	border-radius: 10px;
	border: none;
	font-size: 15px;
	font-weight: bold;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.3s;
}

.action-buttons .btn-accent {
	box-shadow: 0 6px 18px rgba(31, 122, 140, 0.18);
}
.btn {
	white-space: nowrap;
}

.btn-primary {
	background: var(--accent-light);
	color: white;
}

.btn-primary:hover {
	background-color: var(--accent-dark);
}

.drug-list {
	background-color: #072635;
	border-radius: 10px;
	padding: 15px;
	border: 2px solid var(--text-muted);
	min-height: 400px;
	max-height: 600px;
	/* Allow both vertical and horizontal scrolling when content overflows, like stock page */
	overflow: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--accent) transparent;
	scrollbar-gutter: stable;
}

.drug-list::-webkit-scrollbar {
	width: 8px;
}

.drug-list::-webkit-scrollbar-track {
	background: transparent;
	border-radius: 10px;
	/* Push track to vertical center third */
	margin-top: 33%;
	margin-bottom: 33%;
}

.drug-list::-webkit-scrollbar-thumb {
	background: linear-gradient(180deg, var(--accent), var(--accent-light));
	border-radius: 10px;
	min-height: 40px;
	border: 2px solid transparent;
	background-clip: content-box;
}

.drug-list::-webkit-scrollbar-thumb:hover {
	background: linear-gradient(
		180deg,
		var(--accent-dark),
		var(--accent-light)
	);
	background-clip: content-box;
}

.drug-item {
	margin-bottom: 1px;
	font-size: 13px;
	color: #f5f1e8;
	line-height: 1.4;
	padding: 4px 8px;
	border-radius: 5px;
	transition: all 0.3s;
	cursor: pointer;
	/* Keep the drug name on a single line so it can expand the card horizontally */
	white-space: nowrap;
	overflow: visible;
}

.drug-item strong {
	font-weight: bold;
	display: inline-block;
	white-space: nowrap;
	/* allow the strong text to expand horizontally */
	min-width: 0;
}

.drug-item.selected,
.drug-item:hover {
	color: var(--warning) !important;
	font-weight: bold;
}

.search-input {
	flex: 1 1 auto;
	min-width: 0;
	width: auto;
	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);
}

.search-container {
	margin-top: 4px;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	overflow: visible;
}

.search-controls {
	display: flex;
	align-items: center;
	gap: 8px;
	position: relative;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	overflow: visible;
}

.filter-btn {
	flex: 0 1 auto;
	max-width: 160px;
	min-width: 0;
	padding: 10px 12px;
	border: 2px solid var(--text-muted);
	border-radius: 10px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.filter-btn:hover {
	border-color: var(--accent);
	background: #f8faf7;
}

.filter-popover {
	display: none;
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	width: min(290px, 78vw);
	background: var(--surface);
	border: 1px solid var(--text-muted);
	border-radius: 10px;
	box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
	padding: 10px;
	z-index: 30;
}

.filter-popover.active {
	display: block;
}

.filter-popover-header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 4px 8px;
	font-size: 13px;
	font-weight: 700;
	color: var(--text);
	border-bottom: 1px solid rgba(15, 23, 42, 0.08);
	margin-bottom: 8px;
}

.filter-popover-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 10px;
}

.filter-modal-list {
	display: flex;
	flex-direction: column;
	gap: 7px;
	max-height: 230px;
	overflow-y: auto;
	padding-right: 4px;
}

.filter-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 9px 10px;
	border: 1px solid var(--text-muted);
	border-radius: 9px;
	background: var(--surface-alt);
	color: var(--text);
	font: inherit;
	font-size: 12px;
	text-align: left;
	cursor: pointer;
	transition: all 0.2s ease;
}

.filter-option:hover {
	border-color: var(--accent);
}

.filter-option.active {
	background: rgba(118, 146, 93, 0.12);
	border-color: var(--accent);
	box-shadow: 0 0 0 1px rgba(118, 146, 93, 0.2);
}

.filter-option.empty {
	opacity: 0.7;
	cursor: default;
}

.filter-option.empty .filter-count {
	color: #6b7280;
}

.filter-count {
	font-size: 11px;
	font-weight: 700;
	padding: 4px 7px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.05);
}

.filter-hint {
	font-size: 11px;
	color: #4b5563;
	margin-top: 8px;
	line-height: 1.4;
}

/* CENTER */
.center-section {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-self: start;
	margin-top: 45px;
}

.payment-methods {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.payment-btn {
	padding: 10px 8px;
	border-radius: 10px;
	border: none;
	font-weight: bold;
	font-size: 14px;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.3s;
	text-align: center;
	line-height: 1.2;
}

.payment-btn:hover {
	opacity: 95%;
}

.payment-method-status {
	margin-top: 6px;
	padding: 8px 12px;
	border-radius: 999px;
	background: #f3f4f6;
	color: #2f3a1f;
	font-size: 13px;
	font-weight: 700;
	text-align: center;
	border: 1px solid #d5d9c7;
	cursor: pointer;
}
.payment-method-status:hover {
	background: #e5e7eb;
}

.payment-btn.active {
	border: 2px solid var(--danger);
}

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

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

.admin-status-wrap {
	position: relative;
}

.admin-status-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	padding: 0;
	border-radius: 50%;
	border: 2px solid rgba(0, 0, 0, 0.2);
	cursor: pointer;
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease,
		opacity 0.2s ease;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
	position: relative;
}

.admin-status-button:hover {
	transform: scale(1.08);
}

.admin-status-button.level-green {
	background: #22c55e;
}

.admin-status-button.level-yellow {
	background: #facc15;
}

.admin-status-button.level-red {
	background: #ef4444;
	/* stronger base glow */
	box-shadow:
		0 0 10px rgba(239, 68, 68, 0.35),
		0 0 24px rgba(239, 68, 68, 0.14);
	animation: levelRedPulse 2.6s infinite ease-in-out;
}

/* Radiating ring using pseudo-element */
.admin-status-button.level-red::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 18px;
	height: 18px;
	border-radius: 50%;
	pointer-events: none;
	box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.65);
	opacity: 0.9;
	animation: adminRedRadiate 1.6s infinite ease-out;
}

@keyframes adminRedRadiate {
	0% {
		box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.65);
		transform: translate(-50%, -50%) scale(1);
		opacity: 0.9;
	}
	70% {
		box-shadow: 0 0 0 20px rgba(239, 68, 68, 0);
		transform: translate(-50%, -50%) scale(1.6);
		opacity: 0;
	}
	100% {
		box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
		transform: translate(-50%, -50%) scale(1.6);
		opacity: 0;
	}
}

@keyframes levelRedPulse {
	0% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.06);
	}
	100% {
		transform: scale(1);
	}
}

.admin-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.admin-status-popover {
	position: absolute;
	right: 0;
	top: calc(100% + 12px);
	width: 360px;
	background: rgba(255, 255, 255, 0.96);
	border: 1px solid rgba(15, 23, 42, 0.12);
	border-radius: 10px;
	box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
	z-index: 30;
	padding: 10px 12px 12px;
	max-height: 56vh;
	overflow-y: auto;
}

.admin-status-popover.hidden {
	display: none;
}

.admin-status-popover-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
	padding-bottom: 6px;
	border-bottom: 1px solid #e5e7eb;
	color: #111827;
}

.admin-status-close {
	background: transparent;
	border: none;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	color: #374151;
}

.admin-status-content {
	font-size: 12px;
	line-height: 1.5;
	color: #1f2937;
}

.admin-status-summary {
	font-size: 13px;
	margin-bottom: 8px;
	color: #111827;
}

.admin-status-group {
	margin-bottom: 8px;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	border: 1px solid #eef2f7;
}

.group-header {
	padding: 8px 10px;
	font-weight: 700;
	font-size: 12px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	color: #0f172a;
}

.group-header.group-blockers {
	background: rgba(239, 68, 68, 0.12);
	border-bottom: 1px solid rgba(239, 68, 68, 0.12);
	color: #7f1d1d;
}
.group-header.group-issues {
	background: rgba(255, 179, 0, 0.12);
	border-bottom: 1px solid rgba(255, 159, 0, 0.14);
	color: #92400e;
}
.group-header.group-monitoring {
	background: rgba(59, 130, 246, 0.12);
	border-bottom: 1px solid rgba(37, 99, 235, 0.12);
	color: #08306b;
}
.group-header.group-info {
	background: rgba(16, 185, 129, 0.08);
	border-bottom: 1px solid rgba(16, 185, 129, 0.08);
	color: #065f46;
}

.group-body {
	padding: 8px 12px;
	font-size: 12px;
	color: #374151;
}
.group-body ul {
	margin: 0;
	padding-left: 14px;
}
.group-body .empty {
	color: #9ca3af;
	font-style: italic;
}
.count {
	background: rgba(0, 0, 0, 0.06);
	padding: 2px 6px;
	border-radius: 999px;
	font-weight: 700;
	font-size: 11px;
}

/* Collapsible behaviour */
.group-body.collapsed {
	display: none;
}
.group-header .caret {
	margin-left: 8px;
	opacity: 0.7;
	font-size: 12px;
}

/* AdminSystem item severity styles */
.admin-status-content .as-item {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin-bottom: 6px;
}
.admin-status-content .as-icon {
	width: 26px;
	height: 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	border-radius: 50%;
	flex: 0 0 26px;
	box-shadow: 0 2px 6px rgba(2, 6, 23, 0.06);
}
.admin-status-content .as-msg {
	flex: 1;
	font-size: 13px;
	color: #071227;
	line-height: 1.35;
}
.admin-status-content .as-blockers .as-icon {
	background: #fee2e2;
	color: #991b1b;
}
.admin-status-content .as-issues .as-icon {
	background: #fff7ed;
	color: #b45309;
}
.admin-status-content .as-monitoring .as-icon {
	background: #eff6ff;
	color: #0369a1;
}
.admin-status-content .as-info .as-icon {
	background: #ecfdf5;
	color: #065f46;
}

.admin-status-group {
	border-left: 4px solid rgba(0, 0, 0, 0.03);
}

.group-header {
	cursor: pointer;
}
.group-header:hover {
	opacity: 0.95;
}

.admin-status-content ul {
	margin: 0;
	padding-left: 16px;
}

.admin-status-content .as-item {
	background: linear-gradient(180deg, #ffffff, #fbfbff);
	border: 1px solid rgba(2, 6, 23, 0.05);
	padding: 10px;
	border-radius: 8px;
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin-bottom: 8px;
}
.admin-status-content .as-badge {
	display: inline-block;
	background: rgba(99, 102, 241, 0.08);
	color: #312e81;
	padding: 3px 8px;
	border-radius: 999px;
	font-size: 12px;
	margin-right: 6px;
}
.admin-status-content .as-details {
	margin-top: 6px;
	font-size: 11px;
	color: #6b7280;
}

.btn-secondary {
	background: linear-gradient(
		135deg,
		var(--accent-light) 0%,
		var(--accent-light) 100%
	);
	color: white;
	padding: 10px 20px;
	font-size: 14px;
}

/* INVOICE AREA */
.invoice-area {
	background: linear-gradient(
		135deg,
		var(--warning) 0%,
		var(--accent-light) 100%
	);
	border-radius: 10px 10px 0 0;
	padding: 18px;
	border: 3px solid var(--text-muted);
	border-bottom: none;
	display: flex;
	flex-direction: column;
}

.invoice-header {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr 1fr;
	gap: 6px;
	margin-bottom: 8px;
}

.invoice-col {
	background-color: var(--danger);
	padding: 10px 6px;
	text-align: center;
	font-weight: bold;
	border-radius: 5px;
	color: var(--text);
	font-size: 14px;
}

#cartItems {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr 1fr;
	gap: 6px;
	margin-bottom: 10px;
}

/* Keep cart items contained and scrollable to prevent the invoice card growing */
#cartItems {
	max-height: 360px;
	overflow-y: auto;
	scrollbar-width: thin;
}

#cartItems::-webkit-scrollbar {
	width: 8px;
}
#cartItems::-webkit-scrollbar-thumb {
	background: linear-gradient(180deg, var(--accent), var(--accent-light));
	border-radius: 8px;
}

.cart-cell {
	background-color: rgba(255, 255, 255, 0.7);
	padding: 10px 6px;
	border-radius: 5px;
	min-height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	color: var(--text);
	font-weight: 500;
	word-wrap: break-word;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cart-cell.empty-row {
	background-color: rgba(255, 255, 255, 0.3);
}
.cart-cell.selected-cart-item {
	background-color: var(--warning);
	border: 2px solid var(--text);
}

.total-section {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr 1fr;
	gap: 6px;
	margin-top: 10px;
}

.total-label {
	grid-column: 1 / 4;
	background-color: var(--text-muted);
	padding: 14px 16px;
	border-radius: 10px;
	text-align: right;
	font-size: 18px;
	font-weight: bold;
	color: var(--text);
}

.total-value {
	background-color: var(--text-muted);
	padding: 14px 16px;
	border-radius: 10px;
	text-align: center;
	font-size: 18px;
	font-weight: bold;
	color: var(--text);
}

/* PAYMENT TOGGLE — Cash/Credit centered */
.toggle-buttons-group {
	display: flex;
	gap: 14px;
	align-items: center;
}

.toggle-btn {
	padding: 12px 36px;
	border-radius: 30px;
	border: none;
	font-weight: bold;
	font-size: 15px;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.3s;
	white-space: nowrap;
}
.toggle-cash {
	background: linear-gradient(135deg, #072635 0%, #0d3952 100%);
	color: #ffffff;
	box-shadow: 0 8px 18px rgba(7, 38, 53, 0.2);
}
.toggle-credit {
	background-color: var(--danger);
	color: white;
}
.csd-chip-credit {
	background: linear-gradient(135deg, #f59e0b, #fbbf24);
	color: #111;
}
.toggle-btn:hover {
	transform: scale(1.05);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.analysis-btn {
	background: var(--accent-light);
	color: #ffffff;
	padding: 8px 16px;
	border-radius: 10px;
	border: none;
	font-weight: 700;
	font-size: 13px;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.25s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-left: 0;
	width: 100%;
	letter-spacing: 0.3px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.analysis-btn:hover {
	background-color: var(--accent-light);
}

/* PRINT BUTTON */
.print-btn {
	background: var(--accent-light);
	color: #ffffff;
	padding: 8px 16px;
	border-radius: 10px;
	border: none;
	font-weight: 700;
	font-size: 13px;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.25s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-left: 0;
	width: 100%;
	letter-spacing: 0.3px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.print-btn:hover {
	background-color: var(--accent-light);
}

.print-btn:disabled {
	background: gray;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* BOTTOM ACTIONS */
.bottom-actions {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 10px;
}

.action-box {
	padding: 10px;
	border-radius: 10px;
	text-align: center;
	font-weight: bold;
	font-size: 15px;
	cursor: pointer;
	font-family: inherit;
	border: none;
}

.action-box:hover,
.reconciliation-btn:hover {
	background-color: var(--accent-dark);
}

.action-adjust {
	background: var(--accent-light);
	color: #ffffff;
}
.action-reports {
	background: var(--accent-light);
	color: #ffffff;
}
.action-dashboard {
	background: var(--accent-light);
	color: #ffffff;
}

.action-expenses {
	background: var(--accent-light);
	color: #ffffff;
}

.reconciliation-btn {
	background-color: var(--accent-light);
	color: #ffffff;
	padding: 10px;
	border-radius: 10px;
	border: none;
	font-weight: bold;
	font-size: 15px;
	font-family: inherit;
	cursor: pointer;
	transition: all 0.3s;
}

/* FOOTER */
.footer {
	background: var(--surface);
	padding: 15px;
	text-align: center;
	border-radius: 0 0 17px 17px;
	border-top: 2px solid var(--text-muted);
}

.footer-text {
	color: var(--text);
	font-size: 16px;
}
.footer-link {
	color: var(--primary);
	text-decoration: none;
}
.footer-link:hover {
	text-decoration: underline;
}

/* =============================================
   REDESIGNED MODALS  (matches stock page)
   ============================================= */

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}
@keyframes slideUp {
	from {
		transform: translateY(30px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

/* ── shared overlay ── */
.modal-overlay,
.adjust-qty-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: 12000;
	padding: 24px 24px 96px;
	justify-content: center;
	align-items: center;
	animation: fadeIn 0.2s ease;
}

.medicine-detail-modal {
	max-width: 620px;
	border: 1px solid rgba(116, 130, 102, 0.18);
	box-shadow: 0 26px 62px rgba(15, 23, 42, 0.18);
}

.medicine-detail-header {
	padding: 18px 22px;
}

.medicine-detail-close {
	min-width: 40px;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 26px;
	line-height: 1;
	background: rgba(255, 255, 255, 0.15);
	color: var(--surface);
}

.medicine-detail-body {
	padding: 22px;
}

.medicine-detail-grid {
	display: grid;
	gap: 14px;
}

.medicine-detail-card {
	background: linear-gradient(180deg, #f8fafc 0%, #f1f6fb 100%);
	border: 1px solid #dfeaf8;
	border-radius: 10px;
	padding: 14px 16px;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.medicine-detail-half {
	display: grid;
	grid-template-columns: 1fr;
	gap: 6px;
}

.medicine-detail-full {
	display: grid;
	gap: 6px;
}

.medicine-detail-label {
	font-size: 11px;
	color: #607087;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.medicine-detail-value {
	font-size: 17px;
	font-weight: 800;
	color: #1f2937;
	line-height: 1.4;
}

.medicine-detail-copy {
	font-size: 13px;
	line-height: 1.6;
	color: #223042;
	white-space: normal;
}

.medicine-detail-actions {
	padding: 0 22px 22px;
	justify-content: flex-end;
}

.modal-overlay.active,
.adjust-qty-modal.active,
.confirm-modal.active {
	display: flex;
}

/* ── shared card ── */
.modal-content,
.adjust-qty-content,
.confirm-content {
	background: var(--surface);
	border-radius: 10px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	width: 90%;
	max-width: 500px;
	max-height: calc(100vh - 110px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: slideUp 0.25s ease;
	border: none;
}

/* Wider modal variant (used for product details grid) */
.modal-content.wide {
	max-width: 920px;
	max-height: calc(100vh - 110px);
}

/* Compact details grid inside the wide details modal */
.details-section {
	margin-bottom: 0;
}
.details-section-title {
	font-weight: 600;
	font-size: 12px;
	color: #666;
	text-transform: uppercase;
	margin-bottom: 4px;
	line-height: 1.2;
}
.details-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 4px;
	align-items: start;
}
.details-cell {
	padding: 4px 6px;
	border-radius: 8px;
	background: linear-gradient(135deg, #fff 0%, #f8fbff 100%);
	border: 1px solid #e8eef7;
	min-height: auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.details-label {
	color: #6b7280;
	font-size: 10px;
	font-weight: 700;
	margin-bottom: 2px;
	line-height: 1.15;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.details-value {
	color: #111827;
	font-weight: 600;
	font-size: 11px;
	line-height: 1.2;
	white-space: normal;
	overflow-wrap: anywhere;
}

.details-modal-stack {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.details-summary-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.details-summary-title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--text-muted);
}

.prescription-field-wrap {
	display: none;
	margin-top: 0;
}

.client-notes-field-wrap {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 0;
}

.client-notes-hint {
	font-size: 11px;
	color: var(--text-muted);
	line-height: 1.4;
}

.client-notes-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	min-height: 22px;
}

.client-note-tag {
	display: inline-flex;
	align-items: center;
	padding: 4px 8px;
	border-radius: 999px;
	background: rgba(90, 107, 66, 0.12);
	color: var(--accent-dark);
	font-size: 11px;
	font-weight: 700;
}

.confirm-content {
	max-width: 420px;
}

/* ── green gradient header strip ── */
.modal-header-row,
.adjust-qty-header,
.confirm-header {
	background: linear-gradient(
		135deg,
		var(--accent-dark) 0%,
		var(--accent-light) 100%
	);
	padding: 20px 28px;
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--surface);
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.3px;
}

/* item name + stock badge side by side in modal header */
.modal-header-row {
	justify-content: space-between;
}

.modal-header-item {
	font-size: 16px;
	font-weight: 700;
	color: var(--surface);
	flex: 1;
}

.modal-header-stock {
	background: rgba(255, 255, 255, 0.2);
	color: var(--surface);
	font-size: 13px;
	font-weight: 600;
	padding: 6px 14px;
	border-radius: 10px;
	white-space: nowrap;
}

/* ── body ── */
.modal-body,
.adjust-qty-body,
.confirm-body {
	padding: 28px;
	background: var(--surface-alt);
	overflow-y: auto;
	flex: 1 1 auto;
}

/* ── field + label ── */
.modal-quantity-section,
.adjust-qty-section,
.adjust-qty-info {
	margin-bottom: 0;
}

.modal-label,
.adjust-qty-label {
	display: block;
	margin-bottom: 8px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--text-muted);
}

/* ── inputs ── */
.modal-input-qty,
.adjust-qty-input {
	width: 100%;
	padding: 11px 14px;
	border: 1.5px solid var(--surface-alt);
	border-radius: 10px;
	font-size: 15px;
	font-family: inherit;
	background: var(--surface);
	color: var(--text);
	transition:
		border-color 0.2s,
		box-shadow 0.2s;
}

.modal-note-block {
	width: 100%;
	min-height: 0;
	padding: 10px 12px;
	border: 1.5px solid var(--surface-alt);
	border-radius: 10px;
	background: var(--surface);
	color: var(--text);
	font-size: 14px;
	line-height: 1.4;
	white-space: pre-wrap;
}

#insuranceModal .modal-content {
	max-width: 700px;
	border: 1px solid rgba(96, 117, 91, 0.2);
	box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
}

.ins-provider-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 18px;
	max-height: 220px;
	overflow-y: auto;
	padding: 8px;
	background: #f5f7f3;
	border: 1px solid #dae0d7;
	border-radius: 8px;
}

.ins-provider-row {
	display: grid;
	grid-template-columns: 1.5fr 0.8fr 0.9fr;
	gap: 10px;
	align-items: center;
	padding: 12px 14px;
	border-radius: 6px;
	background: #ffffff;
	border: 1px solid #dfe6df;
	color: var(--text);
	font-size: 13px;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.ins-provider-row .ins-prov-label {
	font-weight: 700;
	color: #1f2a2b;
}

.ins-provider-row .ins-prov-key {
	color: #5d6a66;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-size: 11px;
}

.ins-provider-row .ins-prov-coverage {
	color: var(--text-muted);
	text-align: right;
	font-weight: 600;
}

.modal-separator {
	height: 1px;
	background: linear-gradient(
		90deg,
		rgba(116, 130, 102, 0.18),
		rgba(116, 130, 102, 0.02)
	);
	margin: 12px 0 18px;
}

.ins-modal-add-section {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 14px 16px;
	background: #f6f8f3;
	border: 1px solid #dde4d9;
	border-radius: 8px;
}

.ins-add-title {
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #586c5d;
}

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

.modal-field {
	margin-bottom: 0;
}

.modal-warning-block .warning-item {
	margin-bottom: 10px;
}

.modal-input-qty:focus,
.adjust-qty-input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(107, 124, 80, 0.15);
}

/* ── button rows ── */
.modal-buttons,
.adjust-qty-buttons,
.confirm-buttons {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	padding-top: 8px;
}

/* ── shared button base ── */
.modal-btn,
.adjust-qty-btn,
.confirm-btn {
	padding: 11px 28px;
	border: none;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.2s;
	letter-spacing: 0.2px;
}

.modal-btn:hover,
.adjust-qty-btn:hover,
.confirm-btn:hover {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.modal-btn:active,
.adjust-qty-btn:active,
.confirm-btn:active {
	transform: translateY(0);
}

/* cancel = grey */
.modal-btn-cancel,
.adjust-qty-btn-cancel,
.confirm-btn-no {
	background: var(--surface-alt);
	color: var(--text-muted);
}

.modal-btn-cancel:hover,
.adjust-qty-btn-cancel:hover,
.confirm-btn-no:hover {
	background: var(--surface-alt);
}

/* confirm = green */
.modal-btn-add,
.adjust-qty-btn-update {
	background: linear-gradient(
		135deg,
		var(--accent-dark),
		var(--accent-light)
	);
	color: var(--surface);
}

/* danger = red */
.confirm-btn-yes {
	background: linear-gradient(135deg, var(--danger), var(--danger));
	color: var(--surface);
}

/* disabled state */
.modal-btn:disabled {
	background: gray;
	cursor: not-allowed;
	opacity: 0.6;
}

.modal-btn:disabled:hover {
	transform: none;
	box-shadow: none;
}

/* ── confirm message ── */
.confirm-message {
	margin-bottom: 24px;
	font-size: 15px;
	color: var(--text);
	line-height: 1.6;
}

/* ── adjust-qty item label ── */
.adjust-qty-info {
	font-size: 14px;
	color: var(--text-muted);
	background: var(--surface-alt);
	padding: 10px 14px;
	border-radius: 8px;
	border: 1px solid var(--border);
}

/* Dropdown list items (used by toggle search dropdown) */
.customer-dropdown-item {
	padding: 11px 14px;
	cursor: pointer;
	border-bottom: 1px solid var(--surface-alt);
	transition: background 0.15s;
	display: flex;
	align-items: center;
	gap: 10px;
}
.customer-dropdown-item:last-child {
	border-bottom: none;
}
.customer-dropdown-item:hover {
	background: var(--surface-alt);
}

.cdi-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--accent), var(--accent-light));
	color: var(--surface);
	font-weight: 800;
	font-size: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.cdi-details {
	flex: 1;
	min-width: 0;
}
.cdi-name {
	font-weight: 700;
	font-size: 14px;
	color: var(--text);
}
.cdi-meta {
	font-size: 11px;
	color: var(--text-muted);
	margin-top: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cdi-badge {
	font-size: 10px;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 10px;
	white-space: nowrap;
	flex-shrink: 0;
}
.cdi-badge-cash {
	background: var(--surface-alt);
	color: var(--text-muted);
}
.cdi-badge-rssb {
	background: var(--surface-alt);
	color: var(--warning);
}
.cdi-badge-mmi {
	background: var(--surface-alt);
	color: var(--accent);
}
.cdi-badge-sanlam {
	background: var(--surface-alt);
	color: var(--primary);
}
.cdi-badge-uap {
	background: var(--surface-alt);
	color: var(--danger);
}
.customer-dropdown-empty {
	padding: 18px 16px;
	text-align: center;
	color: var(--text-muted);
	font-size: 13px;
}

/* =============================================
   CUSTOMER INFO BAR
   ============================================= */
.customer-info-bar {
	background: linear-gradient(
		135deg,
		var(--surface-alt) 0%,
		var(--surface-alt) 100%
	);
	border-bottom: 2px solid var(--accent-light);
	padding: 10px 30px;
}
.customer-info-inner {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 12px;
	font-size: 13px;
	color: var(--text);
}
.cib-icon {
	font-size: 15px;
}
.cib-label {
	font-weight: 700;
	color: var(--accent-dark);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}
.cib-name {
	font-weight: 800;
	font-size: 15px;
	color: var(--accent-dark);
}
.cib-value {
	font-weight: 600;
	color: var(--text);
}
.cib-sep {
	color: var(--text-muted);
	font-weight: 300;
}

/* =============================================
   CLIENT SEARCH DROPDOWN MODAL
   ============================================= */
.client-search-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(4px);
	z-index: 1100;
	justify-content: center;
	align-items: flex-start;
	padding-top: 80px;
	animation: fadeIn 0.2s ease;
}
.client-search-overlay.active {
	display: flex;
}

.client-search-card {
	background: var(--surface);
	border-radius: 10px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
	width: 90%;
	max-width: 560px;
	overflow: hidden;
	animation: slideUp 0.25s ease;
	border: 2px solid var(--accent-light);
}

.csd-header {
	background: linear-gradient(
		135deg,
		var(--accent-dark) 0%,
		var(--accent-light) 100%
	);
	padding: 18px 22px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	color: var(--surface);
	font-size: 16px;
	font-weight: 700;
}

.csd-close {
	background: rgba(255, 255, 255, 0.2);
	border: none;
	color: var(--surface);
	width: 32px;
	height: 32px;
	border-radius: 50%;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
	font-family: inherit;
}
.csd-close:hover {
	background: rgba(255, 255, 255, 0.35);
}

.csd-body {
	padding: 18px;
	background: var(--surface-alt);
}

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

.csd-list {
	background: var(--surface);
	border-radius: 10px;
	border: 1.5px solid var(--surface-alt);
	max-height: 300px;
	overflow-y: auto;
	margin-bottom: 14px;
}
.csd-list::-webkit-scrollbar {
	width: 6px;
}
.csd-list::-webkit-scrollbar-thumb {
	background: var(--accent-light);
	border-radius: 6px;
}

.cdd-not-found {
	padding: 32px 20px;
	text-align: center;
}
.cdd-nf-icon {
	font-size: 32px;
	margin-bottom: 8px;
}
.cdd-nf-title {
	font-size: 15px;
	font-weight: 700;
	color: var(--text-muted);
	margin-bottom: 6px;
}
.cdd-nf-sub {
	font-size: 13px;
	color: var(--text-muted);
}

.csd-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--surface-alt);
	border-radius: 10px;
	padding: 11px 16px;
	gap: 12px;
}
.csd-footer-hint {
	font-size: 13px;
	color: var(--text-muted);
}
.csd-add-btn {
	background: linear-gradient(
		135deg,
		var(--accent-dark),
		var(--accent-light)
	);
	color: var(--surface);
	border: none;
	padding: 9px 20px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.2s;
	white-space: nowrap;
}
.csd-add-btn:hover {
	box-shadow: 0 5px 14px rgba(90, 107, 66, 0.3);
}

/* =============================================
   CHECKOUT STEPS BAR
   ============================================= */
.checkout-steps {
	display: flex;
	align-items: center;
	padding: 8px 30px 7px;
	background: linear-gradient(
		135deg,
		var(--surface-alt) 0%,
		var(--surface-alt) 100%
	);
	border-bottom: 2px solid var(--accent-dark);
	gap: 0;
}

.step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	cursor: default;
	min-width: 54px;
	position: relative;
}

.step-circle {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 800;
	transition: all 0.3s;
	position: relative;
	z-index: 1;
}

.step-label {
	font-size: 9px;
	font-weight: 700;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	line-height: 1.25;
	transition: color 0.3s;
}

/* Active step */
.step.step-active .step-circle {
	background: linear-gradient(
		135deg,
		var(--accent-dark),
		var(--accent-light)
	);
	color: var(--surface);
	box-shadow: 0 0 0 3px rgba(107, 124, 80, 0.25);
}
.step.step-active .step-label {
	color: var(--accent-dark);
}

/* Done step */
.step.step-done .step-circle {
	background: var(--accent-light);
	color: transparent;
	font-size: 0;
}
.step.step-done .step-circle::after {
	content: "✓";
	position: absolute;
	font-size: 12px;
	color: var(--surface);
	font-weight: 800;
}
.step.step-done .step-label {
	color: var(--accent-dark);
}

/* Locked step */
.step.step-locked .step-circle {
	background: var(--border);
	color: var(--text-muted);
}
.step.step-locked .step-label {
	color: var(--text-muted);
}

/* Connectors */
.step-connector {
	flex: 1;
	height: 2px;
	background: var(--border);
	border-radius: 2px;
	margin-bottom: 16px;
	transition: background 0.3s;
}
.step-connector.conn-done {
	background: linear-gradient(
		90deg,
		var(--accent-light),
		var(--accent-light)
	);
}

/* ── STEP HINT BAR ── */
.step-hint-bar {
	background: linear-gradient(
		135deg,
		var(--surface-alt) 0%,
		var(--surface-alt) 100%
	);
	border-bottom: 2px solid var(--warning);
	padding: 6px 30px;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--warning);
	font-weight: 600;
}
.shb-icon {
	font-size: 14px;
}

/* ── CHANGE CLIENT BUTTON — kept for legacy compat ── */

/* ── CLIENT TOGGLE SECTION ── */
.payment-toggle-section {
	background-color: var(--accent);
	border: 3px solid var(--text-muted);
	border-top: none;
	border-radius: 0 0 10px 10px;
	padding: 10px 18px 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cts-top-row {
	display: flex;
	align-items: center;
	gap: 10px;
}

/* ── CLIENT SECTION LABEL ── */
.cts-label {
	color: rgba(255, 255, 255, 0.85);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
}

/* ── INLINE CLIENT SEARCH (fills section width) ── */
.client-search-dropdown {
	width: 100%;
}

.csd-inner {
	background: var(--surface);
	border-radius: 10px;
	overflow: hidden;
	border: 1.5px solid var(--accent-light);
}

.csd-body {
	padding: 10px;
	background: var(--surface-alt);
}

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

/* Filter chips */
.csd-chips {
	display: flex;
	gap: 5px;
	flex-wrap: wrap;
	margin-bottom: 8px;
}
.csd-chip {
	padding: 3px 10px;
	border-radius: 10px;
	border: 1.5px solid var(--border);
	background: var(--surface);
	font-size: 10px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.15s;
	color: var(--text-muted);
}
.csd-chip:hover {
	border-color: var(--accent-light);
	color: var(--accent-dark);
}
.csd-chip.active {
	border-color: transparent;
	color: var(--surface);
}
.csd-chip-all.active {
	background: var(--accent-dark);
}
.csd-chip-cash.active {
	background: var(--text-muted);
}
.csd-chip-rssb.active {
	background: var(--warning);
}
.csd-chip-mmi.active {
	background: var(--success);
}
.csd-chip-sanlam.active {
	background: var(--primary);
}
.csd-chip-uap.active {
	background: var(--danger);
}

/* Results list — fixed height so layout doesn't shift */
.csd-list {
	background: var(--surface);
	border-radius: 8px;
	border: 1.5px solid var(--surface-alt);
	height: 160px; /* fixed height */
	overflow-y: auto;
	margin-bottom: 8px;
}
.csd-list::-webkit-scrollbar {
	width: 4px;
}
.csd-list::-webkit-scrollbar-thumb {
	background: var(--accent-light);
	border-radius: 4px;
}

.cdd-empty {
	padding: 20px 14px;
	text-align: center;
}
.cdd-empty-icon {
	font-size: 22px;
	margin-bottom: 4px;
}
.cdd-empty-title {
	font-size: 12px;
	font-weight: 700;
	color: var(--text-muted);
	margin-bottom: 3px;
}
.cdd-empty-sub {
	font-size: 11px;
	color: var(--text-muted);
}

/* Footer */
.csd-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--surface-alt);
	border-radius: 6px;
	padding: 7px 10px;
	gap: 8px;
}
.csd-footer-hint {
	font-size: 11px;
	color: var(--text-muted);
}
.csd-add-btn {
	background: linear-gradient(
		135deg,
		var(--accent-dark),
		var(--accent-light)
	);
	color: var(--surface);
	border: none;
	padding: 6px 14px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.2s;
	white-space: nowrap;
}
.csd-add-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 3px 8px rgba(90, 107, 66, 0.3);
}

/* ── SELECTED CLIENT CARD ── */
.selected-client-card {
	background: var(--surface);
	border-radius: 10px;
	border: 1.5px solid var(--accent-light);
	overflow: hidden;
}

.scc-top {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	background: var(--surface-alt);
	border-bottom: 1px solid var(--accent-light);
	border-radius: 10px 10px 0 0;
}

.scc-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: linear-gradient(
		135deg,
		var(--accent-dark),
		var(--accent-light)
	);
	color: var(--surface);
	font-size: 13px;
	font-weight: 800;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.scc-details {
	flex: 1;
	min-width: 0;
}
.scc-name {
	font-size: 14px;
	font-weight: 800;
	color: var(--accent-dark);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.scc-meta {
	font-size: 11px;
	color: var(--text-muted);
	margin-top: 1px;
}

.scc-change-btn {
	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: 10px;
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.2s;
	white-space: nowrap;
}
.scc-change-btn:hover {
	background: rgba(90, 107, 66, 0.25);
}

.scc-fields {
	display: flex;
	gap: 0;
	padding: 8px 12px;
	background: var(--surface-alt);
	border-radius: 0;
}

.scc-notes-panel {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 8px 12px 10px;
	background: var(--surface-alt);
	border-top: 1px solid var(--accent-light);
	border-radius: 0;
}

.scc-notes-val {
	font-size: 12px;
	line-height: 1.4;
	color: var(--text);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.scc-field {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding-right: 10px;
	border-right: 1px solid var(--accent-light);
}
.scc-field:last-child {
	border-right: none;
	padding-right: 0;
}

.scc-field-label {
	font-size: 9px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: var(--accent-dark);
}
.scc-field-val {
	font-size: 12px;
	font-weight: 600;
	color: var(--text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── PAYMENT MISMATCH WARNING ── */
.scc-mismatch {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 9px 12px;
	background: var(--surface-alt);
	border-top: 1.5px solid var(--warning);
	border-radius: 0 0 10px 10px;
}

.scc-mismatch-icon {
	font-size: 16px;
	flex-shrink: 0;
	margin-top: 1px;
}

.scc-mismatch-body {
	flex: 1;
}

.scc-mismatch-msg {
	font-size: 12px;
	color: var(--warning);
	line-height: 1.4;
	margin-bottom: 7px;
}
.scc-mismatch-msg strong {
	color: var(--warning);
}

.scc-mismatch-actions {
	display: flex;
	gap: 6px;
}

.scc-mismatch-btn {
	padding: 5px 12px;
	border-radius: 10px;
	border: none;
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.18s;
}

.scc-btn-switch {
	background: linear-gradient(
		135deg,
		var(--accent-dark),
		var(--accent-light)
	);
	color: var(--surface);
}
.scc-btn-switch:hover {
	transform: translateY(-1px);
	box-shadow: 0 3px 8px rgba(90, 107, 66, 0.3);
}

.scc-btn-keep {
	background: var(--surface-alt);
	color: var(--text-muted);
}
.scc-btn-keep:hover {
	background: var(--surface-alt);
}

/* Remove old overlay/absolute dropdown styles */
.client-search-overlay {
	display: none !important;
}
.csd-arrow {
	display: none;
}

/* ── CLIENT SECTION LABEL ── */
.cts-label {
	color: rgba(255, 255, 255, 0.85);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	margin-bottom: 2px;
}

.client-search-dropdown {
	width: 100%;
}

.csd-collapse-btn {
	margin-left: auto;
	border: none;
	background: rgba(255, 255, 255, 0.18);
	color: var(--surface);
	padding: 5px 10px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	cursor: pointer;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	transition: background 0.2s ease;
}

.csd-collapse-btn:hover {
	background: rgba(255, 255, 255, 0.28);
}

.csd-collapse-label {
	white-space: nowrap;
}

.client-search-dropdown.collapsed .csd-inner {
	display: none;
}

/* ── PRINT ROW (print + new sale + analyse) ── */
.print-row {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	flex-wrap: nowrap;
	width: 100%;
	margin-bottom: 1.25rem;
}

.print-row > * {
	flex: 1 1 0;
	min-width: 0;
}

.print-row .print-btn,
.print-row .new-sale-btn,
.print-row .analysis-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 8px 16px;
	font-size: 13px;
}

.print-row:not(.has-client) .print-btn,
.print-row:not(.has-client) #analyseCartBtn {
	flex: 1 1 0;
}

.print-row.has-client .print-btn,
.print-row.has-client #analyseCartBtn,
.print-row.has-client .new-sale-btn {
	flex: 1 1 0;
}

/* ── NEW SALE BUTTON ── */
.new-sale-btn {
	background: var(--accent-light);
	color: #ffffff;
	border: none;
	border-radius: 999px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	transition: all 0.25s ease;
	white-space: nowrap;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}
.new-sale-btn:hover {
	background-color: var(--accent-dark);
}

.modal-btn-confirm {
	background-color: #071227;
	color: #ffffff;
}
.modal-btn-confirm:hover {
	opacity: 95%;
}

/* ── INLINE QTY EDIT ── */
.qty-inline-input {
	width: 100%;
	border: 2px solid var(--accent);
	border-radius: 6px;
	padding: 4px 6px;
	font-size: 13px;
	font-family: inherit;
	font-weight: 700;
	text-align: center;
	background: var(--surface);
	color: var(--text);
	outline: none;
	box-shadow: 0 0 0 3px rgba(107, 124, 80, 0.2);
	appearance: textfield;
	-moz-appearance: textfield;
}
.qty-inline-input::-webkit-outer-spin-button,
.qty-inline-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ── DOCTOR FIELD (inside selected client card) ── */
.scc-doctor-column {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 8px;
	padding: 8px 12px;
	background: var(--surface-alt);
	border-top: 1px solid var(--accent-light);
	border-radius: 0;
}

.scc-doctor-label {
	font-size: 11px;
	font-weight: 700;
	color: var(--accent-dark);
	white-space: nowrap;
	flex-shrink: 0;
}

.scc-doctor-optional {
	font-weight: 400;
	color: var(--text-muted);
	font-size: 10px;
}

.scc-doctor-input {
	flex: 1;
	border: 1.5px solid var(--accent-light);
	border-radius: 8px;
	padding: 6px 10px;
	font-size: 12px;
	font-family: inherit;
	background: var(--surface);
	color: var(--text);
	outline: none;
	transition:
		border-color 0.2s,
		box-shadow 0.2s;
}
.scc-doctor-input:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 2px rgba(107, 124, 80, 0.15);
}
.scc-doctor-input::placeholder {
	color: var(--text-muted);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
	.modal-content.wide {
		max-width: 92%;
	}

	.container {
		padding-top: 3.5rem;
	}

	.details-grid {
		grid-template-columns: 1fr;
	}
	.main-content {
		width: 100%;
		max-width: 100%;
		grid-template-columns: 1fr;
		grid-template-rows: auto auto auto;
	}
	.left-section,
	.center-section,
	.right-section {
		width: 100%;
		max-width: 100%;
		min-width: 0;
	}
	.left-section {
		order: 2;
	}
	.center-section {
		order: 1;
		align-self: stretch;
		margin-top: 0;
	}
	.selected-client-card {
		width: 100%;
		max-width: 100%;
		min-width: 0;
		overflow: hidden;
	}
	.scc-top {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}
	.scc-details {
		width: 100%;
		min-width: 0;
	}
	.scc-name {
		font-size: 12px;
		white-space: normal;
		line-height: 1.3;
	}
	.scc-meta {
		font-size: 10px;
	}
	.scc-change-btn {
		align-self: stretch;
		width: 100%;
		justify-content: center;
		padding: 6px 10px;
		font-size: 10px;
	}
	.scc-fields {
		flex-direction: column;
		gap: 8px;
		padding: 8px 10px;
	}
	.scc-field {
		padding-right: 0;
		padding-bottom: 8px;
		border-right: none;
		border-bottom: 1px solid var(--accent-light);
	}
	.scc-field:last-child {
		padding-bottom: 0;
		border-bottom: none;
	}
	.scc-field-label {
		font-size: 8px;
	}
	.scc-field-val {
		font-size: 11px;
		white-space: normal;
		line-height: 1.35;
	}
	.scc-notes-panel {
		padding: 8px 10px 10px;
	}
	.scc-notes-val {
		font-size: 11px;
	}
	.scc-doctor-column {
		grid-template-columns: 1fr;
		gap: 6px;
		padding: 8px 10px;
	}
	.scc-doctor-label {
		font-size: 10px;
		white-space: normal;
		line-height: 1.3;
	}
	.scc-doctor-input {
		font-size: 11px;
		padding: 7px 8px;
	}
	.scc-mismatch {
		padding: 8px 10px;
		gap: 6px;
	}
	.scc-mismatch-icon {
		font-size: 14px;
	}
	.scc-mismatch-msg {
		font-size: 11px;
	}
	.scc-mismatch-actions {
		flex-direction: column;
		align-items: stretch;
	}
	.scc-mismatch-btn {
		width: 100%;
		padding: 7px 10px;
		font-size: 10px;
	}
	.payment-methods {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: center;
	}
	.payment-btn {
		flex: 1;
		min-width: 120px;
	}
	.right-section {
		order: 3;
		width: 100%;
		max-width: 100%;
		min-width: 0;
	}
	.cart-actions {
		width: 100%;
		max-width: 100%;
		flex-wrap: wrap;
		justify-content: stretch;
	}
	.cart-actions > * {
		flex: 1 1 calc(50% - 8px);
		min-width: 0;
	}
	.admin-status-wrap {
		position: static;
	}
	.admin-status-popover {
		position: fixed;
		left: 50%;
		top: 50%;
		right: auto;
		transform: translate(-50%, -50%);
		width: min(92vw, 360px);
		max-height: 70vh;
		z-index: 2000;
	}
	.header h1 {
		font-size: 20px;
	}
	.drug-list {
		min-height: 0;
		height: 300px;
		max-height: 300px;
	}
	.invoice-area {
		padding: 6px;
	}
	.invoice-table-scroll {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 4px;
		display: grid;
		grid-template-columns: minmax(420px, max-content);
	}
	.invoice-header,
	#cartItems {
		min-width: 0;
		width: 100%;
		display: grid;
		grid-template-columns: 2fr 1fr 1fr 1fr;
		gap: 6px;
	}
	.invoice-header {
		margin-bottom: 6px;
	}
	.invoice-col,
	.cart-cell {
		padding: 8px 6px;
		font-size: 11px;
		min-width: 0;
	}
	.total-section {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		margin-top: 6px;
		align-items: stretch;
		min-width: 0;
		width: 100%;
		max-width: 100%;
	}
	.total-label,
	.total-value {
		padding: 10px 8px;
		font-size: 13px;
	}
	.total-label {
		grid-column: 1 / 2;
		text-align: left;
	}
	.total-value {
		grid-column: 2 / 3;
		white-space: nowrap;
	}
	.bottom-actions {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}
	.action-box,
	.reconciliation-btn {
		font-size: 12px;
		padding: 10px 8px;
		white-space: normal;
		line-height: 1.3;
	}
	.print-row {
		display: grid;
		grid-template-columns: 1fr;
		gap: 8px;
	}
	.print-row > * {
		width: 100%;
		min-width: 0;
	}
	.print-btn,
	.new-sale-btn,
	.analysis-btn {
		width: 100%;
		margin-left: 0;
		padding: 10px 12px;
		font-size: 12px;
	}
	.payment-toggle-section {
		flex-wrap: wrap;
		padding: 8px 10px 10px;
		gap: 8px;
	}
	.cts-top-row {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
	}
	.toggle-search-wrapper {
		max-width: 100%;
	}
	.toggle-buttons-group {
		width: 100%;
		justify-content: space-between;
		gap: 8px;
	}
	.cts-top-row .toggle-btn {
		flex: 1 1 0;
		padding: 8px 10px;
		font-size: 11px;
		border-radius: 10px;
	}
	.csd-collapse-btn {
		margin-left: 0;
		align-self: flex-end;
	}
	#ctsLabel,
	.cts-label {
		display: none;
	}
	.ins-add-fields {
		grid-template-columns: 1fr;
	}

	#itemModal .modal-header-row {
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
	}

	#itemModal .modal-header-item {
		width: 100%;
	}

	#itemModal .modal-header-stock {
		align-self: flex-start;
	}

	#medicineDetailPrescribedWrap {
		margin-top: 8px !important;
		margin-left: 12px !important;
		margin-right: 12px !important;
	}

	#medicineDetailPrescribedWrap > label {
		flex-direction: column !important;
		align-items: flex-start !important;
		gap: 6px !important;
	}

	#medicineDetailPrescribedWrap > label > span:last-child {
		display: block;
		line-height: 1.35;
	}

	#insuranceModal .modal-content {
		max-height: 86vh;
		overflow: hidden;
	}

	#insuranceModal .modal-body {
		max-height: calc(86vh - 54px);
		overflow-y: auto;
		padding: 12px 12px 10px;
	}

	.ins-provider-list {
		max-height: 150px;
		padding: 6px;
		margin-bottom: 12px;
	}

	.ins-provider-row {
		grid-template-columns: 1.2fr 0.7fr 0.8fr;
		gap: 6px;
		padding: 10px 10px;
	}

	.ins-modal-add-section {
		padding: 10px 12px;
		gap: 10px;
	}

	.ins-add-fields {
		gap: 10px;
	}

	.modal-buttons {
		padding-top: 6px;
	}
}
