/* ================================================================
   POS Page – Sales List + New Sale Modal
   ================================================================ */

/* ===== Sales List Wrapper ===== */
.pos-list-wrapper {
	width: 100%;
	padding: 16px 0 0;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow: visible;
}

.pos-list-toolbar {
	flex: 0 0 auto;
	padding-bottom: 12px;
	position: relative;
	z-index: 20;
	overflow: visible;
}

.pos-table-container {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	border-radius: 4px;
	box-shadow: 0 0 5px rgba(0, 0, 0, 0.08);
	background: #faf9f5;
	position: relative;
	z-index: 1;
}

/* POS page: native select stays for form logic, styled dropdown proxy is visible */
.pos-styled-select-native {
	display: none !important;
}

.pos-styled-select-wrap {
	width: 100%;
	flex: 0 0 auto;
}

.pos-styled-select-btn {
	position: relative;
	display: block;
	width: 100%;
	min-width: 0;
	text-align: left;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding: 1px 1.6rem 1px 5px;
	font-size: 12px !important;
	font-weight: bold !important;
	min-height: 25px;
	height: 25px;
	line-height: 1.2;
	color: #333;
	background-color: #fff;
	border: 1px solid #ccc;
	border-radius: 5px;
	box-shadow: none;
}

.pos-styled-select-btn:hover {
	background-color: #fff;
	color: #333;
	border-color: #ccc;
}

.pos-styled-select-btn:focus {
	outline: none;
	border-color: goldenrod;
	box-shadow: 0 0 3px rgba(218, 165, 32, 0.5);
}

.pos-styled-select-btn.dropdown-toggle::after {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-45%);
}

.pos-styled-select-menu {
	width: max-content;
	min-width: 100%;
	max-width: min(90vw, 900px);
}

.pos-styled-select-menu .dropdown-item {
	overflow: visible;
	text-overflow: clip;
	white-space: nowrap;
}

/* ===== Status Badges ===== */
.pos-badge-paid {
	background-color: #198754;
	color: white;
	padding: 3px 12px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.3px;
}

.pos-badge-unpaid {
	background-color: #ffc107;
	color: #333;
	padding: 3px 12px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.3px;
}

.pos-badge-draft {
	background-color: #6c757d;
	color: white;
	padding: 3px 12px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.3px;
}

.pos-badge-quote {
	background-color: #0d6efd;
	color: white;
	padding: 3px 12px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.3px;
}

/* ===== Action Buttons in Sales Table ===== */
.pos-action-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 10px;
	font-size: 14px;
	border-radius: 4px;
	border: 1px solid #ccc;
	background: white;
	color: #333;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.15s ease;
	line-height: 1;
}

.pos-action-btn:hover {
	background-color: goldenrod;
	border-color: goldenrod;
	color: white;
	text-decoration: none;
}

.pos-action-btn i {
	pointer-events: none;
}

/* ===== Flash message above sales list ===== */
.pos-list-flash {
	border-radius: 4px;
}

/* ===== New Sale Modal ===== */
.pos-sale-dialog {
	max-width: 94vw;
	width: 94vw;
	margin: 2vh auto;
}

.pos-sale-content {
	height: 94vh;
	border: none;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.pos-sale-header {
	background-color: #343a40;
	color: white;
	padding: 10px 20px;
	border-bottom: none;
	flex-shrink: 0;
}

.pos-sale-header .modal-title {
	font-size: 18px;
	font-weight: 500;
}

.pos-sale-header .btn-close-white {
	filter: invert(1) grayscale(100%) brightness(200%);
}

.pos-sale-layout {
	height: calc(94vh - 52px);
}

.pos-sale-form {
	overflow-y: auto;
	background: #f4f4f4e2;
}

.pos-sale-sidebar {
	min-width: 270px;
	max-width: 270px;
	background-color: #343a40;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	overflow-y: auto;
}

/* ===== Stacked Modals z-index ===== */
#newSaleModal {
	z-index: 1060 !important;
}

#addPartModal,
#addLabourModal,
#paymentModal,
#posFinaliseModal {
	z-index: 1075 !important;
}

/* ===== Responsive: small screens ===== */
@media (max-width: 768px) {
	.pos-sale-dialog {
		max-width: 100vw;
		width: 100vw;
		margin: 0;
	}

	.pos-sale-content {
		height: 100vh;
		border-radius: 0;
	}

	.pos-sale-layout {
		flex-direction: column;
		height: calc(100vh - 52px);
	}

	.pos-sale-sidebar {
		min-width: 100%;
		max-width: 100%;
		flex-shrink: 0;
	}

	.pos-sale-form {
		flex: 1 1 auto;
	}

	.pos-list-wrapper {
		padding-top: 12px;
	}
}
