/* Custom CSS for Bootstrap-enhanced Barcode Scanner - Light Theme */
:root {
	/* Primary Colors - Pure White Background */
	--bs-body-bg: #FFFFFF;
	--bs-body-color: #212529;
	
	/* Secondary Elements - Light Neutral Tones */
	--bs-dark: #F8F9FA;
	--bs-secondary: #F5F5F5;
	--bs-tertiary: #F9F9F9;
	
	/* Accent Colors - Subtle Professional Hues (10-20% saturation) */
	--scanning-focus: #2563EB; /* Soft blue - 15% saturation */
	--accent-blue: #E6F2FF; /* Very light blue for backgrounds */
	--accent-green: #E8F5E9; /* Very light green for backgrounds */
	
	/* Status Colors - Accessible Contrast */
	--valid-bg: #D1FAE5; /* Light green background */
	--valid-color: #065F46; /* Dark green text for 4.5:1 contrast */
	--invalid-bg: #FEE2E2; /* Light red background */
	--invalid-color: #991B1B; /* Dark red text for 4.5:1 contrast */
	
	/* Neutral Colors */
	--text-primary: #212529;
	--text-secondary: #495057;
	--text-muted: #6C757D;
	--border-color: #DEE2E6;
	--shadow-subtle: rgba(0, 0, 0, 0.08); /* Subtle shadow */
}

/* Global Styles */
body {
	font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	background: var(--bs-body-bg) !important;
	color: var(--text-primary) !important;
	min-height: 100vh;
	line-height: 1.6;
}

/* ============================================
   PROFESSIONAL TOP NAVIGATION BAR - CLEAN DESIGN
   ============================================ */

.app-navbar-top {
	position: sticky;
	top: 0;
	z-index: 1030;
	background: #FFFFFF;
	border-bottom: 1px solid #E5E7EB;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	padding: 0;
	min-height: 70px;
}

.app-navbar-top .container-fluid {
	padding: 0 2rem;
	max-width: 100%;
}

/* Brand Logo & Text */
.app-navbar-top .navbar-brand {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 0;
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.app-navbar-top .navbar-brand:hover {
	opacity: 0.85;
}

.brand-logo {
	width: 44px;
	height: 44px;
	background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.brand-logo i {
	font-size: 1.5rem;
	color: #FFFFFF;
}

.brand-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.brand-title {
	font-size: 1.25rem;
	font-weight: 700;
	color: #111827;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.brand-tagline {
	font-size: 0.75rem;
	font-weight: 500;
	color: #6B7280;
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* Navigation Links - Clean & Minimal */
.app-navbar-top .navbar-nav {
	align-items: center;
	gap: 4px;
}

.app-navbar-top .nav-item {
	position: relative;
}

.app-navbar-top .nav-link {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 20px !important;
	color: #374151 !important;
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.5;
	border-radius: 8px;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	white-space: nowrap;
	text-decoration: none;
}

.app-navbar-top .nav-link i {
	font-size: 1.125rem;
	color: #6B7280;
	transition: color 0.2s ease;
	width: 20px;
	text-align: center;
	flex-shrink: 0;
}

.app-navbar-top .nav-link span {
	display: inline-block;
}

/* Hover State */
.app-navbar-top .nav-link:hover {
	color: #2563EB !important;
	background-color: #EFF6FF;
}

.app-navbar-top .nav-link:hover i {
	color: #2563EB;
}

/* Active State */
.app-navbar-top .nav-link.active {
	color: #2563EB !important;
	background-color: #DBEAFE;
	font-weight: 600;
}

.app-navbar-top .nav-link.active i {
	color: #2563EB;
}

.app-navbar-top .nav-link.active::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 24px;
	height: 3px;
	background: #2563EB;
	border-radius: 3px 3px 0 0;
}

/* Dropdown Menu - Clean Design */
.app-navbar-top .dropdown-menu {
	background: #FFFFFF;
	border: 1px solid #E5E7EB;
	border-radius: 10px;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
	padding: 8px;
	margin-top: 8px;
	min-width: 220px;
}

.app-navbar-top .dropdown-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	color: #374151 !important;
	font-size: 0.9375rem;
	font-weight: 500;
	border-radius: 6px;
	transition: all 0.2s ease;
	text-decoration: none;
}

.app-navbar-top .dropdown-item i {
	font-size: 1rem;
	color: #6B7280;
	width: 20px;
	text-align: center;
	flex-shrink: 0;
	transition: color 0.2s ease;
}

.app-navbar-top .dropdown-item span {
	display: inline-block;
}

.app-navbar-top .dropdown-item:hover {
	background-color: #F3F4F6;
	color: #2563EB !important;
}

.app-navbar-top .dropdown-item:hover i {
	color: #2563EB;
}

.app-navbar-top .dropdown-item.active {
	background-color: #DBEAFE;
	color: #2563EB !important;
	font-weight: 600;
}

.app-navbar-top .dropdown-item.active i {
	color: #2563EB;
}

/* Dropdown Toggle Arrow */
.app-navbar-top .dropdown-toggle::after {
	margin-left: 6px;
	border-top: 5px solid;
	border-right: 4px solid transparent;
	border-bottom: 0;
	border-left: 4px solid transparent;
	transition: transform 0.2s ease;
	vertical-align: 0.15em;
}

.app-navbar-top .dropdown-toggle[aria-expanded="true"]::after {
	transform: rotate(180deg);
}

/* Mobile Toggle Button */
.app-navbar-top .navbar-toggler {
	border: none;
	padding: 8px 4px;
	width: 32px;
	height: 32px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	background: transparent;
	cursor: pointer;
}

.app-navbar-top .navbar-toggler:focus {
	box-shadow: none;
	outline: none;
}

.app-navbar-top .navbar-toggler span {
	display: block;
	width: 24px;
	height: 2px;
	background-color: #374151;
	border-radius: 2px;
	transition: all 0.3s ease;
}

.app-navbar-top .navbar-toggler:hover span {
	background-color: #2563EB;
}

.app-navbar-top .navbar-toggler[aria-expanded="true"] span:nth-child(1) {
	transform: rotate(45deg) translate(7px, 7px);
}

.app-navbar-top .navbar-toggler[aria-expanded="true"] span:nth-child(2) {
	opacity: 0;
}

.app-navbar-top .navbar-toggler[aria-expanded="true"] span:nth-child(3) {
	transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Menu */
@media (max-width: 991.98px) {
	.app-navbar-top {
		min-height: 64px;
	}
	
	.app-navbar-top .container-fluid {
		padding: 0 1.5rem;
	}
	
	.brand-logo {
		width: 40px;
		height: 40px;
	}
	
	.brand-logo i {
		font-size: 1.25rem;
	}
	
	.brand-title {
		font-size: 1.125rem;
	}
	
	.brand-tagline {
		font-size: 0.6875rem;
	}
	
	.app-navbar-top .navbar-collapse {
		background: #FFFFFF;
		border-top: 1px solid #E5E7EB;
		margin-top: 0;
		padding: 12px 0;
		box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
	}
	
	.app-navbar-top .navbar-nav {
		gap: 4px;
	}
	
	.app-navbar-top .nav-link {
		padding: 12px 16px !important;
		border-radius: 8px;
	}
	
	.app-navbar-top .nav-link.active::after {
		display: none;
	}
	
	.app-navbar-top .dropdown-menu {
		background: #F9FAFB;
		border: none;
		box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
		margin-left: 16px;
		margin-top: 4px;
		padding: 6px;
	}
	
	.brand-tagline {
		display: none;
	}
}

@media (max-width: 575.98px) {
	.app-navbar-top .container-fluid {
		padding: 0 1rem;
	}
	
	.brand-title {
		font-size: 1rem;
	}
	
	.app-navbar-top .nav-link {
		font-size: 0.875rem;
		padding: 10px 14px !important;
	}
}

/* Text color utility override for light theme */
.text-white {
	color: #212529 !important;
}

/* Layout and overflow hygiene to reduce unnecessary scrollbars */
html, body {
	overflow-x: hidden;
}

/* Use clamps so large text/components shrink on smaller viewports and avoid overflow */
#status-text {
	font-size: clamp(28px, 8vw, 72px) !important;
}

/* Make large inputs/selects responsive without relying on fixed inline sizes */
#scan-form .form-control-lg,
#scan-form .form-select-lg,
#corrected-osdi.form-control-lg {
	font-size: clamp(18px, 2.2vw, 28px) !important;
	padding: clamp(10px, 1.2vw, 16px) !important;
}

/* Responsive counter numbers */
#counters .h3 {
	font-size: clamp(18px, 3.4vw, 30px) !important;
}

/* Make main three-column panels adapt their internal scroll so page itself often fits */
@media (min-width: 992px) {
	/* Recent scans list height adapts to viewport to avoid page scroll */
	#history {
		/* Expand to use more vertical space, reducing internal scrollbar */
		max-height: clamp(360px, 60vh, 80vh) !important;
		overflow-y: auto;
	}
	/* Missing serials panels lists height responsive */
	#line1-serials,
	#line2-serials {
		max-height: clamp(180px, 28vh, 320px) !important;
	}
}

/* Consistent spacing - minimum 16px */
@media (max-width: 575.98px) {
	.container-fluid {
		padding-left: 16px !important;
		padding-right: 16px !important;
	}
	.card-body {
		padding: 16px !important;
	}
	.card-header {
		padding: 16px !important;
	}
}

/* Page-specific: Invalid Records — improve readability */
.invalid-page {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	font-size: 16px; /* ensure base size */
	line-height: 1.6;
	font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

.invalid-page body {
	font-size: 16px;
	line-height: 1.6;
}

.invalid-page .navbar-brand {
	letter-spacing: 0.2px;
	font-weight: 700;
}

.invalid-page h1,
.invalid-page h2,
.invalid-page h3,
.invalid-page h4,
.invalid-page h5 {
	letter-spacing: 0.2px;
	line-height: 1.3;
}

.invalid-page .card-title,
.invalid-page .card-text {
	letter-spacing: 0.15px;
}

/* Table readability on light theme - Enhanced */
.invalid-page .table {
	color: var(--text-primary);
	margin-bottom: 0;
	background-color: #FFFFFF;
	font-size: 0.95rem;
}

.invalid-page .table thead th {
	font-weight: 700;
	letter-spacing: 0.3px;
	font-size: 1rem;
	background-color: var(--bs-secondary);
	color: var(--text-primary);
	border-bottom: 2px solid var(--border-color);
	padding: 16px 20px;
	text-transform: uppercase;
	font-size: 0.875rem;
	white-space: nowrap;
}

.invalid-page .table tbody td {
	font-size: 0.95rem;
	line-height: 1.6;
	padding: 16px 20px;
	color: var(--text-primary);
	vertical-align: middle;
	border-bottom: 1px solid var(--border-color);
}

.invalid-page .table tbody td:first-child {
	font-weight: 600;
	color: var(--text-secondary);
}

.invalid-page .table-striped tbody tr:nth-of-type(odd) {
	background-color: var(--bs-tertiary);
}

.invalid-page .table-striped tbody tr:nth-of-type(even) {
	background-color: #FFFFFF;
}

.invalid-page .table-hover tbody tr:hover {
	background-color: var(--accent-blue);
	transition: background-color 0.2s ease;
}

.invalid-page .table-hover tbody tr:hover td {
	color: var(--text-primary);
}

/* Make serial-like columns more scannable */
.invalid-page #line1-records-table-body td:nth-child(2),
.invalid-page #line1-records-table-body td:nth-child(3),
.invalid-page #line1-records-table-body td:nth-child(4),
.invalid-page #line2-records-table-body td:nth-child(2),
.invalid-page #line2-records-table-body td:nth-child(3),
.invalid-page #line2-records-table-body td:nth-child(4) {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-weight: 600;
	letter-spacing: 0.5px;
	font-size: 1rem;
	color: var(--text-primary);
}

/* Scan Time column - ensure black and readable - Maximum specificity */
.invalid-page #line1-records-table-body td:nth-child(5),
.invalid-page #line2-records-table-body td:nth-child(5),
.invalid-page table#line1-records-table-body td:nth-child(5),
.invalid-page table#line2-records-table-body td:nth-child(5),
.invalid-page .table tbody#line1-records-table-body td:nth-child(5),
.invalid-page .table tbody#line2-records-table-body td:nth-child(5),
.invalid-page .scan-time-cell,
.invalid-page td[data-label="Scan Time"],
.invalid-page .scan-time-col {
	color: #000000 !important;
	font-weight: 600 !important;
	font-size: 0.95rem !important;
	line-height: 1.6 !important;
	background-color: transparent !important;
}

.invalid-page #line1-records-table-body td:nth-child(5) *,
.invalid-page #line2-records-table-body td:nth-child(5) *,
.invalid-page .scan-time-cell *,
.invalid-page .scan-time-cell span,
.invalid-page .scan-time-cell small,
.invalid-page td[data-label="Scan Time"] *,
.invalid-page td[data-label="Scan Time"] span,
.invalid-page td[data-label="Scan Time"] small {
	color: #000000 !important;
	font-weight: 600 !important;
	font-size: 0.95rem !important;
}

.invalid-page #line1-records-table-body td:nth-child(5) small,
.invalid-page #line2-records-table-body td:nth-child(5) small,
.invalid-page #line1-records-table-body td:nth-child(5) span,
.invalid-page #line2-records-table-body td:nth-child(5) span,
.invalid-page .scan-time-cell small,
.invalid-page .scan-time-cell span,
.invalid-page td[data-label="Scan Time"] small,
.invalid-page td[data-label="Scan Time"] span {
	color: #000000 !important;
	font-weight: 600 !important;
	font-size: 0.95rem !important;
	opacity: 1 !important;
}

/* Override any text-light or text-muted classes in Scan Time column */
.invalid-page #line1-records-table-body td:nth-child(5).text-light,
.invalid-page #line2-records-table-body td:nth-child(5).text-light,
.invalid-page #line1-records-table-body td:nth-child(5) .text-light,
.invalid-page #line2-records-table-body td:nth-child(5) .text-light,
.invalid-page #line1-records-table-body td:nth-child(5).text-muted,
.invalid-page #line2-records-table-body td:nth-child(5).text-muted,
.invalid-page #line1-records-table-body td:nth-child(5) .text-muted,
.invalid-page #line2-records-table-body td:nth-child(5) .text-muted,
.invalid-page td[data-label="Scan Time"].text-light,
.invalid-page td[data-label="Scan Time"] .text-light,
.invalid-page td[data-label="Scan Time"].text-muted,
.invalid-page td[data-label="Scan Time"] .text-muted {
	color: #000000 !important;
	font-weight: 600 !important;
	opacity: 1 !important;
}

/* Badges and small UI elements slightly larger for legibility */
.invalid-page .badge {
	font-size: 0.875rem;
	font-weight: 700;
	padding: 0.5rem 0.75rem;
	letter-spacing: 0.3px;
}

.invalid-page .btn {
	font-size: 1rem;
	font-weight: 600;
	min-height: 48px;
	padding: 12px 24px;
	letter-spacing: 0.2px;
}

/* Attention badge + subtle blink for unreadable corrections */
.invalid-page .badge-attn {
	background-color: #F59E0B;
	color: #FFFFFF;
	font-weight: 700;
	border: 1px solid rgba(0, 0, 0, 0.15);
	box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
	padding: 0.5rem 0.75rem;
	font-size: 0.875rem;
}

@keyframes blink-soft {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.45; }
}

.invalid-page .blink-warning {
	animation: blink-soft 1.2s ease-in-out infinite;
}

/* Blinking red for uncorrected OSDI (high visibility, restrained blink) */
.invalid-page .osdi-not-corrected {
	background-color: #DC2626 !important; /* bright red */
	color: #FFFFFF !important; /* white text for contrast */
	font-weight: 700;
	border: none;
	box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
	padding: 0.5rem 0.75rem;
	border-radius: 6px;
	font-size: 0.95rem;
	-webkit-animation: blink-red 1s ease-in-out infinite;
	-moz-animation: blink-red 1s ease-in-out infinite;
	animation: blink-red 1s ease-in-out infinite;
	transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

/* Red blinking text-only variant for "Not corrected" */
.invalid-page .text-blink-danger {
	color: #DC2626 !important;
	font-weight: 700;
	font-size: 1rem;
	-webkit-animation: blink-red 1s ease-in-out infinite;
	-moz-animation: blink-red 1s ease-in-out infinite;
	animation: blink-red 1s ease-in-out infinite;
	transition: color 0.25s ease, opacity 0.25s ease;
}

@-webkit-keyframes blink-red {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}
@-moz-keyframes blink-red {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}
@keyframes blink-red {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

/* Pause animation on hover/active/focus/row hover for readability */
.invalid-page td:hover .osdi-not-corrected,
.invalid-page .osdi-not-corrected:hover,
.invalid-page .osdi-not-corrected:focus,
.invalid-page .osdi-not-corrected:active {
	-webkit-animation: none !important;
	-moz-animation: none !important;
	animation: none !important;
	opacity: 1 !important;
}

.invalid-page td:hover .text-blink-danger,
.invalid-page .text-blink-danger:hover,
.invalid-page .text-blink-danger:focus,
.invalid-page .text-blink-danger:active {
	-webkit-animation: none !important;
	-moz-animation: none !important;
	animation: none !important;
	opacity: 1 !important;
}

/* Toolbar - Enhanced for readability */
.invalid-toolbar {
	background: #FFFFFF;
	padding: 24px;
	border-radius: 12px;
	margin-bottom: 24px;
	border: 1px solid var(--border-color);
	box-shadow: 0 2px 8px var(--shadow-subtle);
}

.invalid-toolbar .form-label {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 8px;
}

.invalid-toolbar .form-control,
.invalid-toolbar .form-select {
	font-size: 1rem;
	padding: 12px 16px;
	min-height: 48px;
	border-radius: 8px;
	background-color: #FFFFFF;
	color: var(--text-primary);
	border: 1px solid var(--border-color);
}

.invalid-toolbar .form-control::placeholder {
	color: var(--text-muted);
	font-size: 0.95rem;
}

.invalid-toolbar .form-control:focus,
.invalid-toolbar .form-select:focus {
	border-color: var(--scanning-focus);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
	outline: none;
}

.invalid-toolbar .input-group-text {
	background-color: #FFFFFF;
	border-color: var(--border-color);
	color: var(--text-secondary);
	font-size: 1rem;
	padding: 12px 16px;
}

/* KPI Cards - Enhanced readability */
.card-kpi {
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	border: none !important;
}

.card-kpi:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px var(--shadow-subtle) !important;
}

.card-kpi .display-6,
.card-kpi .display-5,
.card-kpi .h1,
.card-kpi .h2 {
	letter-spacing: 0.3px;
	font-weight: 700;
	line-height: 1.2;
}

.card-kpi .card-body {
	padding: 24px !important;
}

.card-kpi .small {
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.5px;
}

/* Sticky table header */
.table-sticky thead th {
	position: sticky;
	top: 0;
	background-color: var(--bs-secondary);
	z-index: 1;
	border-bottom: 2px solid var(--border-color) !important;
	color: var(--text-primary);
}

/* Mobile responsive table: stack cells */
@media (max-width: 575.98px) {
	.table-sticky thead {
		display: none;
	}
	.table-sticky tbody tr {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 0.5rem 1rem;
		padding: 16px;
		border-bottom: 1px solid var(--border-color);
		background-color: #FFFFFF;
	}
	.table-sticky tbody td {
		display: flex;
		align-items: baseline;
		gap: 0.5rem;
		font-size: 0.95rem;
		padding: 8px 0;
		color: var(--text-primary);
	}
	.table-sticky tbody td::before {
		content: attr(data-label);
		flex: 0 0 120px;
		color: var(--text-secondary);
		font-size: 0.875rem;
		font-weight: 600;
	}
}

/* Additional readability enhancements for invalid-records page */
.invalid-page .card-header {
	background-color: #FFFFFF !important;
	border-bottom: 2px solid var(--border-color) !important;
	padding: 20px !important;
}

.invalid-page .card {
	border-radius: 12px;
	box-shadow: 0 2px 8px var(--shadow-subtle);
	border: 1px solid var(--border-color);
}

.invalid-page .card-body {
	padding: 20px !important;
}

/* Ensure action buttons are readable */
.invalid-page .table tbody td .btn {
	font-size: 0.875rem;
	min-height: 40px;
	padding: 8px 16px;
	font-weight: 600;
}

/* Improve pagination readability */
.invalid-page .pagination .page-link {
	font-size: 0.95rem;
	padding: 10px 16px;
	min-height: 44px;
	color: var(--text-primary);
	font-weight: 500;
}

.invalid-page .pagination .page-item.active .page-link {
	background-color: var(--scanning-focus);
	border-color: var(--scanning-focus);
	color: #FFFFFF;
	font-weight: 600;
}

/* Improve empty state messages */
.invalid-page #no-records .card,
.invalid-page #no-line1-records,
.invalid-page #no-line2-records {
	background-color: #FFFFFF;
	border: 1px solid var(--border-color);
}

.invalid-page #no-records h4,
.invalid-page #no-line1-records h6,
.invalid-page #no-line2-records h6 {
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: 0.3px;
}

.invalid-page #no-records p,
.invalid-page #no-line1-records p,
.invalid-page #no-line2-records p {
	font-size: 1rem;
	line-height: 1.6;
	color: var(--text-secondary);
}

/* Card header tone alignment */
.card-header.bg-dark,
.card-header.bg-white {
	background-color: var(--bs-secondary) !important;
}

/* Enhanced Input Styling for Scanning */
.scanning-input {
	font-family: 'Inter', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
	font-weight: 600 !important;
	letter-spacing: 1px !important;
	transition: all 0.2s ease-in-out;
	background-color: #FFFFFF !important;
	border: 1px solid var(--border-color) !important;
	color: var(--text-primary) !important;
	padding: 16px !important;
	min-height: 48px; /* Touch target */
}

.scanning-input:focus {
	border-color: var(--scanning-focus) !important;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
	outline: none;
}

/* Status Indicator Enhancements */
#status-indicator {
	min-height: clamp(140px, 20vh, 200px);
	transition: all 0.3s ease-in-out;
	background: var(--bs-secondary) !important;
	border: 2px solid var(--border-color) !important;
	border-radius: 8px;
}

#status-indicator.valid {
	background: var(--valid-bg) !important;
	border-color: #10B981 !important;
	animation: pulse-success 0.6s ease-in-out;
}

#status-indicator.invalid {
	background: var(--invalid-bg) !important;
	border-color: #EF4444 !important;
	animation: pulse-error 0.6s ease-in-out;
}

#status-text {
	transition: all 0.3s ease-in-out;
	font-weight: 700;
}

#status-indicator.valid #status-text {
	color: var(--valid-color) !important;
}

#status-indicator.invalid #status-text {
	color: var(--invalid-color) !important;
}

/* Animations */
@keyframes pulse-success {
	0% { transform: scale(1); }
	50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(25, 135, 84, 0.4); }
	100% { transform: scale(1); }
}

@keyframes pulse-error {
	0% { transform: scale(1); }
	50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(220, 53, 69, 0.4); }
	100% { transform: scale(1); }
}

/* Counter Cards Enhancement */
.card {
	transition: all 0.2s ease-in-out;
}

.card:hover {
	transform: translateY(-2px);
}

/* History List Styling */
.history-item {
	transition: all 0.2s ease-in-out;
	border-left: 4px solid transparent !important;
}

.history-item:hover {
	background-color: rgba(255, 255, 255, 0.05) !important;
	border-left-color: var(--bs-primary) !important;
}

.history-item.valid {
	border-left-color: var(--bs-success) !important;
}

.history-item.invalid {
	border-left-color: var(--bs-danger) !important;
}

/* Light theme for Recent Scans list */
#history {
    background-color: #FFFFFF !important;
}

#history .list-group-item,
#history .list-group-item-dark {
    background-color: #FFFFFF !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    padding: 16px;
}

#history .text-muted {
    color: var(--text-muted) !important;
}

#history .sn-text,
#history .text-light {
    color: var(--text-primary) !important;
    font-weight: 600;
}

#history .badge.bg-success,
#history .badge.bg-danger,
#history .badge.bg-info {
    box-shadow: 0 1px 2px var(--shadow-subtle);
}

#history .history-item:hover {
    background-color: var(--accent-blue) !important;
}

/* Serial Number Styling */
.sn-text {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-weight: 600;
	letter-spacing: 0.5px;
}

/* Button Enhancements */
.btn {
	transition: all 0.2s ease-in-out;
	font-weight: 600;
	padding: 12px 24px;
	min-height: 48px;
	min-width: 48px;
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 8px var(--shadow-subtle);
}

.btn-primary {
	background-color: var(--scanning-focus);
	border-color: var(--scanning-focus);
	color: #FFFFFF;
}

.btn-primary:hover {
	background-color: #1D4ED8;
	border-color: #1D4ED8;
	box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Icon Enhancements */
.bi {
	vertical-align: -0.125em;
}

/* Card Header Styling */
.card-header {
	border-bottom: 1px solid var(--border-color) !important;
	background-color: var(--bs-secondary) !important;
	padding: 16px !important;
	color: var(--text-primary) !important;
}

.card {
	background-color: #FFFFFF !important;
	border: 1px solid var(--border-color) !important;
	border-radius: 8px;
	box-shadow: 0 1px 3px var(--shadow-subtle);
	margin-bottom: 16px;
}

.card-body {
	padding: 16px !important;
	color: var(--text-primary) !important;
}

/* Recent Scans toolbar controls */
.card-header .form-select.form-select-sm {
	background-color: #FFFFFF !important;
	color: var(--text-primary) !important;
	border-color: var(--border-color) !important;
	padding: 8px 12px;
	min-height: 40px;
}
.card-header .form-select.form-select-sm:focus {
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
	border-color: var(--scanning-focus) !important;
	outline: none;
}
.card-header .form-label.small.text-muted {
	color: var(--text-muted) !important;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
	#status-text {
		font-size: 48px !important;
	}
	
	.scanning-input {
		font-size: 24px !important;
		padding: 12px !important;
	}
}

@media (max-width: 575.98px) {
	#status-text {
		font-size: 36px !important;
	}
	
	.scanning-input {
		font-size: 20px !important;
		padding: 10px !important;
	}
	
	.container-fluid {
		padding-left: 1rem !important;
		padding-right: 1rem !important;
	}
}

/* Focus Management */
.scanning-input:focus {
	outline: none;
}

/* Loading State */
.loading {
	opacity: 0.7;
	pointer-events: none;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
	.scanning-input {
		border-width: 3px !important;
	}
	
	#status-text {
		text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
	}
}

/* Missing Serial Numbers Styling */
.missing-serials-list {
	border: 1px solid #FCD34D;
	border-radius: 8px;
	background: #FEF3C7;
	padding: 16px;
}

.missing-serials-list:empty::before {
	content: "No missing serials";
	color: var(--text-muted);
	font-style: italic;
	font-size: 0.875rem;
	display: block;
	text-align: center;
	padding: 16px;
}

.missing-serial-item {
	background: #FFFFFF;
	border: 1px solid #FCD34D;
	border-radius: 6px;
	padding: 12px 16px;
	margin-bottom: 8px;
	font-family: 'Inter', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-weight: 600;
	font-size: 0.875rem;
	color: #92400E;
	transition: all 0.2s ease-in-out;
}

.missing-serial-item:hover {
	background: #FEF3C7;
	border-color: #F59E0B;
	transform: translateX(2px);
	box-shadow: 0 1px 3px var(--shadow-subtle);
}

.missing-serial-item:last-child {
	margin-bottom: 0;
}

/* Responsive adjustments for missing serials */
@media (max-width: 991.98px) {
	.missing-serials-list {
		max-height: 150px !important;
	}
	
	.missing-serial-item {
		font-size: 0.8rem;
		padding: 0.25rem 0.5rem;
	}
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
	/* Force critical attention animations to remain active for Not corrected */
	.invalid-page .text-blink-danger,
	.invalid-page .osdi-not-corrected {
		-webkit-animation: blink-red 1s ease-in-out infinite !important;
		-moz-animation: blink-red 1s ease-in-out infinite !important;
		animation: blink-red 1s ease-in-out infinite !important;
		animation-duration: 1s !important;
		animation-iteration-count: infinite !important;
	}
}


/* Sticky footer */
body {
	padding-bottom: 56px; /* prevent overlap with fixed footer */
}

.site-footer {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #FFFFFF;
	border-top: 1px solid var(--border-color);
	color: var(--text-secondary);
	font-size: 0.875rem;
	padding: 16px 0;
	z-index: 1030;
	box-shadow: 0 -2px 8px var(--shadow-subtle);
}

.site-footer a {
	color: var(--text-secondary);
	text-decoration: none;
}

.site-footer a:hover {
	color: var(--scanning-focus);
}


/* A4 Report styling for Defect Details */
.report-a4 {
	background: #ffffff;
	color: #0b0e13;
	max-width: 794px; /* ~ A4 width at 96dpi */
	min-height: 1123px; /* ~ A4 height at 96dpi */
	border: 1px solid #e6eaf2;
	border-radius: 8px;
	box-shadow: 0 12px 30px rgba(0,0,0,0.35);
	padding: 28px;
	font-size: 14px;
}

.report-header .report-title {
	font-size: 22px;
	font-weight: 800;
	letter-spacing: 0.2px;
}

.report-header .report-subtitle {
	font-size: 14px;
	color: #495057;
}

.report-sep {
	margin: 14px 0 18px 0;
}

.report-section {
	margin-bottom: 18px;
}

.section-title {
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-size: 12px;
	color: #6c757d;
	margin-bottom: 8px;
}

.section-body {
	white-space: pre-wrap;
	line-height: 1.6;
}

.kv {
	display: flex;
	gap: 10px;
	align-items: baseline;
}
.kv .k {
	flex: 0 0 120px;
	color: #6c757d;
	font-weight: 600;
}
.kv .v {
	flex: 1;
	font-weight: 600;
}

.attachments-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr); /* 50% width each */
	gap: 10px;
}

.attachments-grid .att-img {
	width: 100%;
	height: 220px;
	object-fit: contain;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	background: #f8f9fa;
}

.attachments-grid .att-file {
	border: 1px dashed #ced4da;
	border-radius: 6px;
	background: #f8f9fa;
	padding: 12px;
	text-decoration: none;
	color: #0b0e13;
	font-weight: 600;
}

@media (max-width: 991.98px) {
	.attachments-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 575.98px) {
	.report-a4 { padding: 16px; }
	.attachments-grid { grid-template-columns: 1fr; }
}

/* Print styles: print only the report content, sized to A4 */
/* Note: Comprehensive defective-meter-form print styles are in the dedicated @media print block below */
@media print {
	/* Hide everything initially - will be overridden by specific rules below */
	body > *:not(#defectViewModal) {
		display: none !important;
		visibility: hidden !important;
	}
	
	.report-a4, .report-a4 *, 
	.defective-meter-form, .defective-meter-form *,
	#defectViewModal, #defectViewModal * {
		visibility: visible !important;
	}
	
	.modal { 
		position: static !important;
		display: block !important;
	}
	
	.modal-dialog { 
		margin: 0 !important; 
		max-width: none !important;
	}
	
	.modal-header, .modal-footer { 
		display: none !important;
	}
	
	.modal-content { 
		border: none !important; 
		box-shadow: none !important; 
		background: white !important;
	}
	
	.modal-body { 
		padding: 0 !important;
	}
	
	.report-a4 { 
		box-shadow: none !important; 
		border: none !important;
	}
	
	.attachments-grid .att-img { 
		height: 260px;
	}
	
	/* Hide interactive elements */
	.btn, .modal-header, .modal-footer {
		display: none !important;
	}
	
	@page { 
		size: A4; 
		margin: 10mm;
	}
}

/* Professional report boxes (A/B/C) */
.report-box {
	display: grid;
	grid-template-columns: 90px 1fr;
	gap: 10px;
	margin-bottom: 14px;
}
.report-box .part-label {
	font-weight: 800;
	color: #0b0e13;
	background: #e9ecef;
	border: 1px solid #ced4da;
	border-radius: 6px;
	text-align: center;
	padding: 10px 6px;
	align-self: start;
}
.report-box .box {
	border: 1px solid #ced4da;
	border-radius: 6px;
	padding: 12px;
	background: #ffffff;
}
.box-title {
	font-weight: 700;
	margin-bottom: 10px;
	letter-spacing: 0.2px;
}
.box-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin-bottom: 10px;
}
.box-field {
	display: grid;
	grid-template-columns: 140px 1fr;
	gap: 8px;
	align-items: start;
	margin-bottom: 10px;
}
.box-field .label {
	color: #6c757d;
	font-weight: 700;
}
.box-field .value {
	min-height: 24px;
	border: 1px solid #e9ecef;
	border-radius: 4px;
	padding: 8px 10px;
	background: #fafbfc;
}

/* Defective Meter Form Styles - Professional Redesigned */

/* Screen Display Styles - Compact A4 Layout */
.defective-meter-form {
	background: #ffffff;
	color: #1a1a1a;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
	font-size: 10pt;
	line-height: 1.4;
	padding: 12px;
	max-width: 210mm;
	margin: 0 auto;
	border: 1px solid #e0e0e0;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
	border-radius: 6px;
}

/* Document Header - Compact */
.document-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 8px;
	padding-bottom: 6px;
	border-bottom: 1.5px solid #2c3e50;
}

.company-brand {
	flex: 1;
}

.company-name {
	font-weight: 700;
	font-size: 11pt;
	color: #2c3e50;
	letter-spacing: 0.3px;
	margin-bottom: 2px;
}

.company-address {
	font-weight: 400;
	font-size: 8.5pt;
	color: #495057;
	line-height: 1.3;
	margin-bottom: 3px;
	letter-spacing: 0.1px;
}

.company-address .address-line {
	display: block;
	line-height: 1.2;
	margin-bottom: 1px;
}

.company-reg {
	font-weight: 500;
	font-size: 9pt;
	color: #6c757d;
	letter-spacing: 0.2px;
}

.document-meta {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.meta-item {
	display: flex;
	align-items: center;
	gap: 4px;
}

.meta-label {
	font-weight: 600;
	font-size: 8pt;
	color: #6c757d;
}

.meta-value {
	font-weight: 600;
	font-size: 9pt;
	color: #2c3e50;
	padding: 2px 6px;
	background-color: #f8f9fa;
	border-radius: 3px;
}

/* Document Title - Compact */
.document-title {
	text-align: center;
	font-weight: 700;
	font-size: 12pt;
	margin: 8px 0 10px 0;
	color: #2c3e50;
	letter-spacing: 0.5px;
	padding-bottom: 6px;
	border-bottom: 2px solid #3498db;
}

/* Defect Summary Card - Compact */
.defect-summary-card {
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	border: 1px solid #dee2e6;
	border-radius: 6px;
	padding: 8px;
	margin-bottom: 10px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.summary-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 6px;
	padding-bottom: 5px;
	border-bottom: 1px solid #dee2e6;
}

.summary-title {
	font-weight: 700;
	font-size: 10pt;
	color: #2c3e50;
	letter-spacing: 0.2px;
}

.status-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 8px;
	border-radius: 16px;
	font-weight: 600;
	font-size: 9pt;
	letter-spacing: 0.2px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-icon {
	font-size: 8px;
	line-height: 1;
}

.status-badge.status-open {
	background-color: #dc3545;
	color: #ffffff;
}

.status-badge.status-progress {
	background-color: #ffc107;
	color: #000000;
}

.status-badge.status-closed {
	background-color: #28a745;
	color: #ffffff;
}

.summary-grid-compact {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 8px;
}

.summary-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.summary-label {
	font-weight: 600;
	font-size: 8pt;
	color: #6c757d;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.summary-value {
	font-weight: 600;
	font-size: 10pt;
	color: #2c3e50;
}

.summary-value.highlight {
	color: #0066cc;
	font-size: 10pt;
	font-weight: 700;
}

/* Reference Number with Barcode - Compact */
.reference-item {
	grid-column: 1 / -1;
}

.barcode-container-compact {
	margin-top: 6px;
	padding: 4px;
	background-color: #ffffff;
	border: 1px solid #dee2e6;
	border-radius: 3px;
	text-align: center;
	display: flex;
	justify-content: center;
	align-items: center;
}

.barcode {
	display: block;
	max-width: 100%;
	height: 35px !important;
	margin: 0 auto;
}

/* Content Sections - Compact */
.content-section-compact {
	margin-bottom: 10px;
	padding: 8px;
	background-color: #ffffff;
	border: 1px solid #e9ecef;
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.info-grid-compact {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
}

.info-item-compact {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.field-label {
	font-weight: 600;
	font-size: 9pt;
	color: #495057;
	margin-bottom: 2px;
}

.field-value-compact {
	font-weight: 500;
	font-size: 10pt;
	color: #212529;
	padding: 4px 8px;
	background-color: #f8f9fa;
	border-radius: 3px;
	border: 1px solid #e9ecef;
	min-height: 28px;
	display: flex;
	align-items: center;
}

/* Defect Details & Status - Combined Compact */
.defect-details-compact-section {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 8px;
	margin-bottom: 10px;
}

.defect-table-compact {
	overflow-x: auto;
}

.details-table-compact {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid #dee2e6;
	font-size: 9pt;
	background-color: #ffffff;
}

.details-table-compact thead {
	background-color: #ffffff;
	color: #212529;
}

.details-table-compact th {
	padding: 6px 8px;
	text-align: center;
	font-weight: 700;
	font-size: 8pt;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	border: 1px solid #dee2e6;
	background-color: #ffffff;
	color: #212529;
}

.details-table-compact td {
	padding: 6px 8px;
	border: 1px solid #dee2e6;
	vertical-align: top;
	font-size: 9pt;
	color: #212529;
	background-color: #ffffff;
}

.details-table-compact tbody tr {
	transition: background-color 0.2s ease;
	background-color: #ffffff;
}

.details-table-compact tbody tr:hover {
	background-color: #f8f9fa;
}

.cell-number {
	font-weight: 700;
	color: #495057;
	background-color: #ffffff;
	text-align: center;
}

.cell-sn {
	font-family: ui-monospace, 'Courier New', monospace;
	font-weight: 600;
	color: #0066cc;
	font-size: 9pt;
	background-color: #ffffff;
}

.cell-problem {
	color: #dc3545;
	font-weight: 500;
	font-size: 9pt;
	background-color: #ffffff;
}

.cell-action {
	color: #28a745;
	font-weight: 500;
	font-size: 9pt;
	background-color: #ffffff;
}

/* Status Progress Indicator - Compact */
.status-progress-compact {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	background-color: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 4px;
}

.progress-indicator-compact {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	gap: 4px;
}

.progress-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	flex: 1;
	position: relative;
}

.step-icon-compact {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background-color: #e9ecef;
	color: #6c757d;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 10pt;
	border: 2px solid #e9ecef;
	transition: all 0.3s ease;
}

.step-label-compact {
	font-weight: 600;
	font-size: 7pt;
	color: #6c757d;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	transition: color 0.3s ease;
	text-align: center;
}

.progress-step.active .step-icon-compact {
	background-color: #3498db;
	color: #ffffff;
	border-color: #3498db;
	box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.progress-step.active .step-label-compact {
	color: #3498db;
	font-weight: 700;
}

.progress-step.completed .step-icon-compact {
	background-color: #28a745;
	color: #ffffff;
	border-color: #28a745;
}

.progress-step.completed .step-label-compact {
	color: #28a745;
}

.progress-line-compact {
	flex: 1;
	height: 2px;
	background-color: #e9ecef;
	margin: 0 4px;
	margin-top: -14px;
	position: relative;
	z-index: 0;
}

.progress-indicator-compact .progress-step.completed + .progress-line-compact,
.progress-indicator-compact .progress-step.active + .progress-line-compact {
	background-color: #28a745;
}

/* Basic Information Section - Grid Layout */
.basic-info-section {
	margin-bottom: 12px;
}

.info-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px 16px;
}

.info-item {
	display: flex;
	align-items: center;
	gap: 8px;
}

.info-label {
	font-weight: 600;
	font-size: 10pt;
	min-width: 110px;
	color: #333333;
}

.info-value {
	font-weight: 500;
	color: #000000;
	flex: 1;
}

/* Inline Checkbox Groups */
.checkbox-group-inline {
	display: flex;
	gap: 12px;
	align-items: center;
}

.checkbox-item {
	display: flex;
	align-items: center;
	gap: 4px;
}

.checkbox-item input[type="checkbox"] {
	width: 14px;
	height: 14px;
	border: 1.5px solid #000000;
	margin: 0;
	cursor: default;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	position: relative;
}

.checkbox-item input[type="checkbox"]:checked::after {
	content: '✓';
	position: absolute;
	top: -1px;
	left: 2px;
	font-size: 12px;
	font-weight: bold;
	color: #000000;
}

.checkbox-item input[type="checkbox"]:checked {
	background-color: #ffffff;
}

.checkbox-item label {
	font-weight: 500;
	font-size: 10pt;
	margin: 0;
	cursor: default;
	color: #000000;
}

/* Defect Table - Optimized */
.defect-table-section {
	margin: 12px 0;
}

.defect-table {
	width: 100%;
	border-collapse: collapse;
	border: 1.5px solid #000000;
	font-size: 9.5pt;
}

.defect-table th,
.defect-table td {
	border: 1px solid #000000;
	padding: 5px 6px;
	text-align: left;
	vertical-align: top;
}

.defect-table th {
	background-color: #f0f0f0;
	font-weight: 700;
	text-align: center;
	font-size: 9pt;
	padding: 6px;
}

.defect-table .col-no {
	width: 7%;
	text-align: center;
}

.defect-table .col-sn {
	width: 18%;
}

.defect-table .col-problem {
	width: 37.5%;
}

.defect-table .col-action {
	width: 37.5%;
}

.defect-table tbody tr {
	height: auto;
	min-height: 32px;
}

.defect-table tbody td {
	word-wrap: break-word;
	overflow-wrap: break-word;
}

/* Signature Sections - Ultra Compact */
.signature-sections-compact {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 6px;
	margin: 8px 0 0 0;
}

.signature-section-compact {
	border: 1px solid #d0d0d0;
	padding: 6px;
	background-color: #fafafa;
	border-radius: 3px;
}

.signature-title-compact {
	font-weight: 700;
	font-size: 9pt;
	margin-bottom: 5px;
	text-decoration: underline;
	text-align: center;
	color: #000000;
	letter-spacing: 0.3px;
}

.signature-grid-compact {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 6px;
}

.signature-item-compact {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.signature-grid-compact .remarks-item-full,
.signature-grid-compact .comment-item-full {
	grid-column: 1 / -1;
	margin-top: 4px;
}

.signature-label-compact {
	font-weight: 600;
	font-size: 8pt;
	color: #333333;
}

.signature-line-compact {
	border-bottom: 1px solid #000000;
	height: 14px;
	width: 100%;
	min-width: 80px;
}

.remarks-box-compact,
.comment-box-compact {
	border: 1px solid #000000;
	min-height: 80px;
	width: 100%;
	margin-top: 2px;
	background-color: #ffffff;
	padding: 6px 8px;
	font-family: inherit;
	font-size: 9pt;
	line-height: 1.4;
	resize: vertical;
	overflow-y: auto;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.remarks-box-compact:focus,
.comment-box-compact:focus {
	outline: 1px solid #0066cc;
	border-color: #0066cc;
}

.remarks-item-full,
.comment-item-full {
	grid-column: 1 / -1;
}

.remarks-item-full .signature-label-compact,
.comment-item-full .signature-label-compact {
	margin-bottom: 4px;
}

.manager-check-compact {
	grid-column: 1;
}

.car-form-compact {
	grid-column: 2;
}

/* Manager & CAR Section */
.manager-car-section {
	margin: 12px 0;
}

.manager-car-grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 12px;
}

.manager-check {
	border: 1px solid #d0d0d0;
	padding: 8px;
	background-color: #fafafa;
}

.manager-check .section-title {
	font-weight: 700;
	font-size: 10pt;
	margin-bottom: 8px;
	text-decoration: underline;
	color: #000000;
}

.manager-fields {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.manager-field {
	display: flex;
	align-items: center;
	gap: 8px;
}

.manager-field .form-label {
	font-weight: 600;
	font-size: 9pt;
	min-width: 70px;
	color: #333333;
	margin: 0;
}

.remarks-box {
	border: 1px solid #000000;
	height: 50px;
	width: 180px;
	background-color: #ffffff;
}

.car-form {
	border: 1px solid #000000;
	padding: 8px;
	background-color: #ffffff;
}

.car-form .section-title {
	font-weight: 700;
	font-size: 10pt;
	margin-bottom: 6px;
	text-decoration: underline;
	color: #000000;
}

.car-fields {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin-top: 6px;
}

.car-field {
	display: flex;
	align-items: center;
	gap: 8px;
}

.car-field .form-label {
	font-weight: 600;
	font-size: 9pt;
	min-width: 75px;
	color: #333333;
	margin: 0;
}

.comment-box {
	border: 1px solid #000000;
	height: 35px;
	width: 140px;
	background-color: #ffffff;
}

/* Section Titles */
.section-title {
	font-weight: 700;
	font-size: 11pt;
	margin-bottom: 8px;
	text-decoration: underline;
	color: #000000;
	letter-spacing: 0.3px;
}

/* Form Label Standardization */
.form-label {
	font-weight: 600;
	font-size: 9.5pt;
	color: #333333;
}

/* Attachments Section - Compact */
.attachments-section-compact {
	margin-top: 8px;
	margin-bottom: 8px;
	page-break-inside: avoid;
}

.section-title-compact {
	font-weight: 700;
	font-size: 9pt;
	color: #2c3e50;
	margin-bottom: 6px;
	letter-spacing: 0.3px;
	text-decoration: underline;
}

.attachments-grid-compact {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
	gap: 6px;
	margin-top: 6px;
	width: 100%;
}

/* Image Attachment Wrapper */
.attachment-image-wrapper {
	position: relative;
	width: 100%;
	background-color: #f8f8f8;
	border: 1px solid #d0d0d0;
	border-radius: 4px;
	padding: 6px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 120px;
	page-break-inside: avoid;
}

.attachment-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	text-decoration: none;
	color: #000000;
	transition: opacity 0.2s ease;
}

.attachment-link:hover {
	opacity: 0.8;
}

.attachment-image {
	max-width: 100%;
	height: auto;
	max-height: 200px;
	width: auto;
	object-fit: contain;
	display: block;
	margin: 0 auto;
	border: 1px solid #e0e0e0;
	background-color: #ffffff;
	border-radius: 2px;
	image-rendering: -webkit-optimize-contrast;
	image-rendering: crisp-edges;
	transition: transform 0.2s ease;
}

.attachment-image:hover {
	transform: scale(1.02);
}

/* Handle image loading states */
.attachment-image[loading="lazy"] {
	opacity: 0;
	transition: opacity 0.3s ease;
}

.attachment-image[loading="lazy"].loaded {
	opacity: 1;
}

.image-label {
	display: block;
	font-size: 8pt;
	font-weight: 500;
	color: #666666;
	text-align: center;
	margin-top: 4px;
	word-break: break-word;
	overflow-wrap: break-word;
	max-width: 100%;
}

/* Responsive Grid for Multiple Images */
@media (min-width: 600px) {
	.attachments-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 900px) {
	.attachments-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* Responsive Design for Screen */
@media (max-width: 991px) {
	.defective-meter-form {
		padding: 15px;
		font-size: 10pt;
	}
	
	.info-grid {
		grid-template-columns: 1fr;
		gap: 8px;
	}
	
	.signature-sections {
		grid-template-columns: 1fr;
	}
	
	.manager-car-grid {
		grid-template-columns: 1fr;
	}
	
	.attachments-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	
	.attachment-image {
		max-height: 150px;
	}
}

@media (max-width: 600px) {
	.attachments-grid {
		grid-template-columns: 1fr;
	}
	
	.attachment-image {
		max-height: 200px;
	}
}

/* Print Styles - A4 Optimized (210mm × 297mm with 10mm margins = 190mm × 277mm content) */
@media print {
	/* Hide everything except the defect form */
	html, body {
		margin: 0 !important;
		padding: 0 !important;
		background: white !important;
		height: auto !important;
		overflow: visible !important;
	}
	
	/* Hide all page elements except modal */
	body > *:not(#defectViewModal):not(script):not(style),
	.container-fluid,
	.navbar,
	.toast-container,
	.modal-backdrop,
	header,
	footer,
	nav {
		display: none !important;
		visibility: hidden !important;
		height: 0 !important;
		width: 0 !important;
		overflow: hidden !important;
		margin: 0 !important;
		padding: 0 !important;
		position: absolute !important;
		left: -9999px !important;
		top: -9999px !important;
	}
	
	/* Show only the defect form modal */
	#defectViewModal {
		position: static !important;
		display: block !important;
		opacity: 1 !important;
		background: transparent !important;
		z-index: 9999 !important;
		visibility: visible !important;
		margin: 0 !important;
		padding: 0 !important;
		top: 0 !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		width: 100% !important;
		height: auto !important;
	}
	
	#defectViewModal * {
		visibility: visible !important;
		opacity: 1 !important;
	}
	
	.modal-dialog {
		margin: 0 !important;
		max-width: none !important;
		width: 100% !important;
		height: auto !important;
		display: block !important;
		visibility: visible !important;
	}
	
	.modal-header,
	.modal-footer,
	.btn,
	.btn-close,
	.btn-secondary,
	.no-print {
		display: none !important;
		visibility: hidden !important;
	}
	
	.modal-content {
		border: none !important;
		box-shadow: none !important;
		background: white !important;
		padding: 0 !important;
		display: block !important;
		position: relative !important;
		visibility: visible !important;
		opacity: 1 !important;
	}
	
	/* Override any dark modal backgrounds */
	.modal-content.bg-dark,
	#defectViewModal .modal-content.bg-dark {
		background: white !important;
		background-color: white !important;
	}
	
	/* Ensure all text is visible and black */
	.modal-content * {
		color: black !important;
	}
	
	.modal-content .text-white,
	.modal-content .text-light {
		color: black !important;
	}
	
	.modal-body {
		padding: 0 !important;
		display: block !important;
		visibility: visible !important;
		opacity: 1 !important;
	}
	
	/* A4 Page Setup - Prevent blank pages */
	@page {
		size: A4;
		margin: 10mm;
	}
	
	/* Defective Meter Form - Print Optimized Single Page */
	.defective-meter-form {
		width: 190mm !important;
		max-width: 190mm !important;
		margin: 0 auto !important;
		padding: 5mm 6mm !important;
		font-size: 9pt !important;
		line-height: 1.3 !important;
		background: white !important;
		color: black !important;
		border: 1px solid #000000 !important;
		box-shadow: none !important;
		border-radius: 0 !important;
		page-break-after: avoid !important;
		page-break-inside: avoid !important;
		page-break-before: avoid !important;
		position: relative !important;
		display: block !important;
		visibility: visible !important;
		opacity: 1 !important;
		orphans: 3 !important;
		widows: 3 !important;
	}
	
	/* Ensure all form elements are visible */
	.defective-meter-form * {
		visibility: visible !important;
		opacity: 1 !important;
	}
	
	/* Ensure text elements have proper color - override any dark backgrounds */
	.defective-meter-form,
	.defective-meter-form * {
		color: black !important;
	}
	
	/* Override any dark text colors for print */
	.defective-meter-form .text-white,
	.defective-meter-form .text-light,
	.defective-meter-form .bg-dark {
		color: black !important;
		background: white !important;
	}
	
	/* Ensure background colors are white or transparent for print */
	.defective-meter-form,
	.document-header,
	.defect-summary-card,
	.content-section-compact,
	.defect-details-compact-section,
	.signature-sections-compact {
		background: white !important;
	}
	
	/* Document elements visibility */
	.document-header,
	.document-title,
	.defect-summary-card,
	.content-section-compact,
	.defect-details-compact-section,
	.attachments-section-compact,
	.signature-sections-compact {
		visibility: visible !important;
		display: block !important;
		opacity: 1 !important;
	}
	
	/* Document Header - Ultra Compact Print */
	.document-header {
		margin-bottom: 3mm !important;
		padding-bottom: 2mm !important;
		border-bottom: 1px solid #000000 !important;
		display: block !important;
		visibility: visible !important;
	}
	
	.document-header * {
		visibility: visible !important;
		color: black !important;
	}
	
	.company-name {
		font-size: 10pt !important;
	}
	
	.company-address {
		font-size: 7.5pt !important;
		line-height: 1.2 !important;
		margin-bottom: 1mm !important;
	}
	
	.company-address .address-line {
		line-height: 1.1 !important;
		margin-bottom: 0.5mm !important;
	}
	
	.company-reg {
		font-size: 8pt !important;
	}
	
	.meta-label,
	.meta-value {
		font-size: 7pt !important;
	}
	
	/* Document Title - Compact Print */
	.document-title {
		font-size: 11pt !important;
		margin: 3mm 0 4mm 0 !important;
		padding-bottom: 2mm !important;
		border-bottom: 1.5px solid #000000 !important;
	}
	
	/* Defect Summary Card - Compact Print */
	.defect-summary-card {
		margin-bottom: 4mm !important;
		padding: 3mm !important;
		border: 1px solid #000000 !important;
		background: #f8f9fa !important;
	}
	
	.summary-header {
		margin-bottom: 3mm !important;
		padding-bottom: 2mm !important;
	}
	
	.summary-title {
		font-size: 9pt !important;
	}
	
	.status-badge {
		padding: 2px 6px !important;
		font-size: 8pt !important;
	}
	
	.summary-grid-compact {
		gap: 3mm !important;
	}
	
	.summary-label {
		font-size: 7pt !important;
	}
	
	.summary-value {
		font-size: 8pt !important;
	}
	
	.summary-value.highlight {
		font-size: 9pt !important;
	}
	
	/* Barcode Print Styles - Compact */
	.barcode-container-compact {
		margin-top: 3mm !important;
		padding: 2mm !important;
		border: 0.5px solid #000000 !important;
		background: #ffffff !important;
	}
	
	.barcode {
		max-width: 100% !important;
		height: 25mm !important;
	}
	
	/* Content Sections - Ultra Compact Print */
	.content-section-compact {
		margin-bottom: 4mm !important;
		padding: 3mm !important;
		border: 1px solid #000000 !important;
		page-break-inside: avoid !important;
	}
	
	.info-grid-compact {
		gap: 2mm !important;
	}
	
	.field-label {
		font-size: 8pt !important;
	}
	
	.field-value-compact {
		font-size: 9pt !important;
		padding: 2px 4px !important;
		min-height: 20px !important;
	}
	
	/* Defect Details & Status - Combined Compact Print */
	.defect-details-compact-section {
		margin-bottom: 4mm !important;
		gap: 3mm !important;
		page-break-inside: avoid !important;
	}
	
	.details-table-compact {
		font-size: 8pt !important;
		border: 1px solid #000000 !important;
	}
	
	.details-table-compact th {
		font-size: 7pt !important;
		padding: 3px 4px !important;
		background: #ffffff !important;
		color: #212529 !important;
		border: 1px solid #000000 !important;
	}
	
	.details-table-compact td {
		font-size: 8pt !important;
		padding: 3px 4px !important;
	}
	
	.status-progress-compact {
		padding: 4px !important;
		border: 1px solid #000000 !important;
	}
	
	.step-icon-compact {
		width: 18px !important;
		height: 18px !important;
		font-size: 8pt !important;
		border-width: 1.5px !important;
	}
	
	.step-label-compact {
		font-size: 6pt !important;
	}
	
	.progress-line-compact {
		height: 1.5px !important;
		margin-top: -10px !important;
	}
	
	/* Attachments - Compact Print */
	.attachments-section-compact {
		margin-top: 3mm !important;
		margin-bottom: 3mm !important;
		page-break-inside: avoid !important;
	}
	
	.section-title-compact {
		font-size: 8pt !important;
		margin-bottom: 2mm !important;
	}
	
	.attachments-grid-compact {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 2mm !important;
	}
	
	.attachment-image-wrapper {
		min-height: 25mm !important;
		max-height: 30mm !important;
		padding: 2mm !important;
	}
	
	.attachment-image {
		max-height: 25mm !important;
	}
	
	/* Signature Sections - Ultra Compact Print */
	.signature-sections-compact {
		margin: 4mm 0 0 0 !important;
		gap: 3mm !important;
		page-break-inside: avoid !important;
	}
	
	.signature-section-compact {
		padding: 3mm !important;
		border: 1px solid #000000 !important;
	}
	
	.signature-title-compact {
		font-size: 8pt !important;
		margin-bottom: 2mm !important;
	}
	
	.signature-grid-compact {
		gap: 2mm !important;
	}
	
	.signature-label-compact {
		font-size: 7pt !important;
	}
	
	.signature-line-compact {
		height: 12px !important;
		min-width: 60px !important;
	}
	
	.remarks-box-compact,
	.comment-box-compact {
		min-height: 60px !important;
		height: auto !important;
		width: 100% !important;
		padding: 3mm 4mm !important;
		font-size: 8pt !important;
		line-height: 1.4 !important;
	}
	
	.remarks-item-full,
	.comment-item-full {
		grid-column: 1 / -1 !important;
		margin-bottom: 2mm !important;
	}
	
	/* Remove all unnecessary spacing */
	* {
		margin-top: 0 !important;
		margin-bottom: 0 !important;
	}
	
	.defective-meter-form > *:not(:last-child) {
		margin-bottom: 3mm !important;
	}
	
	/* Ensure all sections fit on single page */
	.defect-summary-card,
	.content-section-compact,
	.defect-details-compact-section,
	.attachments-section-compact,
	.signature-sections-compact {
		margin-bottom: 3mm !important;
	}
	
	/* Checkbox styling for print */
	.checkbox-item input[type="checkbox"] {
		width: 10px !important;
		height: 10px !important;
		border-width: 1px !important;
	}
	
	.checkbox-item label {
		font-size: 7pt !important;
	}
	
	/* Ensure no page breaks - single page layout */
	.defective-meter-form > * {
		page-break-inside: avoid !important;
	}
	
	.details-table-compact thead {
		display: table-header-group !important;
	}
	
	/* Compact line heights for better fit */
	.defective-meter-form {
		line-height: 1.2 !important;
	}
	
	.defective-meter-form * {
		line-height: 1.3 !important;
	}
	
	/* Remove any unnecessary spacing */
	.defective-meter-form * {
		margin-top: 0 !important;
		margin-bottom: 0 !important;
	}
	
	/* Set minimal spacing between elements */
	.defective-meter-form > *:not(:last-child) {
		margin-bottom: 2mm !important;
	}
	
	/* Prevent unwanted page breaks and blank pages */
	.defective-meter-form::before,
	.defective-meter-form::after,
	.modal-dialog::before,
	.modal-dialog::after,
	.modal-content::before,
	.modal-content::after {
		display: none !important;
		content: none !important;
	}
	
	/* Remove any height constraints that might cause blank pages */
	.modal,
	.modal-dialog,
	.modal-content,
	.modal-body {
		height: auto !important;
		min-height: 0 !important;
		max-height: none !important;
		page-break-before: avoid !important;
		page-break-after: avoid !important;
	}
	
	/* Prevent blank pages - ensure content starts on first page */
	html, body {
		height: auto !important;
		overflow: visible !important;
	}
	
	/* Hide everything that might create blank pages */
	body > .container-fluid,
	body > .navbar,
	body > .toast-container {
		display: none !important;
		visibility: hidden !important;
		height: 0 !important;
		width: 0 !important;
		overflow: hidden !important;
		margin: 0 !important;
		padding: 0 !important;
	}
}

/* Defect Summary Cards */
.summary-card {
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	border-left: 3px solid transparent !important;
}

.summary-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

.summary-card .card-body {
	padding: 1rem;
}

.summary-icon {
	width: 48px;
	height: 48px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.5rem;
}

.summary-icon.bg-purple {
	background-color: #6f42c1 !important;
}

.summary-card h6 {
	font-size: 0.75rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.summary-card h3 {
	font-size: 1.75rem;
	font-weight: 700;
	margin: 0;
}

/* Category Summary Styles - Right Sidebar - Professional Design */
.category-summary-card {
	border: 1px solid #e9ecef;
	border-radius: 12px;
	overflow: hidden;
	background: #ffffff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	transition: box-shadow 0.3s ease;
}

.category-summary-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.category-summary-header {
	background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
	border-bottom: 2px solid #e9ecef;
	padding: 1rem 1.25rem;
}

.category-summary-header h6 {
	color: #212529;
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.3px;
}

.category-summary-header .btn-link,
.category-summary-action-btn {
	color: #6c757d;
	text-decoration: none;
	transition: all 0.3s ease;
	padding: 4px 8px;
	border-radius: 6px;
}

.category-summary-header .btn-link:hover,
.category-summary-action-btn:hover {
	color: #0d6efd;
	background: rgba(13, 110, 253, 0.1);
	transform: scale(1.1);
}

.category-summary-header .btn-link.spinning {
	animation: spin 0.6s linear infinite;
}

.category-summary-action-btn:active {
	transform: scale(0.95);
}

@keyframes spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

.category-stat-item {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 0.875rem;
}

.category-stat-item i {
	font-size: 1rem;
}

.category-summary-search-wrapper {
	margin-top: 0.75rem;
}

.category-summary-search-wrapper input {
	border-radius: 8px;
	border: 1px solid #dee2e6;
	transition: all 0.3s ease;
}

.category-summary-search-wrapper input:focus {
	border-color: #0d6efd;
	box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.category-summary-footer {
	padding: 0.75rem 1.25rem;
	background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
	border-top: 1px solid #e9ecef;
}

.category-summary-footer small {
	font-size: 0.8rem;
	display: flex;
	align-items: center;
}

.category-summary-footer .btn {
	font-size: 0.8rem;
	padding: 0.25rem 0.75rem;
	border-radius: 6px;
	transition: all 0.2s ease;
}

.category-summary-footer .btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-summary-body {
	padding: 1rem 1.25rem;
	max-height: calc(100vh - 300px);
	overflow-y: auto;
}

.category-summary-body::-webkit-scrollbar {
	width: 6px;
}

.category-summary-body::-webkit-scrollbar-track {
	background: #f8f9fa;
	border-radius: 3px;
}

.category-summary-body::-webkit-scrollbar-thumb {
	background: #ced4da;
	border-radius: 3px;
}

.category-summary-body::-webkit-scrollbar-thumb:hover {
	background: #adb5bd;
}

.category-summary-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.category-summary-item {
	background: #ffffff;
	border: 1px solid #e9ecef;
	border-radius: 10px;
	padding: 1rem;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	overflow: hidden;
	cursor: pointer;
	user-select: none;
}

.category-summary-item::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 4px;
	background: transparent;
	transition: background 0.3s ease, width 0.3s ease;
}

.category-summary-item:hover {
	border-color: #0d6efd;
	box-shadow: 0 6px 20px rgba(13, 110, 253, 0.15);
	transform: translateY(-3px);
	background: linear-gradient(to right, #f8f9ff 0%, #ffffff 100%);
}

.category-summary-item:hover::before {
	background: #0d6efd;
	width: 4px;
}

.category-summary-item:active {
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(13, 110, 253, 0.2);
}

.category-summary-item:focus {
	outline: 2px solid #0d6efd;
	outline-offset: 2px;
}

/* Active state for filtered category */
.category-item-active {
	border-color: #0d6efd !important;
	background: linear-gradient(135deg, #e7f1ff 0%, #f0f8ff 100%) !important;
	box-shadow: 0 4px 16px rgba(13, 110, 253, 0.25) !important;
	transform: translateY(-2px);
}

.category-item-active::before {
	background: #0d6efd !important;
	width: 5px !important;
}

.category-item-active .category-icon-wrapper {
	transform: scale(1.15);
	box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.category-active-indicator {
	color: #198754;
	font-size: 1rem;
	animation: checkPulse 0.5s ease;
}

@keyframes checkPulse {
	0% { transform: scale(0); }
	50% { transform: scale(1.2); }
	100% { transform: scale(1); }
}

/* Ripple effect */
.category-ripple {
	position: absolute;
	border-radius: 50%;
	background: rgba(13, 110, 253, 0.3);
	transform: scale(0);
	animation: ripple 0.6s ease-out;
	pointer-events: none;
}

@keyframes ripple {
	to {
		transform: scale(4);
		opacity: 0;
	}
}

.category-item-header {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 10px;
}

.category-icon-wrapper {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid;
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.category-summary-item:hover .category-icon-wrapper {
	transform: scale(1.1);
}

.category-icon-wrapper i {
	font-size: 1.1rem;
}

.category-info {
	flex: 1;
	min-width: 0;
}

.category-name {
	font-weight: 600;
	font-size: 0.9rem;
	color: #212529;
	word-break: break-word;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.category-count-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 10px;
	border-radius: 12px;
	color: #ffffff;
	font-size: 0.85rem;
	font-weight: 700;
	min-width: 36px;
	text-align: center;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-summary-item:hover .category-count-badge {
	transform: scale(1.05);
	box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.category-meta {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 6px;
	font-size: 0.8rem;
	flex-wrap: wrap;
}

.category-percentage {
	font-weight: 700;
	color: #495057;
}

.category-action-hint {
	color: #6c757d;
	font-size: 0.75rem;
	opacity: 0;
	transition: opacity 0.3s ease;
	margin-left: auto;
}

.category-summary-item:hover .category-action-hint {
	opacity: 1;
}

.category-item-active .category-action-hint {
	opacity: 1;
	color: #0d6efd;
	font-weight: 600;
}

.category-progress-wrapper {
	margin-top: 10px;
}

.category-progress {
	height: 10px;
	border-radius: 10px;
	background-color: #f1f3f5;
	overflow: hidden;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.category-progress-bar {
	height: 100%;
	border-radius: 10px;
	transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	overflow: hidden;
}

.category-progress-bar::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	background: linear-gradient(90deg, 
		rgba(255, 255, 255, 0) 0%, 
		rgba(255, 255, 255, 0.3) 50%, 
		rgba(255, 255, 255, 0) 100%);
	animation: shimmer 2s infinite;
}

@keyframes shimmer {
	0% { transform: translateX(-100%); }
	100% { transform: translateX(100%); }
}

/* Empty and Error States */
.category-empty-state,
.category-error-state,
.category-no-results {
	text-align: center;
	padding: 3rem 1.5rem;
	color: #6c757d;
}

.category-empty-state i,
.category-error-state i,
.category-no-results i {
	font-size: 3rem;
	margin-bottom: 1rem;
	opacity: 0.5;
	animation: float 3s ease-in-out infinite;
}

@keyframes float {
	0%, 100% { transform: translateY(0px); }
	50% { transform: translateY(-10px); }
}

.category-empty-state p,
.category-error-state p,
.category-no-results p {
	font-size: 1rem;
	font-weight: 500;
	margin-bottom: 0.5rem;
}

.category-empty-state small,
.category-error-state small {
	font-size: 0.875rem;
}

.category-loading-state {
	animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* Expanded state */
.category-item-expanded {
	padding: 1.25rem;
}

.category-item-expanded .category-name {
	-webkit-line-clamp: unset;
	display: block;
}

/* Responsive adjustments for summary cards */
@media (max-width: 768px) {
	.summary-card h3 {
		font-size: 1.5rem;
	}
	
	.summary-icon {
		width: 40px;
		height: 40px;
		font-size: 1.25rem;
	}
	
	.category-summary-item {
		padding: 0.875rem;
	}
	
	.category-summary-list {
		gap: 12px;
	}
	
	.category-icon-wrapper {
		width: 36px;
		height: 36px;
	}
	
	.category-icon-wrapper i {
		font-size: 1rem;
	}
	
	.category-name {
		font-size: 0.85rem;
	}
	
	.category-count-badge {
		font-size: 0.8rem;
		padding: 3px 8px;
	}
	
	.category-summary-header {
		padding: 0.875rem 1rem;
	}
	
	.category-summary-body {
		padding: 0.875rem 1rem;
	}
}

/* Responsive adjustments for category summary sidebar */
@media (max-width: 991px) {
	.category-summary-list {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}
}

@media (max-width: 576px) {
	.category-summary-list {
		grid-template-columns: 1fr;
	}
}

/* Analytics Dashboard Styles */
#analyticsDashboardModal .modal-body {
	max-height: calc(100vh - 200px);
	overflow-y: auto;
}

#analyticsDashboardModal .modal-body::-webkit-scrollbar {
	width: 8px;
}

#analyticsDashboardModal .modal-body::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.05);
}

#analyticsDashboardModal .modal-body::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 4px;
}

#analyticsDashboardModal .modal-body::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.3);
}

.analytics-metric-card {
	background-color: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.1);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.analytics-metric-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#analyticsTabs .nav-link {
	color: #adb5bd;
	border-color: transparent;
}

#analyticsTabs .nav-link:hover {
	color: #fff;
	border-color: transparent;
}

#analyticsTabs .nav-link.active {
	color: #fff;
	background-color: rgba(255, 255, 255, 0.1);
	border-color: #495057;
}

#topCategoriesList .list-group-item {
	padding: 0.75rem;
	border-left: 3px solid transparent;
	transition: border-color 0.2s ease;
}

#topCategoriesList .list-group-item:hover {
	border-left-color: #0d6efd;
	background-color: rgba(255, 255, 255, 0.05);
}

/* Hover lift effect for analytics cards */
.hover-lift {
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* Enhanced analytics dashboard styling */
#analyticsDashboardModal .card {
	transition: all 0.3s ease;
}

#analyticsDashboardModal .card-header {
	transition: background-color 0.2s ease;
}

#analyticsDashboardModal .nav-pills .nav-link {
	transition: all 0.3s ease;
	border: 1px solid transparent;
}

#analyticsDashboardModal .nav-pills .nav-link:hover {
	background-color: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.2);
}

#analyticsDashboardModal .nav-pills .nav-link.active {
	background-color: #0D6EFD !important;
	border-color: #0D6EFD !important;
	color: #FFFFFF !important;
	box-shadow: 0 2px 8px rgba(13, 110, 253, 0.25);
}

#analyticsDashboardModal .nav-pills .nav-link {
	transition: all 0.3s ease;
	background-color: transparent;
}

#analyticsDashboardModal .nav-pills .nav-link:hover:not(.active) {
	background-color: #F3F4F6 !important;
	color: #111827 !important;
	border-color: #D1D5DB !important;
}

/* Enhanced readability for analytics dashboard - White Theme */
#analyticsDashboardModal {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	background-color: #FFFFFF;
}

#analyticsDashboardModal .modal-content {
	background-color: #FFFFFF !important;
	border: none;
}

#analyticsDashboardModal .text-light {
	color: #111827 !important;
}

#analyticsDashboardModal .text-muted {
	color: #6B7280 !important;
	font-weight: 400;
}

#analyticsDashboardModal .card-header h6 {
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.3px;
}

#analyticsDashboardModal .form-label {
	font-weight: 500;
	color: #dee2e6;
	font-size: 0.875rem;
}

#analyticsDashboardModal .form-control,
#analyticsDashboardModal .form-select {
	font-size: 0.9rem;
	line-height: 1.5;
}

#analyticsDashboardModal .card-body {
	color: #f8f9fa;
}

/* Better contrast for metric cards */
#analyticsDashboardModal h2 {
	font-weight: 700;
	line-height: 1.2;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#analyticsDashboardModal h6 {
	font-weight: 600;
	letter-spacing: 0.2px;
}

/* Error state styling */
#analyticsDashboardModal [data-error="true"] {
	color: #dc3545 !important;
	opacity: 0.7;
}

/* Empty state styling */
#analyticsDashboardModal .alert-info {
	border-width: 2px;
	padding: 1.5rem;
	border-radius: 8px;
}

#analyticsDashboardModal .alert-info strong {
	font-size: 1rem;
	font-weight: 600;
}

/* Better chart readability */
#analyticsDashboardModal .card-header {
	padding: 1rem 1.25rem;
}

#analyticsDashboardModal .card-body {
	padding: 1.5rem;
}

/* Improved list readability */
#topCategoriesList .list-group-item {
	font-size: 0.9rem;
}

#topCategoriesList .list-group-item .text-light {
	font-weight: 500;
	line-height: 1.4;
}

#topCategoriesList .list-group-item small {
	font-size: 0.85rem;
	font-weight: 500;
}

/* Better button readability */
#analyticsDashboardModal .btn {
	font-weight: 500;
	letter-spacing: 0.3px;
}

/* Improved filter section */
#analyticsDashboardModal .card-header.bg-secondary {
	background-color: rgba(108, 117, 125, 0.15) !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Enhanced modal background */
#analyticsDashboardModal .modal-content {
	border-radius: 12px;
	overflow: hidden;
}

#analyticsDashboardModal .modal-body {
	background-color: #FFFFFF !important;
}

/* Better card styling */
#analyticsDashboardModal .card {
	border-radius: 12px;
	transition: all 0.3s ease;
}

#analyticsDashboardModal .card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4) !important;
}

/* Improved form controls */
#analyticsDashboardModal .form-control:focus,
#analyticsDashboardModal .form-select:focus {
	border-color: #0D6EFD !important;
	box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
	background-color: #FFFFFF !important;
	color: #111827 !important;
	outline: none;
}

/* Better button styling */
#analyticsDashboardModal .btn {
	border-radius: 6px;
	transition: all 0.2s ease;
}

#analyticsDashboardModal .btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Enhanced metric cards */
#analyticsDashboardModal .card-body.text-center {
	position: relative;
}

#analyticsDashboardModal .card-body.text-center::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
	opacity: 0;
	transition: opacity 0.3s ease;
}

#analyticsDashboardModal .hover-lift:hover .card-body.text-center::before {
	opacity: 1;
}

#analyticsDashboardModal .hover-lift:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
	border-color: #D1D5DB !important;
}

/* Responsive design improvements */
@media (max-width: 768px) {
	#analyticsDashboardModal .modal-dialog {
		margin: 0.5rem;
	}
	
	#analyticsDashboardModal .modal-body {
		padding: 1rem !important;
	}
	
	#analyticsDashboardModal .card-body {
		padding: 1rem !important;
	}
	
	#analyticsDashboardModal h2 {
		font-size: 2rem !important;
	}
}

/* High contrast text colors for accessibility */
#analyticsDashboardModal h1, #analyticsDashboardModal h2, #analyticsDashboardModal h3, 
#analyticsDashboardModal h4, #analyticsDashboardModal h5, #analyticsDashboardModal h6 {
	color: #111827 !important;
	font-weight: 600;
}

#analyticsDashboardModal p, #analyticsDashboardModal span:not(.badge):not(.text-primary):not(.text-success):not(.text-warning):not(.text-danger):not(.text-info) {
	color: #374151 !important;
}

#analyticsDashboardModal .dropdown-menu {
	background-color: #FFFFFF !important;
	border: 1px solid #E5E7EB !important;
}

#analyticsDashboardModal .dropdown-item {
	color: #374151 !important;
}

#analyticsDashboardModal .dropdown-item:hover {
	background-color: #F3F4F6 !important;
	color: #111827 !important;
}

/* Chart container styling */
#analyticsDashboardModal canvas {
	max-height: 400px;
	background-color: #FFFFFF;
	border-radius: 8px;
}

/* Ensure charts have proper contrast on white background */
#analyticsDashboardModal .card-header {
	background-color: #F9FAFB !important;
	border-bottom: 1px solid #E5E7EB !important;
}

#analyticsDashboardModal .card {
	background-color: #FFFFFF !important;
	border: 1px solid #E5E7EB !important;
}

#analyticsDashboardModal .card-body {
	background-color: #FFFFFF !important;
	color: #111827 !important;
}

#analyticsDashboardModal .card-body.position-relative {
	min-height: 200px;
}

/* Loading indicators */
[id$="-loading"] {
	z-index: 10;
}

/* Enhanced form controls */
#analyticsDashboardModal .form-control-sm,
#analyticsDashboardModal .form-select-sm {
	font-size: 0.875rem;
}

#analyticsDashboardModal .btn-group-sm .btn {
	padding: 0.25rem 0.5rem;
	font-size: 0.875rem;
}

/* Tooltip styling */
.tooltip {
	font-size: 0.875rem;
}

.tooltip-inner {
	background-color: rgba(0, 0, 0, 0.9);
	max-width: 300px;
}

/* Responsive adjustments for analytics */
@media (max-width: 768px) {
	#analyticsDashboardModal .row.g-2 {
		margin-bottom: 0.5rem;
	}
	
	#analyticsDashboardModal .col-md-2,
	#analyticsDashboardModal .col-md-4 {
		margin-bottom: 0.5rem;
	}
	
	#analyticsDashboardModal canvas {
		max-height: 250px;
	}
}

/* Add New Defect Form - Two Column Layout */
.form-section-left,
.form-section-right {
	padding: 0 8px;
}

.section-header {
	margin-bottom: 1rem;
}

.section-header h6 {
	font-weight: 600;
	letter-spacing: 0.5px;
	display: flex;
	align-items: center;
}

.section-header hr {
	opacity: 0.3;
}

.form-section-left .form-label,
.form-section-right .form-label {
	font-weight: 500;
	font-size: 0.875rem;
	margin-bottom: 0.5rem;
	color: var(--text-primary);
}

.form-section-left .form-control,
.form-section-left .form-select,
.form-section-right .form-control,
.form-section-right .form-select {
	border-color: var(--border-color);
	background-color: #FFFFFF;
	color: var(--text-primary);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-section-left .form-control:focus,
.form-section-left .form-select:focus,
.form-section-right .form-control:focus,
.form-section-right .form-select:focus {
	border-color: #0d6efd;
	box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-section-left textarea.form-control,
.form-section-right textarea.form-control {
	resize: vertical;
	min-height: 100px;
}

/* Responsive adjustments for form sections */
@media (max-width: 768px) {
	.form-section-left,
	.form-section-right {
		padding: 0;
	}
	
	.form-section-left {
		border-bottom: 1px solid rgba(255, 255, 255, 0.1);
		padding-bottom: 1.5rem;
		margin-bottom: 1.5rem;
	}
	
	.form-section-right {
		padding-top: 0;
	}
}

@media (min-width: 769px) {
	.form-section-left {
		border-right: 1px solid var(--border-color);
		padding-right: 1rem;
	}
	
	.form-section-right {
		padding-left: 1rem;
	}
}

/* ============================================
   GLOBAL WHITE BACKGROUND ENFORCEMENT
   ============================================ */

/* Force white backgrounds on all major UI components */
body, html {
	background-color: #FFFFFF !important;
}

/* All cards default to white */
.card, .card-header, .card-body {
	background-color: #FFFFFF !important;
}

/* All tables default to white */
.table, .table thead, .table tbody, .table th, .table td {
	background-color: #FFFFFF !important;
	color: var(--text-primary) !important;
}

.table thead th {
	background-color: var(--bs-secondary) !important;
	color: var(--text-primary) !important;
}

.table-striped tbody tr:nth-of-type(odd) {
	background-color: var(--bs-tertiary) !important;
}

/* Professional light hover effect for table rows */
.table-hover tbody tr {
	transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.table-hover tbody tr:hover {
	background-color: #F0F7FF !important; /* Light professional blue tint */
	box-shadow: 0 2px 4px rgba(37, 99, 235, 0.08) !important;
	cursor: pointer;
}

/* Ensure table header has professional light styling */
#defects-table thead th {
	background-color: #F8F9FA !important;
	color: #212529 !important;
	border-bottom: 2px solid #DEE2E6 !important;
	font-weight: 600;
	text-transform: uppercase;
	font-size: 0.75rem;
	letter-spacing: 0.5px;
	padding: 12px 16px;
}

/* Light professional table styling */
#defects-table {
	background-color: #FFFFFF !important;
}

#defects-table tbody tr {
	background-color: #FFFFFF !important;
	border-bottom: 1px solid #F0F0F0 !important;
}

#defects-table tbody td {
	color: #212529 !important;
	padding: 12px 16px;
	vertical-align: middle;
}

/* All modals default to white */
.modal-content, .modal-header, .modal-body, .modal-footer {
	background-color: #FFFFFF !important;
	color: var(--text-primary) !important;
}

/* All form elements default to white */
.form-control, .form-select, .form-control-lg, .form-select-lg,
input[type="text"], input[type="number"], input[type="email"],
input[type="password"], textarea, select {
	background-color: #FFFFFF !important;
	color: var(--text-primary) !important;
	border-color: var(--border-color) !important;
}

/* All dropdowns default to white */
.dropdown-menu, .dropdown-item {
	background-color: #FFFFFF !important;
	color: var(--text-primary) !important;
}

.dropdown-item:hover {
	background-color: var(--accent-blue) !important;
	color: var(--text-primary) !important;
}

/* All navigation elements */
.navbar, .navbar-nav, .nav-link {
	background-color: #FFFFFF !important;
	color: var(--text-primary) !important;
}

/* All list groups */
.list-group, .list-group-item {
	background-color: #FFFFFF !important;
	color: var(--text-primary) !important;
	border-color: var(--border-color) !important;
}

.list-group-item:hover {
	background-color: var(--accent-blue) !important;
}

/* Accordions */
.accordion, .accordion-item, .accordion-button {
	background-color: #FFFFFF !important;
	color: var(--text-primary) !important;
}

.accordion-button:not(.collapsed) {
	background-color: var(--accent-blue) !important;
	color: var(--text-primary) !important;
}

/* Alerts and badges maintain their semantic colors but on white backgrounds */
.alert {
	background-color: #FFFFFF !important;
	border-color: var(--border-color) !important;
}

/* Toast notifications */
.toast, .toast-header, .toast-body {
	background-color: #FFFFFF !important;
	color: var(--text-primary) !important;
}

/* Breadcrumbs */
.breadcrumb, .breadcrumb-item {
	background-color: transparent !important;
	color: var(--text-secondary) !important;
}

/* Pagination */
.pagination, .page-link {
	background-color: #FFFFFF !important;
	color: var(--text-primary) !important;
	border-color: var(--border-color) !important;
}

.page-link:hover {
	background-color: var(--accent-blue) !important;
	color: var(--scanning-focus) !important;
}

.page-item.active .page-link {
	background-color: var(--scanning-focus) !important;
	color: #FFFFFF !important;
	border-color: var(--scanning-focus) !important;
}

/* Ensure all backgrounds are white unless explicitly styled otherwise */
* {
	background-color: inherit;
}

/* Override any Bootstrap dark theme classes */
.bg-dark, .bg-secondary {
	background-color: var(--bs-secondary) !important;
}

.text-dark, .text-body {
	color: var(--text-primary) !important;
}

/* Ensure proper contrast for all text on white backgrounds */
h1, h2, h3, h4, h5, h6, p, span, div, label, td, th {
	color: var(--text-primary) !important;
}

.text-muted {
	color: var(--text-muted) !important;
}

/* Sidebars and panels */
.sidebar, .panel, .sidebar-nav {
	background-color: #FFFFFF !important;
	border-color: var(--border-color) !important;
}

/* Forecast Charts - Fixed Static Sizes (No Auto-Resize) */
#forecast-daily-chart,
#forecast-weekly-chart {
	width: 100% !important;
	max-width: 100% !important;
	min-width: 100% !important;
	display: block !important;
	flex-shrink: 0 !important;
}

#forecast-daily-chart {
	height: 400px !important;
	min-height: 400px !important;
	max-height: 400px !important;
}

#forecast-weekly-chart {
	height: 350px !important;
	min-height: 350px !important;
	max-height: 350px !important;
}

/* Chart container - prevent shrinking */
.card-body:has(#forecast-daily-chart),
.card-body:has(#forecast-weekly-chart) {
	overflow: visible !important;
	flex-shrink: 0 !important;
	position: relative !important;
}

.card-body:has(#forecast-daily-chart) {
	min-height: 400px !important;
	height: 400px !important;
}

.card-body:has(#forecast-weekly-chart) {
	min-height: 350px !important;
	height: 350px !important;
}

/* Ensure chart containers don't shrink */
.card-body[style*="height"] {
	flex-shrink: 0 !important;
	overflow: visible !important;
}

/* Prevent parent containers from shrinking charts */
.card:has(#forecast-daily-chart),
.card:has(#forecast-weekly-chart) {
	flex-shrink: 0 !important;
}

/* Ensure row/col containers don't compress charts */
.row:has(#forecast-daily-chart),
.row:has(#forecast-weekly-chart),
.col-lg-8:has(#forecast-daily-chart),
.col-lg-4:has(#forecast-weekly-chart) {
	flex-shrink: 0 !important;
}

/* ============================================
   CRITICAL: Force Scan Time column to be black - Highest Priority
   These rules must be at the end to override everything
   ============================================ */

.invalid-page tbody td:nth-child(5),
.invalid-page .table tbody td:nth-child(5),
.invalid-page table tbody td:nth-child(5),
.invalid-page td[data-label="Scan Time"],
.invalid-page td[data-label="Scan Time"] *,
.invalid-page td[data-label="Scan Time"] span,
.invalid-page td[data-label="Scan Time"] small,
.invalid-page #line1-records-table-body tr td:nth-child(5),
.invalid-page #line2-records-table-body tr td:nth-child(5),
.invalid-page #line1-records-table-body tr td:nth-child(5) *,
.invalid-page #line2-records-table-body tr td:nth-child(5) * {
	color: #000000 !important;
	font-weight: 600 !important;
	font-size: 0.95rem !important;
	opacity: 1 !important;
}

/* Override ALL possible Bootstrap utility classes */
.invalid-page td:nth-child(5).text-light,
.invalid-page td:nth-child(5) .text-light,
.invalid-page td:nth-child(5).text-muted,
.invalid-page td:nth-child(5) .text-muted,
.invalid-page td:nth-child(5).text-white,
.invalid-page td:nth-child(5) .text-white,
.invalid-page td[data-label="Scan Time"].text-light,
.invalid-page td[data-label="Scan Time"] .text-light,
.invalid-page td[data-label="Scan Time"].text-muted,
.invalid-page td[data-label="Scan Time"] .text-muted,
.invalid-page td[data-label="Scan Time"].text-white,
.invalid-page td[data-label="Scan Time"] .text-white {
	color: #000000 !important;
	font-weight: 600 !important;
	opacity: 1 !important;
}

/* ============================================
   MISSING SERIAL NUMBERS SECTION STYLES
   ============================================ */

/* Line Card Headers */
.missing-line-card-header {
	background: linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 100%);
	border: 1px solid #E5E7EB;
}

.missing-line-card-header.line-1-header {
	border-left: 4px solid #2563EB;
}

.missing-line-card-header.line-2-header {
	border-left: 4px solid #10B981;
}

/* Line Badges */
.line-badge {
	padding: 0.25rem 0.5rem;
	border-radius: 6px;
	font-weight: 600;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.line-badge.line-1-badge {
	background: #E6F2FF;
	color: #2563EB;
}

.line-badge.line-2-badge {
	background: #D1FAE5;
	color: #10B981;
}

/* Missing Count Badge */
.missing-count-badge {
	padding: 0.375rem 0.75rem;
	border-radius: 12px;
	font-weight: 700;
	font-size: 0.75rem;
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

.missing-count-badge.has-missing {
	background: #FEF3C7;
	color: #F59E0B;
}

.missing-count-badge.no-missing {
	background: #D1FAE5;
	color: #10B981;
}

/* Line Statistics Row */
.line-stats-row {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.5rem;
	margin-bottom: 0.5rem;
}

.line-stat-item {
	background: #F9FAFB;
	border-radius: 8px;
	padding: 0.75rem;
	text-align: center;
}

.line-stat-number {
	font-size: 1.125rem;
	font-weight: 700;
	margin-bottom: 0.125rem;
	color: #212529;
}

.line-stat-label {
	font-size: 0.625rem;
	color: #6B7280;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-weight: 500;
}

/* Missing Numbers Grid */
.missing-numbers-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 0.5rem;
	padding: 0.25rem;
	margin: -0.25rem;
}

.missing-numbers-grid::-webkit-scrollbar {
	width: 6px;
}

.missing-numbers-grid::-webkit-scrollbar-track {
	background: #F9FAFB;
	border-radius: 3px;
}

.missing-numbers-grid::-webkit-scrollbar-thumb {
	background: #E5E7EB;
	border-radius: 3px;
}

.missing-numbers-grid::-webkit-scrollbar-thumb:hover {
	background: #9CA3AF;
}

.missing-number-item {
	background: #FFFFFF;
	border: 2px solid #FEF3C7;
	border-radius: 8px;
	padding: 0.75rem;
	text-align: center;
	font-family: 'Courier New', monospace;
	font-weight: 600;
	font-size: 0.8125rem;
	color: #F59E0B;
	transition: all 0.2s ease;
	position: relative;
	overflow: hidden;
}

.missing-number-item::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	background: linear-gradient(90deg, #F59E0B 0%, #FCD34D 100%);
}

.missing-number-item:hover {
	background: #FEF3C7;
	border-color: #F59E0B;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Empty State */
.empty-state-icon-small {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #D1FAE5;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 0.5rem;
	font-size: 1.25rem;
	color: #10B981;
}

.empty-state {
	text-align: center;
}

.empty-state small {
	display: block;
}

/* ============================================
   ENHANCED DASHBOARD UI/UX - PROFESSIONAL REDESIGN
   ============================================ */

/* Dashboard Header */
.dashboard-header {
	margin-bottom: 2rem;
}

.dashboard-title-wrapper {
	padding: 0.5rem 0;
}

.dashboard-title {
	font-size: 1.75rem;
	font-weight: 700;
	color: #111827;
	letter-spacing: -0.02em;
	margin: 0;
	display: flex;
	align-items: center;
}

.dashboard-title i {
	font-size: 1.5rem;
	color: #2563EB;
}

.dashboard-subtitle {
	font-size: 0.875rem;
	color: #6B7280;
	margin-top: 0.25rem;
}

/* Stat Cards - Modern Design */
.stat-card {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1.25rem 1.5rem;
	background: #FFFFFF;
	border: 1px solid #E5E7EB;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	min-width: 160px;
	position: relative;
	overflow: hidden;
}

.stat-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, transparent, currentColor, transparent);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.stat-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	border-color: currentColor;
}

.stat-card:hover::before {
	opacity: 0.3;
}

.stat-card-icon {
	width: 48px;
	height: 48px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.5rem;
	background: linear-gradient(135deg, currentColor, currentColor);
	opacity: 0.1;
	flex-shrink: 0;
}

.stat-card-icon i {
	color: currentColor;
	opacity: 1;
}

.stat-card-content {
	flex: 1;
	min-width: 0;
}

.stat-card-number {
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.2;
	color: #111827;
	margin-bottom: 0.25rem;
}

.stat-card-label {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #6B7280;
}

.stat-card-success {
	border-left: 3px solid #10B981;
}

.stat-card-success .stat-card-icon {
	color: #10B981;
}

.stat-card-success .stat-card-number {
	color: #10B981;
}

.stat-card-danger {
	border-left: 3px solid #EF4444;
}

.stat-card-danger .stat-card-icon {
	color: #EF4444;
}

.stat-card-danger .stat-card-number {
	color: #EF4444;
}

.stat-card-primary {
	border-left: 3px solid #2563EB;
}

.stat-card-primary .stat-card-icon {
	color: #2563EB;
}

.stat-card-primary .stat-card-number {
	color: #2563EB;
}

/* Scan Card - Enhanced Design */
.scan-card {
	border: none;
	border-radius: 16px;
	overflow: hidden;
	background: #FFFFFF;
}

.scan-card-header {
	background: linear-gradient(135deg, #F8F9FA 0%, #FFFFFF 100%);
	border-bottom: 2px solid #E5E7EB;
	padding: 1.25rem 1.5rem;
}

.scan-card-icon-wrapper {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #FFFFFF;
	font-size: 1.5rem;
	flex-shrink: 0;
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.scan-card-header .card-title {
	font-size: 1.125rem;
	font-weight: 600;
	color: #111827;
	margin: 0;
}

.scan-card-header small {
	font-size: 0.8125rem;
	color: #6B7280;
}

/* Enhanced Form Controls */
.form-group-enhanced {
	margin-bottom: 1.5rem;
}

.form-label-enhanced {
	display: flex;
	align-items: center;
	font-weight: 600;
	font-size: 0.875rem;
	color: #374151;
	margin-bottom: 0.5rem;
	letter-spacing: 0.01em;
}

.form-label-enhanced i {
	color: #2563EB;
	font-size: 1rem;
}

.form-label-enhanced .text-danger {
	margin-left: 0.25rem;
	font-weight: 700;
}

.form-control-enhanced,
.form-select-enhanced {
	width: 100%;
	padding: 0.875rem 1rem;
	font-size: 1rem;
	font-weight: 500;
	color: #111827;
	background-color: #FFFFFF;
	border: 2px solid #E5E7EB;
	border-radius: 10px;
	transition: all 0.2s ease;
	line-height: 1.5;
}

.form-control-enhanced:focus,
.form-select-enhanced:focus {
	border-color: #2563EB;
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
	outline: none;
	background-color: #FFFFFF;
}

.form-control-enhanced::placeholder {
	color: #9CA3AF;
	font-weight: 400;
}

.scanning-input {
	font-family: 'Courier New', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 1.125rem;
	font-weight: 600;
	letter-spacing: 0.5px;
	padding: 1rem 1.25rem !important;
}

.form-text-enhanced {
	font-size: 0.75rem;
	color: #6B7280;
	margin-top: 0.5rem;
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.form-text-enhanced i {
	font-size: 0.875rem;
}

/* Enhanced Buttons */
.btn-primary-enhanced {
	background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
	border: none;
	color: #FFFFFF;
	font-weight: 600;
	padding: 0.875rem 1.5rem;
	border-radius: 10px;
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.btn-primary-enhanced:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
	background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%);
	color: #FFFFFF;
}

.btn-primary-enhanced:active {
	transform: translateY(0);
}

.btn-outline-enhanced {
	border: 2px solid #E5E7EB;
	background: #FFFFFF;
	color: #374151;
	font-weight: 600;
	padding: 0.875rem 1.5rem;
	border-radius: 10px;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.btn-outline-enhanced:hover {
	background: #F9FAFB;
	border-color: #D1D5DB;
	color: #111827;
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Status Indicator - Modern Design */
.status-indicator-card {
	background: linear-gradient(135deg, #F9FAFB 0%, #FFFFFF 100%);
	border: 2px dashed #D1D5DB;
	border-radius: 16px;
	padding: 2.5rem 1.5rem;
	text-align: center;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	min-height: 180px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.status-indicator-card.valid {
	background: linear-gradient(135deg, #D1FAE5 0%, #ECFDF5 100%);
	border-color: #10B981;
	border-style: solid;
	animation: pulseSuccess 0.6s ease-in-out;
}

.status-indicator-card.invalid {
	background: linear-gradient(135deg, #FEE2E2 0%, #FEF2F2 100%);
	border-color: #EF4444;
	border-style: solid;
	animation: pulseError 0.6s ease-in-out;
}

.status-indicator-content {
	width: 100%;
}

.status-icon-wrapper {
	margin-bottom: 1rem;
}

.status-icon-wrapper i {
	font-size: 3rem;
	color: #9CA3AF;
	transition: all 0.3s ease;
}

.status-indicator-card.valid .status-icon-wrapper i {
	color: #10B981;
}

.status-indicator-card.invalid .status-icon-wrapper i {
	color: #EF4444;
}

.status-text {
	font-size: clamp(2rem, 5vw, 3rem);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6B7280;
	display: block;
	line-height: 1.2;
	margin-bottom: 0.5rem;
	transition: all 0.3s ease;
}

.status-indicator-card.valid .status-text {
	color: #065F46;
}

.status-indicator-card.invalid .status-text {
	color: #991B1B;
}

.status-subtitle {
	font-size: 0.875rem;
	color: #9CA3AF;
	font-weight: 500;
	transition: all 0.3s ease;
}

.status-indicator-card.valid .status-subtitle {
	color: #059669;
}

.status-indicator-card.invalid .status-subtitle {
	color: #DC2626;
}

@keyframes pulseSuccess {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.02); }
}

@keyframes pulseError {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.02); }
}

/* History Card - Enhanced */
.history-card {
	border: none;
	border-radius: 16px;
	overflow: hidden;
	background: #FFFFFF;
}

.history-card-header {
	background: linear-gradient(135deg, #F8F9FA 0%, #FFFFFF 100%);
	border-bottom: 2px solid #E5E7EB;
	padding: 1.25rem 1.5rem;
}

.history-card-icon-wrapper {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #FFFFFF;
	font-size: 1.25rem;
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

.history-card-header .card-title {
	font-size: 1rem;
	font-weight: 600;
	color: #111827;
}

.form-select-filter {
	border: 1px solid #E5E7EB;
	border-radius: 6px;
	background: #FFFFFF;
	color: #374151;
	font-size: 0.8125rem;
	padding: 0.375rem 0.75rem;
	transition: all 0.2s ease;
}

.form-select-filter:focus {
	border-color: #2563EB;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
	outline: none;
}

.history-list {
	min-height: 500px;
	max-height: calc(100vh - 400px);
	overflow-y: auto;
	padding: 0.5rem;
}

.history-list::-webkit-scrollbar {
	width: 6px;
}

.history-list::-webkit-scrollbar-track {
	background: #F9FAFB;
	border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb {
	background: #D1D5DB;
	border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb:hover {
	background: #9CA3AF;
}

.history-empty-state {
	text-align: center;
	padding: 3rem 1.5rem;
	color: #9CA3AF;
}

.history-empty-state i {
	font-size: 3rem;
	margin-bottom: 1rem;
	opacity: 0.5;
}

/* Missing Card - Enhanced */
.missing-card {
	border: none;
	border-radius: 16px;
	overflow: hidden;
	background: #FFFFFF;
}

.missing-card-header {
	background: linear-gradient(135deg, #F8F9FA 0%, #FFFFFF 100%);
	border-bottom: 2px solid #E5E7EB;
	padding: 1.25rem 1.5rem;
}

.missing-card-icon-wrapper {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #FFFFFF;
	font-size: 1.25rem;
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.missing-card-header .card-title {
	font-size: 1rem;
	font-weight: 600;
	color: #111827;
}

.btn-refresh {
	border: 1px solid #F59E0B;
	color: #F59E0B;
	background: #FFFFFF;
	border-radius: 8px;
	padding: 0.375rem 0.75rem;
	transition: all 0.2s ease;
}

.btn-refresh:hover {
	background: #FEF3C7;
	border-color: #F59E0B;
	color: #92400E;
	transform: rotate(90deg);
}

/* Responsive Design */
@media (max-width: 991.98px) {
	.dashboard-title {
		font-size: 1.5rem;
	}
	
	.stat-card {
		min-width: 140px;
		padding: 1rem 1.25rem;
	}
	
	.stat-card-number {
		font-size: 1.5rem;
	}
	
	.scan-card-header,
	.history-card-header,
	.missing-card-header {
		padding: 1rem 1.25rem;
	}
	
	.scan-card-icon-wrapper,
	.history-card-icon-wrapper,
	.missing-card-icon-wrapper {
		width: 40px;
		height: 40px;
		font-size: 1.25rem;
	}
	
	.status-indicator-card {
		padding: 2rem 1rem;
		min-height: 160px;
	}
	
	.status-text {
		font-size: clamp(1.5rem, 8vw, 2.5rem);
	}
}

@media (max-width: 575.98px) {
	.dashboard-header {
		margin-bottom: 1.5rem;
	}
	
	.dashboard-title {
		font-size: 1.25rem;
	}
	
	.dashboard-subtitle {
		font-size: 0.75rem;
	}
	
	.stat-card {
		min-width: 100%;
		padding: 1rem;
		gap: 0.75rem;
	}
	
	.stat-card-icon {
		width: 40px;
		height: 40px;
		font-size: 1.25rem;
	}
	
	.stat-card-number {
		font-size: 1.25rem;
	}
	
	.scan-card .card-body,
	.history-card .card-body,
	.missing-card .card-body {
		padding: 1rem !important;
	}
	
	.form-control-enhanced,
	.form-select-enhanced {
		padding: 0.75rem;
		font-size: 0.9375rem;
	}
	
	.scanning-input {
		font-size: 1rem;
		padding: 0.875rem 1rem !important;
	}
	
	.btn-primary-enhanced,
	.btn-outline-enhanced {
		padding: 0.75rem 1.25rem;
		font-size: 0.9375rem;
	}
	
	.status-indicator-card {
		padding: 1.5rem 1rem;
		min-height: 140px;
	}
	
	.status-text {
		font-size: clamp(1.25rem, 10vw, 2rem);
	}
	
	.status-icon-wrapper i {
		font-size: 2rem;
	}
}

/* Heatmap styles */
.heatmap-table th, .heatmap-table td {
	transition: background-color 0.3s ease, color 0.2s ease, transform 0.15s ease;
	border-color: var(--border-color) !important;
}

.heatmap-cell:hover {
	transform: scale(1.03);
	outline: 0;
}

.heatmap-header-cell {
	font-weight: 600;
}

.heatmap-legend-swatch {
	width: 32px;
	height: 18px;
	border: 1px solid #ced4da;
	border-radius: 3px;
}

@media (max-width: 991.98px) {
	.heatmap-table {
		font-size: 0.8rem;
	}
	.heatmap-table th, .heatmap-table td {
		min-width: 42px;
		padding: 6px;
	}
}

@media (max-width: 575.98px) {
	.heatmap-table th, .heatmap-table td {
		min-width: 34px;
		padding: 4px;
	}
}
