nav.navbar:hover {
	box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

button.button1:hover {
	box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19);
}

/* Renamed from .card to .dashboard-card so it doesn't clash with Bootstrap 5's
 * built-in `.card` component (which we now use throughout the app). */
div.dashboard-card {
	width: 100%;
	box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
	text-align: center;
}

div.cardHeader {
	background-color: #4CAF50;
	color: white;
	padding: 10px;
	font-size: 40px;
}

div.cardContainer {
	padding: 10px;
}


.div-hide {
	display: none;
}

.kv-file-zoom {
	display: none;
}

div.kv-avatar div.file-input div.file-preview {
	width: 200px;
}

/*login form*/
.vertical {
	padding-top: 150px;
	padding-bottom: 150px;
}

/* ============================================================
 * Product modals (Add / Edit / Restock)
 * Scoped under .product-modal so other modals are unaffected.
 * Uses Bootstrap CSS variables (var(--bs-*)) so dark mode works
 * automatically via [data-bs-theme="dark"].
 * ============================================================ */

/* Fix: when a <form> wraps modal-header/body/footer, Bootstrap 5's
 * `.modal-dialog-scrollable` no longer works because the flex chain
 * from .modal-content -> .modal-body is broken by the form. Restore
 * it by making the form itself a flex column that fills the content
 * and letting the modal-body flex-grow + scroll. */
.modal-dialog-scrollable .product-modal > form {
	display: flex;
	flex-direction: column;
	min-height: 0;
	max-height: 100%;
	flex: 1 1 auto;
}
.modal-dialog-scrollable .product-modal > form > .modal-body {
	overflow-y: auto;
	min-height: 0;
	flex: 1 1 auto;
}
/* When the tabbed Edit modal has two forms inside .tab-content inside
 * the modal-body, the body itself is the scroll host; the forms don't
 * need to be flex columns. */

.product-modal .modal-section {
	display: block;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--bs-secondary-color, #6c757d);
	margin: 0 0 0.6rem 0;
	padding-bottom: 0.35rem;
	border-bottom: 1px solid var(--bs-border-color);
}

.product-modal .modal-section:not(:first-child) {
	margin-top: 1.25rem;
}

.product-modal .required-mark {
	color: var(--bs-danger);
	margin-left: 2px;
}

/* Centered avatar frame for the photo picker. Gives the whole picker a
 * soft card around it so the image + Krajee's Browse/Remove buttons +
 * our Take Photo button read as one component instead of three floating
 * pieces. */
.product-modal .photo-frame {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.6rem;
	padding: 0.9rem;
	border: 1px dashed var(--bs-border-color);
	border-radius: 0.5rem;
	background: var(--bs-tertiary-bg, rgba(0, 0, 0, 0.02));
}
.product-modal .photo-frame .kv-avatar {
	width: 220px;
	max-width: 100%;
}
/* Krajee's preview thumbnail should sit as a square inside the frame. */
.product-modal .photo-frame .kv-avatar .file-preview-frame,
.product-modal .photo-frame .kv-avatar .file-preview {
	width: 100% !important;
	max-width: 220px;
	margin: 0 auto;
}
.product-modal .photo-frame .kv-avatar .file-preview {
	border-radius: 0.5rem;
	overflow: hidden;
	background: var(--bs-body-bg);
}
.product-modal .photo-frame .kv-avatar .kv-preview-data,
.product-modal .photo-frame .kv-avatar .file-preview-frame img {
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
}
/* Krajee's default preview (no file chosen) - crop the placeholder to a
 * clean square so it doesn't look oversized. */
.product-modal .photo-frame .kv-avatar .file-default-preview img {
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}
/* Button strip: Krajee's Browse + Remove, plus our Take Photo, all on one
 * row so the user sees every action in one place. */
.product-modal .photo-frame .kv-avatar .file-input {
	width: 100%;
}
.product-modal .photo-frame .kv-avatar .file-input .input-group,
.product-modal .photo-frame .kv-avatar .file-input .file-caption-main {
	width: 100%;
	justify-content: center;
}
.product-modal .photo-frame .photo-hint {
	font-size: 0.78rem;
	color: var(--bs-secondary-color, #6c757d);
	text-align: center;
	line-height: 1.35;
}
.product-modal .photo-frame .photo-actions {
	display: flex;
	gap: 0.4rem;
	flex-wrap: wrap;
	justify-content: center;
	width: 100%;
}

/* Status segmented toggle. We keep BS5 .btn-check semantics where possible,
 * but our buttons are plain (driven by data-status-value), so we paint the
 * "active" state ourselves. */
.product-modal .status-toggle .btn.active {
	box-shadow: inset 0 0 0 2px currentColor;
	font-weight: 600;
}

/* Profit-preview banner. */
.product-modal .profit-banner {
	margin: 0;
	padding: 0.5rem 0.75rem;
	border-radius: 0.4rem;
	background: var(--bs-info-bg-subtle, #cff4fc);
	color: var(--bs-info-text-emphasis, #055160);
	font-size: 0.85rem;
}
.product-modal .profit-banner.is-loss {
	background: var(--bs-danger-bg-subtle, #f8d7da);
	color: var(--bs-danger-text-emphasis, #842029);
}

/* Quick-add inline form (collapse) under brand/category. */
.product-modal .quick-add-panel {
	margin-top: 0.5rem;
	padding: 0.6rem;
	border: 1px dashed var(--bs-border-color);
	border-radius: 0.4rem;
	background: var(--bs-tertiary-bg, rgba(0,0,0,0.03));
}

/* Select2 inside Bootstrap modals: the dropdown must have height that
 * matches form-control / form-select for input-group alignment. */
.product-modal .select2-container--bootstrap-5 .select2-selection {
	min-height: calc(1.5em + 0.75rem + 2px);
}
/* When the +Add button is the input-group sibling of a Select2-enhanced
 * select, Select2 wraps the original select in a span, breaking the BS5
 * input-group rounded corners. Fix that. */
.product-modal .input-group > .select2-container--bootstrap-5 {
	flex: 1 1 auto;
	width: auto !important;
}
.product-modal .input-group > .select2-container--bootstrap-5 .select2-selection {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

/* Restock summary card uses bg-body-tertiary which BS5 already wires to
 * the right token in both themes; nothing to override. */

/* Camera modal: style the existing capture flow like a proper camera UI. */
.camera-modal-shell {
	--ims-camera-accent: #f4f7fb;
	--ims-camera-accent-soft: rgba(255, 255, 255, 0.72);
	--ims-camera-panel: rgba(15, 20, 27, 0.78);
	--ims-camera-panel-strong: rgba(10, 14, 20, 0.94);
	--ims-camera-line: rgba(255, 255, 255, 0.22);
	--ims-camera-guide: rgba(255, 255, 255, 0.82);
	--ims-camera-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.camera-modal-shell .modal-backdrop,
.camera-modal-shell .modal-dialog {
	--ims-camera-accent: #f4f7fb;
	--ims-camera-accent-soft: rgba(255, 255, 255, 0.72);
	--ims-camera-panel: rgba(15, 20, 27, 0.78);
	--ims-camera-panel-strong: rgba(10, 14, 20, 0.94);
	--ims-camera-line: rgba(255, 255, 255, 0.22);
	--ims-camera-guide: rgba(255, 255, 255, 0.82);
	--ims-camera-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

#cameraCaptureModal .modal-dialog {
	margin: 1rem auto;
}

#cameraCaptureModal .modal-content,
#cameraCaptureModal .camera-modal-content {
	background:
		linear-gradient(180deg, rgba(22, 30, 42, 0.98) 0%, rgba(7, 10, 15, 1) 100%) !important;
	border: 1px solid rgba(255, 255, 255, 0.08) !important;
	border-radius: 1.25rem !important;
	box-shadow: var(--ims-camera-shadow) !important;
	color: #fff !important;
	overflow: hidden !important;
}

#cameraCaptureModal .camera-modal-body,
#cameraCaptureModal .camera-modal-footer,
#cameraCaptureModal .camera-modal-topbar {
	color: #fff;
}

#cameraCaptureModal .camera-stage,
#cameraCaptureModal #cameraLiveWrap,
#cameraCaptureModal #cameraReviewWrap {
	background:
		radial-gradient(circle at top, rgba(255, 255, 255, 0.14), transparent 35%),
		#000 !important;
	border-radius: 1.15rem !important;
}

#cameraCaptureModal #cameraVideoFeed,
#cameraCaptureModal #cameraCapturePreview {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	background: #000 !important;
}

#cameraCaptureModal .camera-chip-btn,
#cameraCaptureModal .camera-secondary-btn,
#cameraCaptureModal .camera-primary-btn,
#cameraCaptureModal .camera-close-btn,
#cameraCaptureModal .camera-device-picker {
	position: relative;
	z-index: 2;
}

.camera-modal-dialog {
	margin: 0 auto;
	max-width: min(1100px, calc(100vw - 1.5rem));
}

.camera-modal-content {
	display: flex;
	flex-direction: column;
	min-height: min(92vh, 900px);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 1.25rem;
	background:
		linear-gradient(180deg, rgba(22, 30, 42, 0.96) 0%, rgba(7, 10, 15, 0.98) 100%);
	box-shadow: var(--ims-camera-shadow);
	overflow: hidden;
}

.camera-modal-topbar {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem 1rem 0.75rem;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent);
}

.camera-topbar-left,
.camera-topbar-center,
.camera-topbar-right {
	display: flex;
	align-items: center;
}

.camera-topbar-center {
	justify-content: center;
	font-size: 0.82rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ims-camera-accent-soft);
}

.camera-topbar-right {
	justify-content: flex-end;
}

.camera-mode-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.45rem 0.8rem;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	font-size: 0.84rem;
	font-weight: 600;
	color: #fff;
	backdrop-filter: blur(10px);
}

.camera-status-dot {
	width: 0.55rem;
	height: 0.55rem;
	margin-right: 0.45rem;
	border-radius: 999px;
	background: #4ade80;
	box-shadow: 0 0 0.7rem rgba(74, 222, 128, 0.7);
}

.camera-close-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.6rem;
	height: 2.6rem;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	font-size: 1.1rem;
	backdrop-filter: blur(10px);
}

.camera-close-btn:hover,
.camera-close-btn:focus {
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
}

.camera-modal-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 0.35rem 1rem 1rem;
}

#camera-capture-messages {
	position: relative;
	z-index: 3;
}

#camera-capture-messages .alert {
	margin-bottom: 0.9rem;
	border: 0;
	border-radius: 0.9rem;
	background: rgba(220, 53, 69, 0.92);
	color: #fff;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

.camera-native-fallback {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
}

.camera-fallback-card {
	width: min(460px, 100%);
	padding: 2rem 1.5rem;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 1.1rem;
	background: rgba(255, 255, 255, 0.05);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.camera-fallback-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 4rem;
	height: 4rem;
	margin-bottom: 1rem;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	font-size: 1.4rem;
}

.camera-fallback-title {
	color: #fff;
}

.camera-stage {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	min-height: 380px;
	border-radius: 1.15rem;
	overflow: hidden;
	background:
		radial-gradient(circle at top, rgba(255, 255, 255, 0.14), transparent 35%),
		#000;
}

#cameraVideoFeed,
#cameraCapturePreview {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 380px;
	max-height: 62vh;
	object-fit: cover;
	background: #000;
}

#cameraVideoFeed {
	cursor: pointer;
}

.camera-stage-chrome {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 18%, transparent 78%, rgba(0, 0, 0, 0.48));
}

.camera-guides {
	position: absolute;
	inset: 12% 10%;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 1.25rem;
}

.camera-guide {
	position: absolute;
	width: 2rem;
	height: 2rem;
	border-color: var(--ims-camera-guide);
	border-style: solid;
}

.camera-guide-top-left {
	top: -1px;
	left: -1px;
	border-width: 3px 0 0 3px;
	border-top-left-radius: 1rem;
}

.camera-guide-top-right {
	top: -1px;
	right: -1px;
	border-width: 3px 3px 0 0;
	border-top-right-radius: 1rem;
}

.camera-guide-bottom-left {
	bottom: -1px;
	left: -1px;
	border-width: 0 0 3px 3px;
	border-bottom-left-radius: 1rem;
}

.camera-guide-bottom-right {
	right: -1px;
	bottom: -1px;
	border-width: 0 3px 3px 0;
	border-bottom-right-radius: 1rem;
}

.camera-focus-ring {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 4.75rem;
	height: 4.75rem;
	border: 2px solid rgba(255, 255, 255, 0.85);
	border-radius: 1.25rem;
	transform: translate(-50%, -50%);
	box-shadow:
		0 0 0 1px rgba(0, 0, 0, 0.18),
		0 0 25px rgba(255, 255, 255, 0.08);
}

.camera-hint-badge,
.camera-review-badge {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.5rem 0.85rem;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 999px;
	background: rgba(12, 17, 24, 0.58);
	font-size: 0.8rem;
	color: rgba(255, 255, 255, 0.9);
	backdrop-filter: blur(10px);
}

.camera-hint-badge {
	bottom: 1.1rem;
}

.camera-stage-chrome-review {
	background:
		linear-gradient(180deg, rgba(0, 0, 0, 0.32), transparent 20%, transparent 74%, rgba(0, 0, 0, 0.52));
}

.camera-review-badge {
	top: 1rem;
}

.camera-modal-footer {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	padding: 0.9rem 1rem 1.1rem;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.16));
}

.camera-control-strip,
.camera-action-row,
.camera-review-actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.camera-control-strip {
	justify-content: space-between;
	flex-wrap: wrap;
}

.camera-chip-btn,
.camera-secondary-btn,
.camera-primary-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 2.85rem;
	padding: 0.7rem 1rem;
	border-radius: 999px;
	font-weight: 600;
	text-decoration: none;
}

.camera-chip-btn,
.camera-secondary-btn {
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: var(--ims-camera-panel);
	color: #fff;
	backdrop-filter: blur(10px);
}

.camera-chip-btn:hover,
.camera-chip-btn:focus,
.camera-secondary-btn:hover,
.camera-secondary-btn:focus {
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
}

.camera-primary-btn {
	border: 1px solid rgba(117, 255, 197, 0.35);
	background: linear-gradient(180deg, rgba(53, 191, 129, 0.98), rgba(28, 158, 100, 0.98));
	color: #fff;
	box-shadow: 0 12px 26px rgba(18, 115, 72, 0.35);
}

.camera-primary-btn:hover,
.camera-primary-btn:focus {
	color: #fff;
	filter: brightness(1.03);
}

.camera-device-picker {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	min-width: min(340px, 100%);
	padding: 0.25rem 0.35rem 0.25rem 0.85rem;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 999px;
	background: var(--ims-camera-panel);
	color: #fff;
	backdrop-filter: blur(10px);
}

.camera-device-picker .form-select {
	min-width: 0;
	border: 0;
	box-shadow: none;
	background-color: transparent;
	color: #fff;
}

.camera-device-picker .form-select:disabled {
	opacity: 0.72;
}

.camera-device-picker .form-select option {
	color: #111;
}

.camera-action-row {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
}

.camera-action-row > *:last-child {
	justify-self: end;
}

.camera-shutter-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 5.4rem;
	height: 5.4rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
}

.camera-shutter-ring {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	border: 4px solid rgba(255, 255, 255, 0.92);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	box-shadow:
		0 0 0 6px rgba(255, 255, 255, 0.08),
		0 20px 34px rgba(0, 0, 0, 0.35);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.camera-shutter-core {
	width: 3.7rem;
	height: 3.7rem;
	border-radius: 50%;
	background: linear-gradient(180deg, #ffffff, #dfe6ef);
	box-shadow: inset 0 -10px 16px rgba(110, 123, 144, 0.18);
}

.camera-shutter-btn:hover .camera-shutter-ring,
.camera-shutter-btn:focus .camera-shutter-ring {
	transform: scale(1.03);
	box-shadow:
		0 0 0 6px rgba(255, 255, 255, 0.11),
		0 24px 40px rgba(0, 0, 0, 0.4);
}

.camera-shutter-btn:active .camera-shutter-ring {
	transform: scale(0.97);
}

.camera-action-spacer {
	width: 3.25rem;
	height: 3.25rem;
}

.camera-review-actions {
	justify-content: center;
	flex-wrap: wrap;
}

@media (max-width: 767.98px) {
	.camera-modal-dialog {
		max-width: 100vw;
	}

	.camera-modal-content {
		min-height: 100vh;
		border-radius: 0;
	}

	.camera-modal-topbar,
	.camera-modal-body,
	.camera-modal-footer {
		padding-left: 0.85rem;
		padding-right: 0.85rem;
	}

	.camera-modal-topbar {
		grid-template-columns: 1fr auto;
		grid-template-areas:
			"left right"
			"center center";
	}

	.camera-topbar-left {
		grid-area: left;
	}

	.camera-topbar-right {
		grid-area: right;
	}

	.camera-topbar-center {
		grid-area: center;
		justify-content: flex-start;
	}

	.camera-stage,
	#cameraVideoFeed,
	#cameraCapturePreview {
		min-height: 50vh;
		max-height: none;
	}

	.camera-guides {
		inset: 14% 8%;
	}

	.camera-device-picker {
		min-width: 100%;
	}

	.camera-action-row {
		grid-template-columns: 1fr auto 1fr;
	}

	.camera-secondary-btn,
	.camera-primary-btn,
	.camera-chip-btn {
		padding-left: 0.9rem;
		padding-right: 0.9rem;
	}
}

/* Bootstrap toast container we inject globally. */
#appToastContainer {
	pointer-events: none;
}
#appToastContainer .toast {
	pointer-events: auto;
}
