* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	--primary: #1e3a8a;
	--secondary: #0891b2;
	--accent: #f59e0b;
	--success: #10b981;
	--danger: #ef4444;
	--warning: #f97316;
	--light: #f9fafb;
	--lighter: #f3f4f6;
	--dark: #1f2937;
	--gray: #6b7280;
	--border: #e5e7eb;
}

body {
	font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
	background-color: var(--light);
	color: var(--dark);
	line-height: 1.6;
}

.container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 20px;
}

#alertContainer {
	position: fixed;
	top: 20px;
	right: 20px;
	left: 20px;
	z-index: 2000;
	display: flex;
	flex-direction: column;
	gap: 10px;
	pointer-events: none;
	align-items: center;
}

.alert {
	min-width: 300px;
	max-width: 600px;
	width: 100%;
	padding: 14px 18px;
	border-radius: 8px;
	color: white;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
	pointer-events: auto;
	opacity: 0.98;
}

.alert-info {
	background-color: rgba(30, 58, 138, 0.95);
}

.alert-success {
	background-color: rgba(16, 185, 129, 0.95);
}

.alert-error,
.alert-danger {
	background-color: rgba(239, 68, 68, 0.95);
}

.alert-warning {
	background-color: rgba(249, 115, 22, 0.95);
}

/* ========== LAYOUT ========== */
.app-layout {
	display: flex;
	min-height: 100vh;
	background-color: var(--light);
}

.sidebar {
	display: flex !important;
	flex-direction: column;
	position: fixed;
	left: 0;
	width: 250px;
	background-color: var(--primary);
	color: white;
	padding: 20px;
	height: 100vh;
	overflow-y: auto;
	box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
	transition: width 0.3s ease;
	z-index: 1000;
}

/* Push the profile section to the bottom */
.sidebar .user-profile {
	margin-top: auto; /* This is the key change */
	padding-top: 20px;
	border-top: 1px solid #eee; /* Optional: adds a nice separator */
}

/* 1. Hide text and enlarge icon when sidebar is mini */
.sidebar.mini .nav-btn {
	/* Ensure the button centers the icon */
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 12px 0; /* Adjust padding for mini state */
	font-size: 0; /* Hides the direct text nodes inside the button */
}

.sidebar.mini .nav-btn i {
	font-size: 24px; /* Enlarges the icon to 24px */
}

/* 2. Normal state (when .mini is NOT present) */
.sidebar:not(.mini) .nav-btn {
	display: flex;
	align-items: center;
	font-size: 14px; /* Restore text size */
	gap: 10px; /* Add space between icon and text */
}

.sidebar:not(.mini) .nav-btn i {
	font-size: 14px; /* Restore icon size */
}

.sidebar.mini .menu-text {
	display: none;
}

.sidebar.mini {
	width: 100px;
	width: 100px;
	overflow-x: hidden;
}

.sidebar.mini .logo-text {
	display: none;
}

/* 3. Optional: Ensure menu labels are also hidden if they cause overflow */
.sidebar.mini .sidebar-menu span {
	display: none;
}

.sidebar.mini .sidebar-menu li {
	text-align: center;
}

.sidebar.mini .sidebar-menu button {
	justify-content: center;
	padding: 12px 10px;
}

.sidebar-toggle-btn {
	display: none;
}

.sidebar-close-btn {
	display: none;
}

.sidebar h1 {
	font-size: 20px;
	margin-bottom: 30px;
	padding-bottom: 15px;
	border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu {
	list-style: none;
}

.sidebar-menu li {
	margin-bottom: 10px;
}

.sidebar-menu button {
	width: 100%;
	padding: 12px 15px;
	background: none;
	border: none;
	color: white;
	text-align: left;
	cursor: pointer;
	border-radius: 5px;
	transition: all 0.3s ease;
	font-size: 14px;
	font-weight: 500;
}

.sidebar-menu button:hover {
	background-color: rgba(255, 255, 255, 0.1);
	transform: translateX(5px);
}

.sidebar-menu button.active {
	background-color: white;
	color: var(--primary);
}

/* --- User Profile & Avatar Base Styles --- */
.user-profile {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 15px;
}

.user-profile .avatar {
	width: 40px;
	height: 40px;
	background-color: rgba(255, 255, 255, 0.2);
	border-radius: 50%; /* Circle shape */
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	flex-shrink: 0;
}

/* --- Logout Button Base Styles --- */
.user-profile button {
	width: 100%;
	padding: 8px 12px;
	background-color: rgba(255, 255, 255, 0.1);
	border: none;
	color: white;
	border-radius: 4px;
	cursor: pointer;
	font-size: 12px;
	transition: 0.3s;
}

.user-profile button:hover {
	background-color: #dc3545; /* Optional: danger color on hover */
}

/* --- Sidebar Mini State Adjustments --- */

/* Hide text and center profile container */
.sidebar.mini .user-profile {
	width: 100%; /* or 60px to match the li items */
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* Fix the avatar container width */
.sidebar.mini .user-profile .user-info {
	width: 60px; /* Match the width of the .sidebar-menu li elements */
	display: flex;
	justify-content: center;
	margin-bottom: 10px;
}

/* Hide name and email */
.sidebar.mini .user-info > div:not(.avatar) {
	display: none;
}

.sidebar.mini .user-info {
	justify-content: center;
	width: 100%;
	margin-bottom: 10px;
}

/* Transform logout button to match navigation buttons (48x48) */
.sidebar.mini .user-profile button {
	width: 60px; /* Match the width of the .sidebar-menu li elements */
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 0;
	border: none;
	background: transparent;
}

/* Keep logout icon visible */
.sidebar.mini .user-profile button i {
	font-size: 18px;
}

.user-profile button {
	width: 100%;
	padding: 8px 12px;
	background-color: rgba(255, 255, 255, 0.1);
	border: none;
	color: white;
	border-radius: 4px;
	cursor: pointer;
	font-size: 12px;
	transition: all 0.3s ease;
}

.user-profile button:hover {
	background-color: var(--danger);
}

.main-content {
	margin-left: 100px;
	flex: 1;
	padding: 30px;
}

.header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 30px;
	padding-bottom: 20px;
	border-bottom: 2px solid var(--border);
}

.header h2 {
	font-size: 28px;
	color: var(--primary);
}

.header-actions {
	display: flex;
	gap: 10px;
}

/* ========== FORMS ========== */
.form-group {
	margin-bottom: 20px;
}

label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: var(--dark);
	font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: 5px;
	font-size: 14px;
	font-family: inherit;
	transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
	outline: none;
	border-color: var(--secondary);
	box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

textarea {
	resize: vertical;
	min-height: 100px;
}

/* ========== BUTTONS ========== */
button {
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	border: none;
	border-radius: 5px;
	padding: 10px 20px;
}

.btn-primary {
	background-color: var(--primary);
	color: white;
}

.btn-primary:hover {
	background-color: #08a0b0;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.btn-success {
	background-color: var(--success);
	color: white;
}

.btn-success:hover {
	background-color: #059669;
	box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
	background-color: var(--danger);
	color: white;
}

.btn-danger:hover {
	background-color: #dc2626;
	box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-warning {
	background-color: var(--accent);
	color: white;
}

.btn-warning:hover {
	background-color: #d97706;
	box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-accent {
	background-color: var(--accent);
	color: white;
}

.btn-accent:hover {
	background-color: #d97706;
	box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-secondary {
	background-color: var(--gray);
	color: white;
}

.btn-secondary:hover {
	background-color: #4b5563;
}

.btn-small {
	padding: 6px 12px;
	font-size: 12px;
}

/* ========== MODALS ========== */
.modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 1000;
	align-items: center;
	justify-content: center;
}

.modal.active {
	display: flex;
}

.modal-content {
	background-color: white;
	border-radius: 10px;
	padding: 30px;
	max-width: 500px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.confirm-modal {
	max-width: 520px;
	position: relative;
}

.confirm-description {
	margin: 8px 0 0;
	color: var(--gray);
	font-size: 15px;
	line-height: 1.6;
}

.confirm-modal .modal-actions {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 24px;
}

.confirm-modal .btn-danger,
.confirm-modal .btn-success {
	min-width: 120px;
}

.close-modal.confirm-close {
	position: absolute;
	top: 16px;
	right: 16px;
	padding: 0;
	width: 34px;
	height: 34px;
	border-radius: 50%;
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 2px solid var(--border);
}

.modal-header h3 {
	color: var(--primary);
	font-size: 20px;
}

.close-modal {
	background: none;
	border: none;
	font-size: 24px;
	color: var(--gray);
	cursor: pointer;
	padding: 0;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.close-modal:hover {
	color: var(--dark);
}

/* ========== TABLES ========== */
.table-container {
	overflow-x: auto;
	background-color: white;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	margin-bottom: 20px;
}

table {
	width: 100%;
	border-collapse: collapse;
}

thead {
	background-color: var(--lighter);
	border-bottom: 2px solid var(--border);
}

th {
	padding: 15px;
	text-align: left;
	font-weight: 600;
	color: var(--dark);
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

td {
	padding: 12px 15px;
	border-bottom: 1px solid var(--border);
}

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

.action-buttons {
	display: flex;
	gap: 8px;
}

/* ========== CARDS ========== */
.card {
	background-color: white;
	border-radius: 8px;
	padding: 20px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	margin-bottom: 20px;
}

.card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 15px;
	padding-bottom: 15px;
	border-bottom: 2px solid var(--border);
}

.card-header h3 {
	color: var(--primary);
	font-size: 18px;
}

.card-body {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 15px;
}

.stats-card {
	background: linear-gradient(135deg, var(--secondary) 0%, #06b6d4 100%);
	color: white;
	padding: 20px;
	border-radius: 8px;
	text-align: center;
}

.stats-value {
	font-size: 32px;
	font-weight: bold;
	margin: 10px 0;
}

.stats-label {
	font-size: 14px;
	opacity: 0.9;
}

/* ========== ALERTS ========== */
.alert {
	padding: 15px;
	border-radius: 5px;
	margin-bottom: 20px;
	display: none;
	animation: slideDown 0.3s ease;
}

.alert.active {
	display: block;
}

.alert-success {
	background-color: #d1fae5;
	color: #065f46;
	border-left: 4px solid var(--success);
}

.alert-error {
	background-color: #fee2e2;
	color: #7f1d1d;
	border-left: 4px solid var(--danger);
}

.alert-warning {
	background-color: #fef3c7;
	color: #78350f;
	border-left: 4px solid var(--warning);
}

.alert-info {
	background-color: #dbeafe;
	color: #0c2340;
	border-left: 4px solid var(--secondary);
}

@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ========== LOGIN PAGE ========== */
.login-container {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.login-box {
	background-color: white;
	border-radius: 10px;
	padding: 40px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	max-width: 400px;
	width: 90%;
}

.login-box h1 {
	text-align: center;
	color: var(--primary);
	margin-bottom: 10px;
	font-size: 28px;
}

.login-box p {
	text-align: center;
	color: var(--gray);
	margin-bottom: 30px;
	font-size: 14px;
}

.login-tabs {
	display: flex;
	border-bottom: 2px solid var(--border);
	margin-bottom: 20px;
}

.login-tabs button {
	flex: 1;
	padding: 12px;
	background: none;
	border: none;
	color: var(--gray);
	font-weight: 600;
	cursor: pointer;
	border-bottom: 3px solid transparent;
	transition: all 0.3s ease;
}

.login-tabs button.active {
	color: var(--secondary);
	border-bottom-color: var(--secondary);
}

.login-content {
	display: none;
}

.login-content.active {
	display: block;
}

.toggle-password {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	color: var(--gray);
}

.password-wrapper {
	position: relative;
}

/* ========== HAMBURGER MENU ========== */
.hamburger-btn {
	display: none;
	background: var(--primary);
	border: none;
	color: white;
	font-size: 24px;
	cursor: pointer;
	padding: 10px 15px;
	border-radius: 5px;
	transition: all 0.3s ease;
	position: fixed;
	top: 10px;
	left: 10px;
	z-index: 1002;
}

.hamburger-btn:hover {
	transform: scale(1.1);
}

.sidebar-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 999;
}

.sidebar-overlay.active {
	display: block;
}

/* ========== INSTALLATION STYLES ========== */
.install-step {
	border: 1px solid var(--border);
	border-radius: 8px;
	overflow: hidden;
}

.step-header {
	background: var(--light);
	padding: 15px;
	border-bottom: 1px solid var(--border);
}

.step-number {
	font-size: 14px;
	min-width: 30px;
	text-align: center;
}

.status-indicator {
	font-weight: bold;
}

.step-content {
	border-left: none !important;
}

.code-block {
	font-family: "Courier New", monospace;
	font-size: 13px;
	line-height: 1.4;
	overflow-x: auto;
}

.install-progress {
	border: 1px solid var(--border);
	border-radius: 8px;
}

.progress-bar {
	position: relative;
}

.progress-fill {
	transition: width 0.3s ease;
}

/* Alert styles for installation */
.alert {
	padding: 12px 16px;
	border-radius: 6px;
	margin-bottom: 15px;
	border-left: 4px solid;
}

.alert-warning {
	background-color: #fef3c7;
	border-left-color: var(--warning);
	color: #92400e;
}

.alert-error {
	background-color: #fee2e2;
	border-left-color: var(--danger);
	color: #991b1b;
}

.alert-success {
	background-color: #d1fae5;
	border-left-color: var(--success);
	color: #065f46;
}

.alert-info {
	background-color: #dbeafe;
	border-left-color: var(--secondary);
	color: #1e40af;
}

/* ========== RESPONSIVE ========== */
/* Target laptop screens with limited vertical space */
/* Target laptop screens with limited vertical space */
@media screen and (max-height: 750px) {
	.sidebar {
		padding: 10px 15px !important; /* Reduce overall padding */
	}

	.sidebar .logo-area,
	.sidebar > div:first-child {
		margin-bottom: 15px !important; /* Reduce space below logo */
	}

	.sidebar-menu li {
		margin-bottom: 4px !important; /* Reduce space between menu items */
	}

	.user-profile {
		padding-top: 10px !important; /* Reduce space above profile */
	}
}

@media (max-width: 1024px) {
	.sidebar {
		width: 280px;
	}

	.sidebar.mini {
		width: 100px;
	}

	.main-content {
		margin-left: 100px;
	}
}

@media (max-width: 768px) {
	.sidebar {
		left: -250px;
		width: 250px;
	}

	.sidebar.mini {
		width: 250px; /* or remove mini on mobile */
	}

	.main-content {
		margin-left: 0;
	}

	.hamburger-btn {
		display: block;
	}

	.table-container {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	table {
		min-width: 600px;
	}
}

@media (min-width: 769px) {
	.sidebar-toggle-btn {
		display: block;
	}
}

.user-profile {
	position: static;
	border-top: none;
	margin-top: 20px;
	width: calc(100% - 40px);
}

.header {
	flex-direction: column;
	align-items: flex-start;
	gap: 15px;
}

.card-body {
	grid-template-columns: 1fr;
}

.form-row {
	flex-direction: column;
}

.table-container {
	font-size: 12px;
	overflow-x: auto;
}

th,
td {
	padding: 8px;
}

.modal-content {
	max-width: 700px;
}

.navbar {
	display: flex;
	align-items: center;
	gap: 10px;
}

@media (max-width: 480px) {
	.main-content {
		padding: 10px;
	}

	.card {
		border-radius: 8px;
		margin-bottom: 15px;
	}

	.header {
		gap: 10px;
	}

	#currentDate {
		font-size: 12px;
		width: 100%;
	}

	.btn-small {
		padding: 6px 10px;
		font-size: 12px;
	}

	table {
		font-size: 11px;
	}

	th,
	td {
		padding: 6px;
	}

	.form-group {
		margin-bottom: 12px;
	}

	.form-group input,
	.form-group select,
	.form-group textarea {
		font-size: 16px;
	}
}

/* ========== MISC ========== */
.hide {
	display: none !important;
}

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

.text-small {
	font-size: 12px;
}

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

.badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
}

.badge-success {
	background-color: #d1fae5;
	color: #065f46;
}

.badge-warning {
	background-color: #fef3c7;
	color: #78350f;
}

.badge-danger {
	background-color: #fee2e2;
	color: #7f1d1d;
}

.badge-info {
	background-color: #dbeafe;
	color: #0c2340;
}

.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.full-width {
	grid-column: 1 / -1;
}

.action-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	flex-wrap: wrap;
	gap: 10px;
}

.search-box {
	flex: 1;
	min-width: 200px;
}

.search-box input {
	width: 100%;
}

.pagination {
	display: flex;
	justify-content: center;
	gap: 5px;
	margin-top: 20px;
}

.pagination button {
	min-width: 35px;
	padding: 8px 12px;
}

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

.loading {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 3px solid var(--border);
	border-top-color: var(--secondary);
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

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

.toast {
	position: fixed;
	bottom: 20px;
	right: 20px;
	background-color: var(--dark);
	color: white;
	padding: 15px 20px;
	border-radius: 5px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	animation: slideInRight 0.3s ease;
	z-index: 2000;
}

@keyframes slideInRight {
	from {
		transform: translateX(400px);
	}
	to {
		transform: translateX(0);
	}
}

.input-group {
	display: flex;
	gap: 10px;
}

.input-group input {
	flex: 1;
}

.input-group button {
	white-space: nowrap;
}
