.main {
	transition: margin-left 0.3s ease-in-out;
}

.main.sidebar-open {
	margin-left: 280px;
}

@media (max-width: 768px) {
	.main.sidebar-open {
		margin-left: 0;
	}
}

/* Enhanced Header Styles */
#appHeader {
	background: linear-gradient(135deg, #1F2A44 0%, #2d3f63 100%) !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	backdrop-filter: blur(10px);
	position: relative;
	z-index: 1030;
	overflow: visible !important;
}

#appHeader::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.3) 50%, transparent);
}

#appHeader .btn-link {
	transition: all 0.3s ease;
	border-radius: 8px;
}

#appHeader .btn-link:hover {
	background-color: rgba(14, 165, 233, 0.15);
	transform: translateY(-1px);
}

#appHeader .notification-btn {
	position: relative;
	color: #0EA5E9 !important;
}

#appHeader .notification-btn .badge {
	position: absolute;
	top: 0;
	right: 0;
	transform: translate(25%, -25%);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	animation: pulse 2s infinite;
	background-color: #10B981 !important;
}

@keyframes pulse {

	0%,
	100% {
		transform: translate(25%, -25%) scale(1);
	}

	50% {
		transform: translate(25%, -25%) scale(1.1);
	}
}

#appHeader .dropdown-toggle {
	background-color: rgba(14, 165, 233, 0.15);
	color: white;
	border: 1px solid rgba(14, 165, 233, 0.3);
	border-radius: 8px;
	padding: 0.4rem 0.85rem;
	transition: all 0.3s ease;
	font-weight: 500;
	font-size: 0.9rem;
}

#appHeader .dropdown-toggle:hover {
	background-color: #0EA5E9;
	border-color: #0EA5E9;
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#appHeader .brand-text {
	font-weight: 700;
	letter-spacing: 0.5px;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#appHeader #chatToggle {
	color: #0EA5E9 !important;
}

/* Body Background */
body {
	background-color: #F4F6F8;
}

/* Page Header Styling */
.page-header {
	background-color: white !important;
	border-bottom: 1px solid #e5e7eb !important;
}

.page-header .btn-primary {
	background: linear-gradient(135deg, #0EA5E9 0%, #0284c7 100%);
	border: none;
	box-shadow: 0 2px 4px rgba(14, 165, 233, 0.2);
}

.page-header .btn-primary:hover {
	background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
	box-shadow: 0 4px 8px rgba(14, 165, 233, 0.3);
}

/* Tablet/Mobile Page Header Styles */
@media (max-width: 991px) {
	.page-header>div:first-child p.text-muted {
		display: none;
	}

	.page-header .btn-secondary {
		display: none !important;
	}
}

@media (max-width: 768px) {
	.page-header {
		padding: 0.5rem 0.75rem !important;
		min-height: auto !important;
	}

	.page-header>div:first-child {
		display: none !important;
	}

	.page-header>div:last-child {
		width: 100%;
		justify-content: space-between !important;
		gap: 0.5rem !important;
	}

	#datatable-length-container {
		display: none !important;
	}

	#datatable-search-container {
		flex: 1 1 auto;
		max-width: calc(100% - 50px);
	}

	#datatable-search-container .dataTables_filter {
		margin: 0;
	}

	#datatable-search-container .dataTables_filter label {
		margin: 0;
		width: 100%;
	}

	#datatable-search-container .dataTables_filter input {
		width: 100% !important;
		padding: 0.375rem 0.5rem;
		font-size: 0.875rem;
	}

	.page-header .btn-primary {
		padding: 0.375rem 0.5rem;
		font-size: 0.875rem;
		flex-shrink: 0;
	}
}

/* Dropdown Menu Fix */
.dropdown-menu {
	z-index: 1040;
}

#appHeader .dropdown {
	position: relative;
}

/* Enhanced Quick Actions Dropdown */
#appHeader .dropdown-menu {
	background: white;
	border: none;
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
	padding: 0.5rem 0;
	min-width: 260px;
	margin-top: 0.75rem !important;
}

#appHeader .dropdown-header {
	color: #1F2A44;
	font-weight: 700;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 0.75rem 1rem 0.5rem;
	margin-top: 0.25rem;
}

#appHeader .dropdown-item {
	padding: 0.65rem 1rem;
	color: #212529;
	transition: all 0.2s ease;
	border-radius: 6px;
	margin: 0.125rem 0.5rem;
	display: flex;
	align-items: center;
	font-weight: 500;
}

#appHeader .dropdown-item:hover {
	background: linear-gradient(135deg, #0EA5E9 0%, #0284c7 100%);
	color: white;
	transform: translateX(4px);
}

#appHeader .dropdown-item i {
	width: 20px;
	text-align: center;
	opacity: 0.8;
}

#appHeader .dropdown-item:hover i {
	opacity: 1;
}

#appHeader .dropdown-divider {
	margin: 0.5rem 1rem;
	border-top-color: #e5e7eb;
}

#appHeader .qa-add-shipment {
	background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(14, 165, 233, 0.05) 100%);
	border-left: 3px solid #0EA5E9;
	font-weight: 600;
}

#appHeader .qa-add-shipment:hover {
	background: linear-gradient(135deg, #0EA5E9 0%, #0284c7 100%);
	border-left-color: #0EA5E9;
	transform: translateX(0) !important;
}

/* Sticky Table Header */
.main .table-responsive {
	overflow: visible !important;
	height: 100%;
	position: relative;
	width: 100%;
}

.main .table thead {
	position: sticky;
	top: 0;
	z-index: 10;
}

.main .table thead th {
	background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
	border-bottom: 2px solid #0EA5E9;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
	position: relative;
	font-weight: 600;
	color: #1F2A44;
	text-transform: uppercase;
	font-size: 0.75rem;
	letter-spacing: 0.5px;
	padding: 0.875rem 0.75rem;
}

.main .table {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	border-collapse: separate;
	border-spacing: 0;
}

.main .table tbody tr {
	transition: all 0.2s ease;
	border-bottom: 1px solid #f0f0f0;
	position: relative;
}

.main .table tbody tr:hover {
	background-color: rgba(14, 165, 233, 0.08);
	box-shadow: inset 3px 0 0 #0EA5E9;
}

.main .table tbody tr:hover td {
	color: #1F2A44;
}

.main .table tbody td {
	padding: 0.875rem 0.75rem;
	vertical-align: middle;
	font-size: 0.875rem;
	color: #212529;
}

.main .table tbody tr:last-child {
	border-bottom: none;
}

/* Badge styling */
.main .table .badge {
	padding: 0.35rem 0.65rem;
	font-weight: 600;
	font-size: 0.75rem;
	border-radius: 6px;
}

/* DataTables Custom Styling */
#datatable-length-container .dataTables_length,
#datatable-search-container .dataTables_filter {
	margin: 0;
}

#datatable-search-container .dataTables_filter input {
	border-radius: 6px;
	border: 1px solid #dee2e6;
	padding: 0.375rem 0.75rem;
	font-size: 0.875rem;
}

#datatable-length-container .dataTables_length select {
	border-radius: 6px;
	border: 1px solid #dee2e6;
	padding: 0.375rem 0.5rem 0.375rem 0.75rem;
	font-size: 0.875rem;
	background-color: white;
	margin: 0 0.25rem;
	min-width: 65px;
}

#datatable-length-container .dataTables_length label {
	margin-bottom: 0;
	font-weight: 500;
	font-size: 0.875rem;
	display: flex;
	align-items: center;
	gap: 0;
	white-space: nowrap;
}

#datatable-search-container .dataTables_filter label {
	margin-bottom: 0;
	font-weight: 500;
	font-size: 0.875rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.table-footer {
	box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
}

#datatable-info-container .dataTables_info {
	margin: 0;
	font-size: 0.875rem;
	color: #6c757d;
}

#datatable-pagination-container .dataTables_paginate {
	margin: 0;
}

.dataTables_paginate .pagination {
	margin: 0;
	flex-wrap: wrap;
}

/* Mobile pagination styling */
@media (max-width: 576px) {
	.table-footer {
		flex-direction: column !important;
		gap: 0.75rem;
		align-items: flex-start !important;
	}

	#datatable-info-container {
		width: 100%;
		text-align: center;
	}

	#datatable-pagination-container {
		width: 100%;
		display: flex;
		justify-content: center;
	}

	.dataTables_paginate .pagination {
		justify-content: center;
	}

	.dataTables_paginate .pagination .page-link {
		padding: 0.375rem 0.625rem;
		font-size: 0.875rem;
		min-width: 36px;
		text-align: center;
	}
}

/* Footer Styles */
.footer {
	box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
	font-size: 0.875rem;
}

.footer .container-fluid {
	max-width: 1400px;
	margin: 0 auto;
}

.footer a {
	transition: all 0.3s ease;
	text-decoration: none;
}

.footer a:hover {
	transform: translateY(-1px);
}

.footer .badge {
	animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0.8;
	}
}

/* Mobile Footer Styles */
@media (max-width: 768px) {
	.footer {
		font-size: 0.7rem !important;
	}

	.footer .container-fluid {
		padding: 0.75rem 1rem !important;
	}

	.footer .row {
		text-align: center;
		gap: 0;
	}

	.footer .col-md-6 {
		width: 100%;
		padding: 0;
	}

	.footer .col-md-6:first-child .d-flex {
		justify-content: center !important;
		flex-wrap: wrap;
		gap: 0.25rem;
	}

	.footer .col-md-6:last-child {
		display: none !important;
	}

	.footer .fa-truck {
		font-size: 0.9em !important;
		margin-right: 0.25rem !important;
	}

	.footer .fw-bold {
		font-size: 0.85rem !important;
		margin-right: 0.5rem !important;
	}

	.footer small {
		font-size: 0.65rem !important;
		display: block;
		width: 100%;
		margin-top: 0.25rem;
	}

	.footer .mt-3 {
		margin-top: 0 !important;
	}
}

/* Sidebar Styles */
#sidebarOffcanvas {
	background: linear-gradient(180deg, #1F2A44 0%, #16202F 100%);
	border-right: 3px solid #0EA5E9;
}

/* Full screen sidebar on mobile */
@media (max-width: 768px) {
	#sidebarOffcanvas {
		width: 100% !important;
		max-width: 100% !important;
		margin-top: 60px !important;
	}
}

#sidebarOffcanvas .offcanvas-header {
	background: rgba(14, 165, 233, 0.1);
	border-bottom-color: rgba(14, 165, 233, 0.3) !important;
}

.sidebar-user {
	width: 100%;
}

.sidebar-user .bg-primary {
	background: linear-gradient(135deg, #0EA5E9 0%, #0284c7 100%) !important;
}

.sidebar-nav {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding-left: 0.75rem;
	padding-right: 0.75rem;
}

.sidebar-nav .nav-link {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	color: rgba(255, 255, 255, 0.8);
	text-decoration: none;
	border-radius: 8px;
	transition: all 0.3s ease;
	font-size: 0.9375rem;
	font-weight: 500;
	position: relative;
	overflow: hidden;
}

.sidebar-nav .nav-link::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	width: 3px;
	background: #0EA5E9;
	transform: scaleY(0);
	transition: transform 0.3s ease;
}

.sidebar-nav .nav-link i {
	font-size: 1.125rem;
	width: 20px;
	text-align: center;
	color: #0EA5E9;
	transition: all 0.3s ease;
}

.sidebar-nav .nav-link:hover {
	background: rgba(14, 165, 233, 0.15);
	color: #ffffff;
	transform: translateX(4px);
}

.sidebar-nav .nav-link:hover::before {
	transform: scaleY(1);
}

.sidebar-nav .nav-link:hover i {
	transform: scale(1.1);
	color: #0EA5E9;
}

.sidebar-nav .nav-link.active {
	background: linear-gradient(135deg, rgba(14, 165, 233, 0.25) 0%, rgba(14, 165, 233, 0.15) 100%);
	color: #ffffff;
	border-left: 3px solid #0EA5E9;
}

.sidebar-nav .nav-link.active i {
	color: #0EA5E9;
}

.sidebar-nav .nav-divider {
	margin: 0.5rem 0;
	border-top: 1px solid rgba(14, 165, 233, 0.2) !important;
}

/* Sidebar scrollbar styling */
#sidebarOffcanvas .offcanvas-body {
	scrollbar-width: thin;
	scrollbar-color: #0EA5E9 rgba(14, 165, 233, 0.1);
}

#sidebarOffcanvas .offcanvas-body::-webkit-scrollbar {
	width: 6px;
}

#sidebarOffcanvas .offcanvas-body::-webkit-scrollbar-track {
	background: rgba(14, 165, 233, 0.1);
}

#sidebarOffcanvas .offcanvas-body::-webkit-scrollbar-thumb {
	background: #0EA5E9;
	border-radius: 3px;
}

#sidebarOffcanvas .offcanvas-body::-webkit-scrollbar-thumb:hover {
	background: #0284c7;
}

/* Mobile Card View */
@media (max-width: 768px) {
	.primary-table-container {
		display: none !important;
	}

	.mobile-cards-container {
		display: block !important;
	}

	.mobile-entity-card {
		background: white;
		border-radius: 8px;
		padding: 0;
		margin-bottom: 0.5rem;
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
		border: 1px solid #e5e7eb;
		overflow: hidden;
		transition: all 0.3s ease;
		cursor: pointer;
	}

	.mobile-entity-card:hover {
		box-shadow: 0 6px 20px rgba(14, 165, 233, 0.15);
		transform: translateY(-3px);
		border-color: #0EA5E9;
	}

	.mobile-card-header {
		background: linear-gradient(135deg, #1F2A44 0%, #2d3f63 100%);
		padding: 0.75rem 1rem;
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-bottom: 3px solid #0EA5E9;
	}

	.mobile-card-number {
		font-weight: 700;
		font-size: 1.1rem;
		color: white;
		display: flex;
		align-items: center;
		gap: 0.5rem;
	}

	.mobile-card-number i {
		color: #0EA5E9;
		font-size: 1.2rem;
	}

	.mobile-card-body {
		padding: 0.75rem 1rem;
	}

	.mobile-card-body .card-row {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0.5rem 0;
		border-bottom: 1px solid #f3f4f6;
		gap: 1rem;
	}

	.mobile-card-body .card-row:last-child {
		border-bottom: none;
		padding-bottom: 0;
	}

	.mobile-card-body .card-label {
		font-size: 0.75rem;
		color: #6b7280;
		font-weight: 600;
		text-transform: uppercase;
		letter-spacing: 0.5px;
		display: flex;
		align-items: center;
		gap: 0.5rem;
		white-space: nowrap;
	}

	.mobile-card-body .card-label i {
		color: #0EA5E9;
		font-size: 0.875rem;
	}

	.mobile-card-body .card-value {
		font-size: 0.9rem;
		color: #1F2A44;
		font-weight: 600;
		text-align: right;
		flex: 1;
		overflow: hidden;
		text-overflow: ellipsis;
	}
}

@media (min-width: 769px) {
	.mobile-cards-container {
		display: none !important;
	}
}

/* Modal Styles */
.modal-header {
	background: linear-gradient(135deg, #1F2A44 0%, #2d3f63 100%);
	border-bottom: 3px solid #0EA5E9;
	padding: 1rem 1.5rem;
}

.modal-header.bg-danger {
	background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
	border-bottom-color: #bd2130;
}

.modal-header.bg-success {
	background: linear-gradient(135deg, #28a745 0%, #218838 100%) !important;
	border-bottom-color: #1e7e34;
}

.modal-header.bg-warning {
	background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
	border-bottom-color: #d39e00;
}

.modal-header .modal-title {
	color: white;
	font-weight: 700;
	font-size: 1.25rem;
}

.modal-header .btn-close {
	filter: invert(1) grayscale(100%) brightness(200%);
	opacity: 0.8;
	transition: all 0.3s ease;
}

.modal-header .btn-close:hover {
	opacity: 1;
	transform: rotate(90deg);
}

.modal-content {
	border: none;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-body .nav-pills .nav-link {
	color: #1F2A44;
	font-weight: 600;
	border-radius: 8px;
	padding: 0.625rem 1.25rem;
	transition: all 0.3s ease;
	position: relative;
}

.modal-body .nav-pills .nav-link:hover {
	background-color: rgba(14, 165, 233, 0.1);
	color: #0EA5E9;
}

.modal-body .nav-pills .nav-link.active {
	background: linear-gradient(135deg, #0EA5E9 0%, #0284c7 100%);
	color: white;
	box-shadow: 0 4px 8px rgba(14, 165, 233, 0.3);
}

.modal-body .form-label {
	color: #1F2A44;
	font-weight: 600;
	font-size: 0.875rem;
	margin-bottom: 0.5rem;
}

.modal-footer {
	border-top: 1px solid #e5e7eb;
	padding: 1rem 1.5rem;
	background-color: #f8f9fa;
}

.modal-footer .btn {
	border-radius: 6px;
	padding: 0.625rem 1.5rem;
	font-weight: 600;
	transition: all 0.3s ease;
}

.modal-footer .btn-secondary {
	background-color: #6c757d;
	border-color: #6c757d;
}

.modal-footer .btn-secondary:hover {
	background-color: #5a6268;
	border-color: #545b62;
	transform: translateY(-1px);
}

.modal-footer .btn-primary {
	background: linear-gradient(135deg, #0EA5E9 0%, #0284c7 100%);
	border: none;
	box-shadow: 0 2px 4px rgba(14, 165, 233, 0.2);
}

.modal-footer .btn-primary:hover {
	background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
	box-shadow: 0 4px 8px rgba(14, 165, 233, 0.3);
	transform: translateY(-1px);
}