/* Portal Shared Styles */

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

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
	background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
	min-height: 100vh;
	color: #fff;
}

/* Layout */
.portal-layout {
	display: flex;
	min-height: 100vh;
}

/* Sidebar */
.sidebar {
	width: 250px;
	background: rgba(0, 0, 0, 0.2);
	border-right: 1px solid rgba(255, 255, 255, 0.1);
	padding: 1.5rem 0;
	display: flex;
	flex-direction: column;
	position: fixed;
	height: 100vh;
	overflow-y: auto;
}

.sidebar-logo {
	padding: 0 1.5rem;
	margin-bottom: 2rem;
}

.sidebar-logo a {
	text-decoration: none;
}

.sidebar-logo h1 {
	font-size: 1.75rem;
	background: linear-gradient(90deg, #00d4ff, #00ff88);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.sidebar-nav {
	flex: 1;
}

.nav-item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.875rem 1.5rem;
	color: #8892b0;
	text-decoration: none;
	transition: all 0.2s;
	border-left: 3px solid transparent;
}

.nav-item:hover {
	background: rgba(255, 255, 255, 0.05);
	color: #fff;
}

.nav-item.active {
	background: rgba(0, 212, 255, 0.1);
	color: #00d4ff;
	border-left-color: #00d4ff;
}

.nav-item svg {
	width: 20px;
	height: 20px;
}

.sidebar-footer {
	padding: 1rem 1.5rem;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.user-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: linear-gradient(90deg, #00d4ff, #00ff88);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	color: #1a1a2e;
}

.user-details {
	flex: 1;
	min-width: 0;
}

.user-name {
	font-weight: 600;
	font-size: 0.9rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.user-email {
	font-size: 0.75rem;
	color: #8892b0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.logout-btn {
	width: 100%;
	padding: 0.625rem;
	font-size: 0.875rem;
	font-weight: 500;
	border: 1px solid rgba(239, 68, 68, 0.3);
	border-radius: 6px;
	background: rgba(239, 68, 68, 0.1);
	color: #ef4444;
	cursor: pointer;
	transition: all 0.2s;
}

.logout-btn:hover {
	background: rgba(239, 68, 68, 0.2);
	border-color: #ef4444;
}

/* Main Content */
.main-content {
	flex: 1;
	margin-left: 250px;
	padding: 2rem;
	min-height: 100vh;
}

.page-header {
	margin-bottom: 2rem;
}

.page-header h1 {
	font-size: 1.75rem;
	margin-bottom: 0.5rem;
}

.page-header p {
	color: #8892b0;
}

/* Cards */
.card {
	background: rgba(255, 255, 255, 0.05);
	border-radius: 12px;
	padding: 1.5rem;
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
}

.card-title {
	font-size: 1rem;
	font-weight: 600;
	color: #8892b0;
}

/* Stats Grid */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1.5rem;
	margin-bottom: 2rem;
}

.stat-card {
	background: rgba(255, 255, 255, 0.05);
	border-radius: 12px;
	padding: 1.5rem;
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card .stat-icon {
	width: 48px;
	height: 48px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 1rem;
}

.stat-card .stat-icon.blue {
	background: rgba(0, 212, 255, 0.15);
	color: #00d4ff;
}

.stat-card .stat-icon.green {
	background: rgba(16, 185, 129, 0.15);
	color: #10b981;
}

.stat-card .stat-icon.orange {
	background: rgba(245, 158, 11, 0.15);
	color: #f59e0b;
}

.stat-card .stat-icon.purple {
	background: rgba(99, 102, 241, 0.15);
	color: #6366f1;
}

.stat-card .stat-icon svg {
	width: 24px;
	height: 24px;
}

.stat-card .stat-value {
	font-size: 2rem;
	font-weight: 700;
	margin-bottom: 0.25rem;
}

.stat-card .stat-label {
	color: #8892b0;
	font-size: 0.875rem;
}

/* Buttons */
.btn {
	padding: 0.625rem 1.25rem;
	font-size: 0.875rem;
	font-weight: 600;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.btn-primary {
	background: linear-gradient(90deg, #00d4ff, #00ff88);
	color: #1a1a2e;
}

.btn-primary:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-secondary {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
	background: rgba(239, 68, 68, 0.1);
	color: #ef4444;
	border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
	background: rgba(239, 68, 68, 0.2);
}

.btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.btn svg {
	width: 16px;
	height: 16px;
}

/* Tables */
.table-container {
	overflow-x: auto;
}

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

th, td {
	padding: 0.875rem 1rem;
	text-align: left;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
	color: #8892b0;
	font-weight: 600;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

td {
	font-size: 0.875rem;
}

tr:hover {
	background: rgba(255, 255, 255, 0.02);
}

/* Forms */
.form-group {
	margin-bottom: 1.25rem;
}

.form-group label {
	display: block;
	color: #8892b0;
	font-size: 0.875rem;
	margin-bottom: 0.5rem;
}

.form-control {
	width: 100%;
	padding: 0.75rem 1rem;
	font-size: 0.875rem;
	border: 2px solid #3d4f7c;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.05);
	color: #fff;
	outline: none;
	transition: border-color 0.3s;
}

.form-control:focus {
	border-color: #00d4ff;
}

.form-control::placeholder {
	color: #6b7280;
}

select.form-control {
	cursor: pointer;
}

select.form-control option {
	background: #1a1a2e;
	color: #fff;
}

select.form-control optgroup {
	background: #0f0f1a;
	color: #00d4ff;
	font-weight: 600;
}

/* Badges */
.badge {
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.625rem;
	font-size: 0.75rem;
	font-weight: 600;
	border-radius: 9999px;
}

.badge-success {
	background: rgba(16, 185, 129, 0.15);
	color: #10b981;
}

.badge-warning {
	background: rgba(245, 158, 11, 0.15);
	color: #f59e0b;
}

.badge-danger {
	background: rgba(239, 68, 68, 0.15);
	color: #ef4444;
}

.badge-info {
	background: rgba(99, 102, 241, 0.15);
	color: #6366f1;
}

/* Pagination */
.pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 0;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	margin-top: 1rem;
}

.pagination-info {
	color: #8892b0;
	font-size: 0.875rem;
}

.pagination-controls {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.pagination-btn {
	padding: 0.5rem 0.75rem;
	font-size: 0.875rem;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 6px;
	background: transparent;
	color: #fff;
	cursor: pointer;
	transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.1);
}

.pagination-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.pagination-btn.active {
	background: rgba(0, 212, 255, 0.15);
	border-color: #00d4ff;
	color: #00d4ff;
}

/* Modal */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s;
}

.modal-overlay.active {
	opacity: 1;
	visibility: visible;
}

.modal {
	background: #1a1a2e;
	border-radius: 16px;
	max-width: 600px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	border: 1px solid rgba(255, 255, 255, 0.1);
	transform: translateY(20px);
	transition: transform 0.3s;
}

.modal-overlay.active .modal {
	transform: translateY(0);
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
	font-size: 1.125rem;
}

.modal-close {
	background: none;
	border: none;
	color: #8892b0;
	cursor: pointer;
	padding: 0.25rem;
	transition: color 0.2s;
}

.modal-close:hover {
	color: #fff;
}

.modal-body {
	padding: 1.5rem;
}

.modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 0.75rem;
	padding: 1.25rem 1.5rem;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Empty State */
.empty-state {
	text-align: center;
	padding: 3rem 1rem;
}

.empty-state svg {
	width: 64px;
	height: 64px;
	color: #3d4f7c;
	margin-bottom: 1rem;
}

.empty-state h3 {
	font-size: 1.125rem;
	margin-bottom: 0.5rem;
}

.empty-state p {
	color: #8892b0;
	margin-bottom: 1.5rem;
}

/* Loading Spinner */
.spinner {
	width: 20px;
	height: 20px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

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

/* Toast */
.toast-container {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 1100;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.toast {
	padding: 1rem 1.25rem;
	border-radius: 8px;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	animation: slideIn 0.3s ease;
	max-width: 400px;
}

@keyframes slideIn {
	from {
		transform: translateX(100%);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

.toast-success {
	background: #1a2e1f;
	border: 1px solid rgba(16, 185, 129, 0.5);
	color: #10b981;
}

.toast-error {
	background: #2e1a1a;
	border: 1px solid rgba(239, 68, 68, 0.5);
	color: #ef4444;
}

.toast-info {
	background: #1a1a2e;
	border: 1px solid rgba(99, 102, 241, 0.5);
	color: #6366f1;
}

/* Balance Display */
.balance-display {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	background: rgba(16, 185, 129, 0.1);
	border: 1px solid rgba(16, 185, 129, 0.2);
	border-radius: 8px;
}

.balance-amount {
	font-weight: 700;
	font-size: 1.125rem;
	color: #10b981;
}

.balance-label {
	font-size: 0.75rem;
	color: #8892b0;
}

/* Mobile Menu */
.mobile-header {
	display: none;
}

.sidebar-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 99;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.3s, visibility 0.3s;
}

.sidebar-overlay.active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.sidebar {
	transition: transform 0.3s ease;
}

.sidebar-close {
	display: none;
	position: absolute;
	top: 1rem;
	right: 1rem;
	background: none;
	border: none;
	color: #8892b0;
	cursor: pointer;
	padding: 0.5rem;
	transition: color 0.2s;
}

.sidebar-close:hover {
	color: #fff;
}

.sidebar-close svg {
	width: 24px;
	height: 24px;
}

/* Responsive */
@media (max-width: 768px) {
	.sidebar {
		transform: translateX(-100%);
		z-index: 100;
		background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
	}

	.sidebar.open {
		transform: translateX(0);
	}

	.sidebar-close {
		display: block;
	}

	.main-content {
		margin-left: 0;
		padding: 1rem;
	}

	.mobile-header {
		display: flex;
		align-items: center;
		gap: 1rem;
		padding: 1rem;
		background: rgba(0, 0, 0, 0.2);
		border-radius: 12px;
		margin-bottom: 1.5rem;
	}

	.mobile-menu-btn {
		background: none;
		border: none;
		color: #fff;
		cursor: pointer;
		padding: 0.5rem;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.mobile-menu-btn svg {
		width: 24px;
		height: 24px;
	}

	.mobile-header-logo {
		font-size: 1.25rem;
		font-weight: 700;
		background: linear-gradient(90deg, #00d4ff, #00ff88);
		-webkit-background-clip: text;
		-webkit-text-fill-color: transparent;
		background-clip: text;
	}

	.page-header {
		margin-bottom: 1.5rem;
	}

	.page-header h1 {
		font-size: 1.5rem;
	}

	.stats-grid {
		grid-template-columns: 1fr 1fr;
		gap: 1rem;
	}

	.stat-card {
		padding: 1rem;
	}

	.stat-card .stat-value {
		font-size: 1.5rem;
	}

	.balance-card {
		flex-direction: column;
		align-items: flex-start !important;
	}

	.card {
		padding: 1rem;
	}

	.card-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 1rem;
	}

	/* Hide body scroll when menu is open */
	body.menu-open {
		overflow: hidden;
	}
}

@media (max-width: 480px) {
	.stats-grid {
		grid-template-columns: 1fr;
	}

	.main-content {
		padding: 0.75rem;
	}

	.mobile-header {
		margin: 0 0 1rem 0;
		border-radius: 8px;
	}
}
