:root {
	--primary-color: #01497c;
	--primary-color-dark: #013a63;
	--secondary-color: #2a6f97;
	--background-color: #d0e5fa;
	--header-color: #012a4a;
	--text-color: #012a4a;
	--table-hover: #d0d8e8;
	--button-color: #91bcd6;
	--button-hover: #4f96be;
	--green: #28a745;
	--dark-green: #218838;
}

.left-menu {
	width: 100%;
	background-color: var(--primary-color);
	color: white;
	padding: 20px;
	height: 100%;
}

.dropdown-header {
	list-style: none;
	margin: 10px 0;
	padding: 10px;
	border-radius: 4px;
	text-decoration: underline;
	font-size: 1em;
	cursor: pointer;
	font-weight: bold;
	color: var(--primary-color-dark);
	text-transform: capitalize;
	display: block;
	user-select: none;
	background-color: var(--background-color);
}

.submenu {
	display: none;
	margin-left: 15px;
	padding-left: 10px;
	border-left: 2px solid #ccc;
}

.submenu li a {
	display: block;
	padding: 4px;
	text-decoration: none;
}

.submenu li a:hover {
	background-color: var(--background-color);
	border-radius: 4px;
}

.dropdown.open .submenu {
	display: block;
}

body {
	font-family: Arial, sans-serif;
	background-color: var(--background-color);
	margin: 0;
	padding: 20px;
	color: var(--text-color);
	font-family: Arial, sans-serif;
	height: 100%;
}

html {
	height: 100vh;
}

h1 {
	color: var(--header-color);
}

button {
	padding: 8px 12px;
	background-color: var(--button-color);
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.2s;
}

button:hover {
	background-color: var(--button-hover);
}

button:disabled {
	background-color: #ccc;
	color: #666;
	cursor: not-allowed;
}

.popup,
.popup2 {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background-color: white;
	padding: 20px;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
	z-index: 1000;
	color: var(--text-color);
	overflow-y: auto;
	max-height: 90vh;
	z-index: 9999;
}

.popup>h2 {
	text-align: center;
}

.popup .button-container {
	display: flex;
	justify-content: space-between;
	margin-top: 20px;
}

.popup2>div {
	display: flex;
	justify-content: space-evenly;
	margin-top: 20px;
	align-items: center;
}

a {
	color: var(--primary-color);
	text-decoration: none;
	font-weight: bold;
	margin-top: 20px;
	display: inline-block;
}

a:hover {
	color: var(--primary-color-dark);
	text-decoration: underline;
}

.main-container {
	display: flex;
	flex-direction: row;
	width: 100%;
	min-height: 100vh;
}

aside {
	background-color: #f4f4f4;
	width: 6%;
	padding: 20px;
	min-width: 100px;
	border-radius: 25px 0px 0px 25px;
	overflow-y: auto;
}

.content {
	flex: 1;
	padding: 20px;
	background-color: #fff;
	border-radius: 0px 25px 25px 0px;
}

aside nav ul {
	list-style-type: none;
	padding: 0;
}

.nav-header {
	font-weight: bold;
	margin-top: 10px;
	font-size: 1em;
	text-transform: uppercase;
}

.autocomplete-container {
	position: relative;
	width: 100%;
}

.suggestions {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	border: 1px solid #ccc;
	border-top: none;
	background-color: white;
	z-index: 99;
	max-height: 150px;
	overflow-y: auto;
}

.suggestions div {
	padding: 8px;
	cursor: pointer;
}

.suggestions div:hover {
	background-color: #e9e9e9;
}

.hidden {
	display: none !important;
}

.notification-info {
	background-color: #d1ecf1;
	color: #0c5460;
	padding: 10px;
	border-radius: 5px;
}

.notification-error {
	background-color: #f8d7da;
	color: #721c24;
	padding: 10px;
	border-radius: 5px;
}

.notification-success {
	background-color: #d4edda;
	color: #155724;
	padding: 10px;
	border-radius: 5px;
}

input:disabled {
	background-color: lightgray;
	cursor: not-allowed;
}

input,
.tri-state-checkbox {
	padding: 10px 15px;
	font-size: 18px;
	border: 2px solid #ccc;
	border-radius: 8px;
	outline: none;
	background-color: #f9f9f9;
	transition: all 0.3s ease;
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
	width: 100%;
	box-sizing: border-box;
}

input:focus {
	border-color: var(--primary--color);
	box-shadow: 0 0 0 3px rgba(1, 58, 99, 0.5);
}

.fade-out {
	opacity: 0;
	transition: opacity 0.5s ease-out;
}

.filters {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1rem;
	padding: 1rem;
	background: #f9f9f9;
	border-radius: 8px;
	font-family: sans-serif;
}

.filters label,
.filters>span {
	display: flex;
	flex-direction: column;
	font-size: 0.9rem;
	font-weight: 500;
	color: #333;
}

#filtersContainer input[type="search"],
#filtersContainer input[type="number"],
#filtersContainer input[type="date"],
#filtersContainer input[type="text"]:not(.tri-state-checkbox),
#filtersContainer input[type="datetime-local"] {
	margin-top: 4px;
	padding: 6px 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 0.9rem;
	width: 100%;
}

#filtersContainer #totalProducts {
	font-weight: bold;
	color: #333;
	margin-top: 10px;
	margin-left: 10px;
}

#filtersContainer #selectedProductsCount {
	font-weight: bold;
	color: #333;
	margin-top: 10px;
	margin-left: 10px;
}

#filtersContainer button {
	margin: 0 5px;
}

.tri-state-checkbox {
	margin-top: 4px;
	height: 34px;
	width: 34px;
	cursor: pointer;
	user-select: none;
	display: flex;
	justify-content: center;
	align-items: center;
}

.tri-state-checkbox-label {
	max-width: 34px;
	text-wrap: nowrap;
}

.null-state {
	background-color: #f0f0f0;
	color: #aaa;
}

.true-state {
	background-color: #4caf50;
	color: white;
}

.false-state {
	background-color: #f44336;
	color: white;
}

.filters button#filterButton {
	align-self: end;
	padding: 8px 12px;
	font-size: 0.9rem;
	font-weight: 600;
	background-color: #2196f3;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.2s ease-in-out;
}

.sortableTable th:not(.unsortable) {
	user-select: none;
	cursor: pointer;
}

.sortableTable .sort-asc::after {
	content: " ▲";
	color: var(--primary-color);
}

.sortableTable .sort-desc::after {
	content: " ▼";
	color: var(--primary-color);
}

.tabs,
.tabs-header {
	display: flex;
	border-bottom: 2px solid var(--background-color);
	gap: 6px;
	margin-bottom: 3px;
	padding-bottom: 2px;
}

.tabs-sub-header {
	font-size: 0.9em;
	gap: 6px;
	display: flex;

}

.tab,
.tab-btn,
.sub-tab-btn {
	padding: 10px 20px;
	cursor: pointer;
	border-bottom: none;
	margin-right: 1px;
	text-transform: capitalize;
}

.tab-active,
.tab-btn.active,
.sub-tab-btn.active {
	background-color: var(--secondary-color);
	font-weight: bold;
}

.tab-locked {
	pointer-events: none;
}

.tabs-content {
	padding: 8px;
}

.sub-tab-separator {
	padding: 0 10px;
	font-size: 0.75em;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #888;
	pointer-events: none;
	user-select: none;
	align-self: center;
}

.sub-tab-separator::before {
	content: "";
	display: inline-block;
	width: 1px;
	height: 14px;
	background: #ccc;
	margin-right: 8px;
}

.iframe-popup {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 80%;
	height: 80%;
	background-color: white;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
	z-index: 1000;
}

.iframe-popup iframe {
	width: 100%;
	height: 100%;
	border: none;
}

.close-iframe-popup-button,
.cancelButton {
	background-color: red;
	color: white;
	padding: 10px 20px;
	border: none;
}

.cancelButton:hover {
	background-color: darkred;
}

table {
	background-color: #ffffff;
	width: 100%;
	text-align: left;
	border-collapse: collapse;
	table-layout: fixed;
	/* min-width: 850px; */
}

table td .row-checkbox {
	width: auto !important;
}

table td:has(.row-checkbox) {
	text-align: center;
}

table td,
table th {
	padding: 3px 2px;
	overflow-wrap: break-word;
	min-width: 50px;
}

table tbody td {
	font-size: 13px;
	border: 1px solid #dddddd;
	min-width: 50px;
}

thead th {
	position: sticky;
	top: 0;
}

table tr:nth-child(even) {
	background: #f5fafd;
}

table thead {
	background: #2a6f97;
}

table thead th {
	font-weight: bold;
	color: #ffffff;
	text-align: center;
}

table thead th:first-child {
	border-left: none;
}

#pagination {
	text-align: right;
	margin-bottom: 5px;
	min-height: 20px;
}

#pagination button {
	display: inline-block;
	background: var(--button-color);
	color: white;
	padding: 6.5px 10.5px;
	border-radius: 5px;
	margin: 0 2px;
}

table>tbody>tr>td>img {
	width: 50px;
	height: 50px;
	border-radius: 50%;
}

td>button>img {
	height: 50%;
	width: 50%;
	cursor: pointer;
	padding: 0;
	pointer-events: none;
}

table td:has(button) {
	text-align: center;
}

tr:nth-child(even) {
	background-color: #f5fafd;
}

tr:nth-child(even):hover {
	background-color: var(--table-hover);
}

th {
	background-color: var(--secondary-color);
	color: white;
	max-height: 100px;
	height: 50px;
}

tr:hover {
	background-color: var(--table-hover);
}

tr {
	height: 50px;
}

td .checkbox {
	width: 25px;
	height: 25px;
}

td:has(img) {
	text-align: center;
}

.table-actions-menu {
	position: absolute;
	background-color: white;
	border: 1px solid #ccc;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	z-index: 1000;
	border-radius: 5px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.table-actions-menu .actions-list {
	list-style: none;
	padding: 0;
	margin: 0;
	text-align: left;
}

.table-actions-menu>.actions-list>li>button {
	width: 100%;
	padding: 10px;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	border-radius: 0;
}

#pagination .active {
	background-color: var(--secondary-color);
	color: white;
}

#notificationCenter {
	background-color: #f4f4f4;
	position: fixed;
	top: 0;
	right: 0;
	/* Sticks to top while scrolling */
	color: white;
	margin-right: 20px;
	z-index: 1000;
}

#notificationCenter>button {
	width: 100%;
}

.notifications {
	padding-top: 5px;
	max-height: 100vh;
	max-width: 300px;
	overflow-y: auto;
	transition: max-height 0.5s ease, max-width 0.5s ease, opacity 0.3s ease,
		padding 0.3s ease;
	transform-origin: top right;
	/* adjust if you want it to grow from a corner */
	/* large enough to show content */
	opacity: 1;
}

.notifications.hid {
	max-height: 0;
	max-width: 0;
	opacity: 0;
	padding: 0;
	overflow: hidden;
	transition: max-height 0.5s ease, max-width 0.5s ease, opacity 0.3s ease,
		padding 1s ease;
	transform-origin: top right;
	/* adjust if you want it to grow from a corner */
}

#notification-tiles {
	display: grid;
	grid-template-rows: repeat(1, 1fr);
	gap: 5px;
}

.notification-tile {
	padding: 5px;
	height: fit-content;
	background-color: #87cefa;
	border-radius: 5px;
}

.notification-tile>div {
	cursor: pointer;
}

.notification-tile .time {
	font-size: small;
	color: gray;
}

.notification-tile.error>button {
	background-color: #721c24;
}

.notification-tile.error .time {
	color: rgb(61, 61, 61);
}

.notification-tile.error {
	background-color: #fa8787;
	color: #721c24;
}

.notification-tile.error .notification-tile-contents {
	background-color: #f5b1b1;
	color: #721c24;
}

.notification-tile .notification-tile-contents {
	background-color: #b1dbf5;
	border-radius: 5px;
	padding: 5px;
}

#loader-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background-color: rgba(255, 255, 255, 0.5);
	backdrop-filter: dim(5px);
	/* adds blur to what's behind */
	display: none;
	z-index: 9999;
}

#loader-overlay.active {
	display: flex;
	justify-content: center;
	align-items: center;
}

.overlay {
	z-index: 9998;
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.3);
}

/* Spinner */
.spinner {
	border: 4px solid #ccc;
	border-top: 4px solid #555;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	animation: spin 1s linear infinite;
}

.new-ean {
	font-weight: bold;
	text-decoration: underline;
}

.new-ean:hover {
	color: #01497c;
}

.new-ean:hover::after {
	content: "";
	display: inline-block;
	vertical-align: middle;
	margin-left: 8px;
	width: 15px;
	height: 15px;
	background-image: url("/icons/copy-icon.png");
	background-size: contain;
	background-repeat: no-repeat;
}

.new-ean.clicked::after {
	animation: checkmark-fade 0.8s forwards;
	content: "";
	display: inline-block;
	vertical-align: middle;
	margin-left: 8px;
	width: 15px;
	height: 15px;
	background-image: url("/icons/check-box-icon.png");
	background-size: contain;
	background-repeat: no-repeat;
	opacity: 0;
}

.delete-button {
	background-color: #f44336;
	color: white;
	padding: 8px 12px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
}

.delete-button:hover {
	background-color: #d32f2f;
}

.disabled {
	background-color: #ccc;
	color: #666;
	cursor: not-allowed;
}

.disabled:hover {
	background-color: #ccc;
	color: #666;
	cursor: not-allowed;
}

@keyframes checkmark-fade {
	0% {
		opacity: 0;
		transform: scale(0.5) rotate(-30deg);
	}

	30% {
		opacity: 1;
		transform: scale(1.2) rotate(10deg);
	}

	60% {
		opacity: 1;
		transform: scale(1) rotate(0deg);
	}

	100% {
		opacity: 0;
		transform: scale(0.8) rotate(0deg);
	}
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}
.popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.3);
	z-index: 9998;
}
.popup-show {
	display: block;
}
.popup-container {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background-color: white;
	padding: 20px;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
	z-index: 9999;
	color: var(--text-color);
	overflow-y: auto;
	max-height: 90vh;
	max-width: 80vw;
}
.popup-footer {
	display: flex;
	justify-content: flex-end;
}
.popup-buttons {
	display: flex;
	gap: 10px;
}