@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	--primary-dark: #0a192f;
	--secondary-dark: #1b2735;
	--accent-cyan: #00e5ff;
	--accent-green: #00ff9d;
	--text-primary: #e6f1ff;
	--text-secondary: #8892b0;
	--card-bg: #112240;
	--hover-bg: #1d3557;
	--border-color: #233554;
	--success: #00ff9d;
	--warning: #ffd60a;
	--danger: #ff006e;
	--info: #00e5ff;
	--sidebar-width: 280px;
}

body {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	background: var(--primary-dark);
	color: var(--text-primary);
	margin: 0;
	padding: 0;
	display: flex;
	height: 100vh;
	line-height: 1.6;
	overflow-x: hidden;
}

/* Animated Background */
body::before {
	content: '';
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background:
		radial-gradient(circle at 20% 50%, rgba(0, 229, 255, 0.05) 0%, transparent 50%),
		radial-gradient(circle at 80% 80%, rgba(0, 255, 157, 0.05) 0%, transparent 50%);
	pointer-events: none;
	z-index: 0;
}


.sidebar::-webkit-scrollbar {
	width: 6px;
}

.sidebar::-webkit-scrollbar-track {
	background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
	background: var(--border-color);
	border-radius: 10px;
}

.sidebar.collapsed {
	transform: translateX(-100%);
}

.logo {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 40px;
	padding-bottom: 24px;
	border-bottom: 1px solid var(--border-color);
	position: relative;
}

.logo-icon {
	width: 48px;
	height: 48px;
	background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: 24px;
	box-shadow: 0 8px 16px rgba(0, 229, 255, 0.3);
	animation: pulse 3s ease-in-out infinite;
	position: relative;
}

@keyframes pulse {

	0%,
	100% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.05);
	}
}

.logo-icon::after {
	content: '';
	position: absolute;
	width: 100%;
	height: 100%;
	border-radius: 12px;
	background: inherit;
	filter: blur(12px);
	opacity: 0.6;
	z-index: -1;
}

.logo-text h2 {
	font-size: 20px;
	font-weight: 700;
	color: var(--text-primary);
	background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.logo-text p {
	font-size: 11px;
	color: var(--text-secondary);
	margin-top: -2px;
	letter-spacing: 0.5px;
}

.nav-menu {
	list-style: none;
}

.nav-item {
	margin-bottom: 6px;
}

.nav-link {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	color: var(--text-secondary);
	text-decoration: none;
	border-radius: 10px;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	cursor: pointer;
	position: relative;
	overflow: hidden;
}

.nav-link::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	width: 3px;
	height: 100%;
	background: var(--accent-cyan);
	transform: scaleY(0);
	transition: transform 0.3s ease;
}

.nav-link:hover {
	background: var(--hover-bg);
	color: var(--accent-cyan);
	transform: translateX(4px);
}

.nav-link:hover::before {
	transform: scaleY(1);
}

.nav-link.active {
	background: var(--hover-bg);
	color: var(--accent-cyan);
	box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.2);
}

.nav-link.active::before {
	transform: scaleY(1);
}

.nav-link i {
	width: 20px;
	text-align: center;
	font-size: 18px;
	transition: transform 0.3s ease;
}

.nav-link:hover i {
	transform: scale(1.1);
}

.nav-badge {
	margin-left: auto;
	background: var(--danger);
	color: white;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 600;
	animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

	0%,
	100% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.1);
	}
}

.nav-section {
	margin-top: 32px;
	margin-bottom: 16px;
}

.nav-section-title {
	font-size: 11px;
	text-transform: uppercase;
	color: var(--text-secondary);
	font-weight: 700;
	letter-spacing: 1.5px;
	padding: 0 16px;
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.nav-section-title i {
	font-size: 10px;
}


/* Header */
.header {
	background: rgba(27, 39, 53, 0.8);
	backdrop-filter: blur(20px);
	border-bottom: 1px solid var(--border-color);
	padding: 18px 32px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	position: sticky;
	top: 0;
	z-index: 100;
	animation: slideDown 0.5s ease;
}

@keyframes slideDown {
	from {
		transform: translateY(-100%);
		opacity: 0;
	}

	to {
		transform: translateY(0);
		opacity: 1;
	}
}

.header-left {
	display: flex;
	align-items: center;
	gap: 24px;
}

.menu-toggle {
	background: var(--card-bg);
	border: 1px solid var(--border-color);
	color: var(--text-primary);
	font-size: 20px;
	cursor: pointer;
	padding: 10px 12px;
	border-radius: 10px;
	transition: all 0.3s ease;
}

.menu-toggle:hover {
	background: var(--hover-bg);
	border-color: var(--accent-cyan);
	color: var(--accent-cyan);
	transform: rotate(90deg);
}

.search-bar {
	position: relative;
}

.search-bar input {
	background: var(--card-bg);
	border: 1px solid var(--border-color);
	padding: 12px 48px 12px 44px;
	border-radius: 12px;
	color: var(--text-primary);
	width: 350px;
	transition: all 0.3s ease;
	font-size: 14px;
}

.search-bar input:focus {
	outline: none;
	border-color: var(--accent-cyan);
	box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.1);
	width: 400px;
}

.search-bar i.fa-search {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--text-secondary);
	font-size: 16px;
}

.search-bar .search-shortcut {
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	background: var(--hover-bg);
	color: var(--text-secondary);
	padding: 4px 8px;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 600;
}

.header-right {
	display: flex;
	align-items: center;
	gap: 16px;
}

.header-btn {
	background: var(--card-bg);
	border: 1px solid var(--border-color);
	color: var(--text-primary);
	padding: 10px 12px;
	border-radius: 10px;
	cursor: pointer;
	position: relative;
	transition: all 0.3s ease;
	font-size: 18px;
}

.header-btn:hover {
	background: var(--hover-bg);
	border-color: var(--accent-cyan);
	color: var(--accent-cyan);
	transform: translateY(-2px);
}

.notification-badge {
	position: absolute;
	top: 6px;
	right: 6px;
	background: var(--danger);
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 2px solid var(--card-bg);
	animation: badgePulse 2s ease-in-out infinite;
}

.profile-btn {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 16px 8px 8px;
}

.profile-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 14px;
	box-shadow: 0 4px 12px rgba(0, 229, 255, 0.3);
}

.profile-name {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.profile-name strong {
	font-size: 13px;
	color: var(--text-primary);
}

.profile-name span {
	font-size: 11px;
	color: var(--text-secondary);
}

/* Content Area */
.content {
	padding: 32px;
	animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.page-header {
	margin-bottom: 32px;
	animation: slideUp 0.6s ease;
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.page-header h1 {
	font-size: 32px;
	font-weight: 700;
	margin-bottom: 8px;
	background: linear-gradient(135deg, var(--text-primary), var(--accent-cyan));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.breadcrumb {
	display: flex;
	gap: 8px;
	color: var(--text-secondary);
	font-size: 14px;
	align-items: center;
}

.breadcrumb a {
	color: var(--accent-cyan);
	text-decoration: none;
	transition: all 0.3s ease;
}

.breadcrumb a:hover {
	color: var(--accent-green);
}

.breadcrumb i {
	font-size: 10px;
}

/* Stats Grid */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 24px;
	margin-bottom: 32px;
}

.stat-card {
	background: var(--card-bg);
	border: 1px solid var(--border-color);
	border-radius: 16px;
	padding: 28px;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	cursor: pointer;
	position: relative;
	overflow: hidden;
}

.stat-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, rgba(0, 229, 255, 0.05), rgba(0, 255, 157, 0.05));
	opacity: 0;
	transition: opacity 0.4s ease;
}

.stat-card:hover {
	transform: translateY(-8px);
	box-shadow: 0 12px 32px rgba(0, 229, 255, 0.2);
	border-color: var(--accent-cyan);
}

.stat-card:hover::before {
	opacity: 1;
}

.stat-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 20px;
	position: relative;
	z-index: 1;
}

.stat-icon {
	width: 56px;
	height: 56px;
	border-radius: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	position: relative;
}

.stat-icon::after {
	content: '';
	position: absolute;
	width: 100%;
	height: 100%;
	border-radius: 14px;
	background: inherit;
	filter: blur(16px);
	opacity: 0.4;
	z-index: -1;
}

.stat-icon.success {
	background: linear-gradient(135deg, rgba(0, 255, 157, 0.2), rgba(0, 255, 157, 0.1));
	color: var(--success);
}

.stat-icon.warning {
	background: linear-gradient(135deg, rgba(255, 214, 10, 0.2), rgba(255, 214, 10, 0.1));
	color: var(--warning);
}

.stat-icon.danger {
	background: linear-gradient(135deg, rgba(255, 0, 110, 0.2), rgba(255, 0, 110, 0.1));
	color: var(--danger);
}

.stat-icon.info {
	background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(0, 229, 255, 0.1));
	color: var(--accent-cyan);
}

.stat-trend {
	font-size: 13px;
	padding: 6px 12px;
	border-radius: 8px;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 4px;
}

.stat-trend.up {
	background: rgba(0, 255, 157, 0.15);
	color: var(--success);
}

.stat-trend.down {
	background: rgba(255, 0, 110, 0.15);
	color: var(--danger);
}

.stat-trend i {
	font-size: 12px;
}

.stat-value {
	font-size: 36px;
	font-weight: 800;
	margin-bottom: 6px;
	position: relative;
	z-index: 1;
	letter-spacing: -1px;
}

.stat-label {
	color: var(--text-secondary);
	font-size: 14px;
	font-weight: 500;
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 6px;
}

.stat-label i {
	font-size: 12px;
}

/* Card */
.card {
	background: var(--card-bg);
	border: 1px solid var(--border-color);
	border-radius: 16px;
	padding: 28px;
	margin-bottom: 24px;
	animation: fadeInUp 0.6s ease;
	transition: all 0.3s ease;
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.card:hover {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--border-color);
}

.card-title {
	font-size: 20px;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 12px;
}

.card-title i {
	color: var(--accent-cyan);
	font-size: 22px;
}

.card-actions {
	display: flex;
	gap: 12px;
}

.btn {
	padding: 10px 20px;
	border-radius: 10px;
	border: none;
	cursor: pointer;
	font-weight: 600;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
}

.btn i {
	font-size: 16px;
}

.btn-primary {
	background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
	color: var(--primary-dark);
	box-shadow: 0 4px 12px rgba(0, 229, 255, 0.3);
}

.btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(0, 229, 255, 0.5);
}

.btn-secondary {
	background: var(--hover-bg);
	color: var(--text-primary);
	border: 1px solid var(--border-color);
}

.btn-secondary:hover {
	background: var(--border-color);
	border-color: var(--accent-cyan);
	color: var(--accent-cyan);
}

.btn-danger {
	background: rgba(255, 0, 110, 0.15);
	color: var(--danger);
	border: 1px solid var(--danger);
}

.btn-danger:hover {
	background: var(--danger);
	color: white;
}



.status-badge {
	padding: 6px 14px;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.status-badge i {
	font-size: 10px;
}

.status-badge.online {
	background: rgba(0, 255, 157, 0.15);
	color: var(--success);
}

.status-badge.offline {
	background: rgba(255, 0, 110, 0.15);
	color: var(--danger);
}

.status-badge.warning {
	background: rgba(255, 214, 10, 0.15);
	color: var(--warning);
}

.progress-bar {
	width: 100px;
	height: 8px;
	background: var(--hover-bg);
	border-radius: 10px;
	overflow: hidden;
	position: relative;
}

.progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
	border-radius: 10px;
	transition: width 0.5s ease;
}

/* Alert Box */
.alert {
	padding: 18px 20px;
	border-radius: 12px;
	margin-bottom: 24px;
	display: flex;
	align-items: start;
	gap: 14px;
	animation: slideIn 0.5s ease;
	position: relative;
	overflow: hidden;
}

@keyframes slideIn {
	from {
		transform: translateX(-100%);
		opacity: 0;
	}

	to {
		transform: translateX(0);
		opacity: 1;
	}
}

.alert::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	width: 4px;
	height: 100%;
}

.alert-danger {
	background: rgba(255, 0, 110, 0.1);
	border: 1px solid rgba(255, 0, 110, 0.3);
}

.alert-danger::before {
	background: var(--danger);
}

.alert-danger i {
	color: var(--danger);
	font-size: 20px;
}

.alert-warning {
	background: rgba(255, 214, 10, 0.1);
	border: 1px solid rgba(255, 214, 10, 0.3);
}

.alert-warning::before {
	background: var(--warning);
}

.alert-warning i {
	color: var(--warning);
	font-size: 20px;
}

.alert-success {
	background: rgba(0, 255, 157, 0.1);
	border: 1px solid rgba(0, 255, 157, 0.3);
}

.alert-success::before {
	background: var(--success);
}

.alert-success i {
	color: var(--success);
	font-size: 20px;
}

.alert-info {
	background: rgba(0, 229, 255, 0.1);
	border: 1px solid rgba(0, 229, 255, 0.3);
}

.alert-info::before {
	background: var(--info);
}

.alert-info i {
	color: var(--info);
	font-size: 20px;
}

.alert-content strong {
	display: block;
	margin-bottom: 4px;
	font-size: 15px;
}

.alert-content p {
	color: var(--text-secondary);
	font-size: 13px;
	line-height: 1.5;
}

.alert-close {
	margin-left: auto;
	background: none;
	border: none;
	color: var(--text-secondary);
	cursor: pointer;
	font-size: 18px;
	transition: all 0.3s ease;
}

.alert-close:hover {
	color: var(--text-primary);
	transform: rotate(90deg);
}

/* Chart Container */
.chart-container {
	height: 320px;
	margin-top: 20px;
	padding: 16px;
	background: rgba(0, 0, 0, 0.2);
	border-radius: 12px;
}

/* Modal */
.modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(10, 25, 47, 0.95);
	backdrop-filter: blur(10px);
	z-index: 2000;
	align-items: center;
	justify-content: center;
	animation: fadeIn 0.3s ease;
}

.modal.active {
	display: flex;
}

.modal-content {
	background: var(--card-bg);
	border: 1px solid var(--border-color);
	border-radius: 16px;
	padding: 36px;
	max-width: 550px;
	width: 90%;
	animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes modalSlideIn {
	from {
		transform: translateY(-50px) scale(0.9);
		opacity: 0;
	}

	to {
		transform: translateY(0) scale(1);
		opacity: 1;
	}
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 28px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
	font-size: 24px;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 12px;
}

.modal-header h3 i {
	color: var(--accent-cyan);
}

.modal-close {
	background: var(--hover-bg);
	border: none;
	color: var(--text-secondary);
	font-size: 20px;
	cursor: pointer;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
}

.modal-close:hover {
	background: var(--danger);
	color: white;
	transform: rotate(90deg);
}


/* Toast Notification */
.toast {
	position: fixed;
	bottom: 32px;
	right: 32px;
	background: var(--card-bg);
	border: 1px solid var(--border-color);
	border-radius: 12px;
	padding: 18px 24px;
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 320px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
	transform: translateX(500px);
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	z-index: 3000;
}

.toast.show {
	transform: translateX(0);
}

.toast i {
	font-size: 24px;
}

.toast-success i {
	color: var(--success);
}

.toast-error i {
	color: var(--danger);
}

.toast-warning i {
	color: var(--warning);
}

.toast-info i {
	color: var(--info);
}

.toast-content strong {
	display: block;
	font-size: 15px;
	margin-bottom: 2px;
}

.toast-content span {
	color: var(--text-secondary);
	font-size: 13px;
}

/* Quick Stats Mini Cards */
.quick-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
	margin-bottom: 24px;
}

.quick-stat {
	background: var(--hover-bg);
	padding: 16px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	gap: 12px;
	border: 1px solid var(--border-color);
	transition: all 0.3s ease;
}

.quick-stat:hover {
	border-color: var(--accent-cyan);
	transform: translateY(-2px);
}

.quick-stat-icon {
	width: 44px;
	height: 44px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
}

.quick-stat-info span {
	display: block;
	color: var(--text-secondary);
	font-size: 12px;
	margin-bottom: 4px;
}

.quick-stat-info strong {
	font-size: 20px;
	font-weight: 700;
}

/* Activity Feed */
.activity-feed {
	max-height: 400px;
	overflow-y: auto;
}

.activity-feed::-webkit-scrollbar {
	width: 6px;
}

.activity-feed::-webkit-scrollbar-track {
	background: transparent;
}

.activity-feed::-webkit-scrollbar-thumb {
	background: var(--border-color);
	border-radius: 10px;
}

.activity-item {
	display: flex;
	gap: 14px;
	padding: 16px;
	border-left: 2px solid var(--border-color);
	margin-left: 20px;
	position: relative;
	transition: all 0.3s ease;
}

.activity-item:hover {
	background: var(--hover-bg);
	border-left-color: var(--accent-cyan);
}

.activity-item::before {
	content: '';
	position: absolute;
	left: -7px;
	top: 20px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--accent-cyan);
	border: 2px solid var(--card-bg);
}

.activity-icon {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	flex-shrink: 0;
}

.activity-content strong {
	display: block;
	margin-bottom: 4px;
	font-size: 14px;
}

.activity-content p {
	color: var(--text-secondary);
	font-size: 13px;
	margin-bottom: 4px;
}

.activity-time {
	color: var(--text-secondary);
	font-size: 11px;
	display: flex;
	align-items: center;
	gap: 4px;
}

/* Responsive */
@media (max-width: 1024px) {
	.stats-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.sidebar {
		transform: translateX(-100%);
	}

	.sidebar.active {
		transform: translateX(0);
	}

	.stats-grid {
		grid-template-columns: 1fr;
	}

	.search-bar input {
		width: 200px;
	}

	.search-bar input:focus {
		width: 250px;
	}

	.header {
		padding: 16px 20px;
	}

	.content {
		padding: 20px;
	}

	.card {
		padding: 20px;
	}

	.card-header {
		flex-direction: column;
		gap: 16px;
		align-items: flex-start;
	}

	.card-actions {
		width: 100%;
	}

	.card-actions .btn {
		flex: 1;
	}

	.profile-name {
		display: none;
	}

	.search-shortcut {
		display: none;
	}

	.table-container {
		overflow-x: scroll;
	}
}

/* Loading Spinner */
.spinner {
	width: 20px;
	height: 20px;
	border: 2px solid var(--border-color);
	border-top-color: var(--accent-cyan);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* Skeleton Loading */
.skeleton {
	background: linear-gradient(90deg, var(--hover-bg) 25%, var(--border-color) 50%, var(--hover-bg) 75%);
	background-size: 200% 100%;
	animation: loading 1.5s ease-in-out infinite;
	border-radius: 8px;
}

@keyframes loading {
	0% {
		background-position: 200% 0;
	}

	100% {
		background-position: -200% 0;
	}
}

/* Tooltip */
[data-tooltip] {
	position: relative;
}

[data-tooltip]::after {
	content: attr(data-tooltip);
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(-8px);
	background: var(--secondary-dark);
	color: var(--text-primary);
	padding: 8px 12px;
	border-radius: 8px;
	font-size: 12px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease, transform 0.3s ease;
	border: 1px solid var(--border-color);
	z-index: 1000;
}

[data-tooltip]:hover::after {
	opacity: 1;
	transform: translateX(-50%) translateY(-4px);
}

/* Floating Action Button */
.fab {
	position: fixed;
	bottom: 32px;
	right: 32px;
	width: 60px;
	height: 60px;
	background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
	border: none;
	border-radius: 50%;
	color: var(--primary-dark);
	font-size: 24px;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 229, 255, 0.4);
	transition: all 0.3s ease;
	z-index: 999;
}

.fab:hover {
	transform: scale(1.1) rotate(90deg);
	box-shadow: 0 12px 32px rgba(0, 229, 255, 0.6);
}

/* ========== Sites Monitor Page Styles ========== */

.page#sites {
	animation: fadeIn 0.6s ease;
}
    /* ============================================
   MOBILE-RESPONSIVE DASHBOARD & SITES MONITOR STYLES
   Add this to your existing CSS or create a new file
   ============================================ */

/* Base improvements for better mobile experience */
* {
    box-sizing: border-box;
}

.main-content {
    padding: 16px;
    width: 100%;
}

.content {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: row;
    gap: 20px;
}

/* ============================================
   SIDEBAR - Mobile Responsive
   ============================================ */
.sidebar {
    width: 100%;
    max-width: 280px;
    flex-shrink: 0;
}

/* ============================================
   PAGE HEADER - Mobile Optimized
   ============================================ */
.page-header {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-header h1 {
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumb {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.breadcrumb a {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-secondary, #aaa);
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--primary, #007bff);
}

.breadcrumb .fas {
    font-size: 0.75rem;
}

/* ============================================
   CARD ACTIONS - Mobile Wrap
   ============================================ */
.card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* ============================================
   STATS GRID - Responsive Layout
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 16px;
    border-radius: 12px;
    min-height: 140px;
    background: var(--card-bg, #1e1e2f);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.2rem;
}

.stat-icon.success {
    background: rgba(0, 255, 157, 0.15);
    color: var(--success, #00ff9d);
}

.stat-icon.info {
    background: rgba(0, 229, 255, 0.15);
    color: var(--info, #00e5ff);
}

.stat-icon.warning {
    background: rgba(255, 214, 10, 0.15);
    color: var(--warning, #ffd60a);
}

.stat-icon.danger {
    background: rgba(255, 0, 110, 0.15);
    color: var(--danger, #ff006e);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary, #aaa);
}

.stat-trend {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-trend.up {
    background: rgba(0, 255, 157, 0.15);
    color: var(--success, #00ff9d);
}

.stat-trend.down {
    background: rgba(255, 0, 110, 0.15);
    color: var(--danger, #ff006e);
}

/* ============================================
   QUICK STATS - Mobile Stack
   ============================================ */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--card-bg, #1e1e2f);
    border-radius: 12px;
}

.quick-stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.quick-stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quick-stat-info span {
    font-size: 0.8rem;
    opacity: 0.7;
}

.quick-stat-info strong {
    font-size: 1.2rem;
    font-weight: 700;
}

/* ============================================
   CARD COMPONENT - Mobile Optimized
   ============================================ */
.card {
    background: var(--card-bg, #1e1e2f);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.card-actions .btn {
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* ============================================
   TABLE - Mobile Responsive
   ============================================ */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

table tbody tr {
    transition: background 0.3s;
}

table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.table-site {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.table-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
    font-size: 1rem;
}

.table-icon.online {
    background: rgba(0, 255, 157, 0.15);
    color: var(--success, #00ff9d);
}

.table-icon.offline {
    background: rgba(255, 0, 110, 0.15);
    color: var(--danger, #ff006e);
}

.table-icon.warning {
    background: rgba(255, 214, 10, 0.15);
    color: var(--warning, #ffd60a);
}

.table-icon.maintenance {
    background: rgba(0, 229, 255, 0.15);
    color: var(--info, #00e5ff);
}

.table-site-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.table-site-info strong {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-site-info span {
    font-size: 0.75rem;
    opacity: 0.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge.online {
    background: rgba(0, 255, 157, 0.15);
    color: var(--success, #00ff9d);
}

.status-badge.offline {
    background: rgba(255, 0, 110, 0.15);
    color: var(--danger, #ff006e);
}

.status-badge.warning {
    background: rgba(255, 214, 10, 0.15);
    color: var(--warning, #ffd60a);
}

.status-badge.maintenance {
    background: rgba(0, 229, 255, 0.15);
    color: var(--info, #00e5ff);
}

.status-badge .fa-circle {
    font-size: 0.6rem;
}

.progress-bar {
    width: 100%;
    max-width: 120px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Action buttons in table */
table td > div {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

table .btn {
    padding: 8px 12px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.run-cron {
    font-size: 0.8rem !important;
    padding: 8px 12px !important;
}

/* ============================================
   CHARTS - Mobile Optimized
   ============================================ */
.chart-container {
    position: relative;
    height: 280px;
    padding: 16px;
}

/* ============================================
   ACTIVITY FEED - Mobile Layout
   ============================================ */
.activity-feed {
    padding: 16px;
}

.activity-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.activity-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-content strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.activity-content p {
    margin: 0 0 6px 0;
    font-size: 0.85rem;
    opacity: 0.8;
}

.activity-time {
    font-size: 0.75rem;
    opacity: 0.6;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   MODAL - Mobile Optimized
   ============================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card-bg, #1e1e2f);
    color: var(--text-color, #e5e5e5);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: calc(100vh - 32px);
    padding: 20px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary, #aaa);
    font-size: 1.3rem;
    cursor: pointer;
    transition: color 0.3s;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
}

.modal-close:hover {
    color: var(--text-color, #fff);
}

/* Form styling */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    font-size: 0.9rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary, #bbb);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color, #eee);
    border-radius: 8px;
    padding: 12px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s, background 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary, #007bff);
    background: rgba(255, 255, 255, 0.08);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.modal-actions .btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 0.95rem;
    justify-content: center;
}

/* ============================================
   BUTTONS - Consistent Mobile Styling
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
    min-height: 40px;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #003d82);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color, #ccc);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: linear-gradient(135deg, #ff006e, #cc0058);
    color: #fff;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #cc0058, #990042);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 0, 110, 0.3);
}

/* ============================================
   ALERTS - Mobile Optimized
   ============================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.alert-danger {
    background: rgba(255, 0, 110, 0.15);
    border-left: 4px solid var(--danger, #ff006e);
    color: var(--danger, #ff006e);
}

.alert i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
    min-width: 0;
}

.alert-content strong {
    display: block;
    margin-bottom: 4px;
    font-size: 1rem;
}

.alert-content p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.alert-close {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    font-size: 1.2rem;
    min-width: 32px;
    min-height: 32px;
}

/* ============================================
   TOOLTIPS - Mobile Friendly
   ============================================ */
[data-tooltip] {
    position: relative;
}

/* Hide tooltips on touch devices to avoid clutter */
@media (hover: none) {
    [data-tooltip]::after {
        display: none !important;
    }
}

/* ============================================
   EMPTY STATE STYLING
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary, #aaa);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* ============================================
   MEDIA QUERIES - iPhone & Mobile Optimization
   ============================================ */

/* Tablets and small desktops */
@media (max-width: 1024px) {
    .content {
        flex-direction: column;
    }
    
    .sidebar {
        max-width: 100%;
        width: 100%;
    }
    
    .page {
        padding: 16px !important;
    }
}

/* Large phones and small tablets */
@media (max-width: 768px) {
    .main-content {
        padding: 12px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-header h1 {
        font-size: 1.3rem;
    }
    
    .card-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
    }
    
    table {
        min-width: 600px;
    }
    
    .chart-container {
        height: 240px;
    }
}

/* iPhone 14 Pro Max, 14 Plus, 13 Pro Max (428px) */
@media (max-width: 428px) {
    .page-header h1 {
        font-size: 1.2rem;
    }
    
    .breadcrumb {
        font-size: 0.8rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .card-actions .btn {
        flex: 1;
        min-width: 0;
    }
    
    .stat-card {
        min-height: 120px;
        padding: 14px;
    }
    
    .stat-value {
        font-size: 1.6rem;
    }
    
    table {
        min-width: 550px;
    }
    
    table th,
    table td {
        padding: 10px 8px;
        font-size: 0.8rem;
    }
    
    .table-site {
        min-width: 160px;
    }
}

/* iPhone 14 Pro, 14, 13 Pro, 13, 12 (390px) */
@media (max-width: 390px) {
    .main-content {
        padding: 10px;
    }
    
    .page {
        padding: 12px !important;
    }
    
    .card-header {
        padding: 12px;
    }
    
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .quick-stat-icon {
        width: 42px;
        height: 42px;
    }
    
    .modal-content {
        padding: 16px;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 10px 14px;
    }
}

/* iPhone SE, 13 mini, 12 mini (375px) */
@media (max-width: 375px) {
    .page-header h1 {
        font-size: 1.1rem;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .card-actions .btn {
        width: 100%;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    table {
        min-width: 500px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}

/* Small phones (360px and below) */
@media (max-width: 360px) {
    .page-header h1 {
        font-size: 1rem;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .quick-stat {
        padding: 12px;
    }
    
    table th,
    table td {
        padding: 8px 6px;
        font-size: 0.75rem;
    }
}

/* Landscape mode optimization */
@media (max-width: 896px) and (orientation: landscape) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .quick-stats {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .chart-container {
        height: 200px;
    }
    
    .modal-content {
        max-height: calc(100vh - 20px);
    }
}

/* Small landscape phones */
@media (max-width: 667px) and (orientation: landscape) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
.table-container::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.table-container::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   TOUCH IMPROVEMENTS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .btn {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .alert-close,
    .modal-close {
        padding: 8px;
        min-width: 44px;
        min-height: 44px;
    }
    
    table .btn {
        min-height: 40px;
    }
    
    /* Remove hover effects on touch devices */
    .btn:hover {
        transform: none;
    }
    
    table tbody tr:hover {
        background: transparent;
    }
    
    /* Add active states instead */
    .btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    table tbody tr:active {
        background: rgba(255, 255, 255, 0.03);
    }
}

/* ============================================
   SAFE AREA INSETS (for iPhone notch/island)
   ============================================ */
@supports (padding: max(0px)) {
    .main-content {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    
    .modal {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

/* ============================================
   PRINT STYLES (Bonus)
   ============================================ */
@media print {
    .sidebar,
    .card-actions,
    .modal,
    .btn {
        display: none !important;
    }
    
    .content {
        flex-direction: column;
    }
    
    .page {
        padding: 0 !important;
    }
}