/* DailyShip Portal - Professional Light Theme */

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

:root {
	--primary: #2563eb;
	--primary-light: #3b82f6;
	--primary-dark: #1d4ed8;
	--bg-main: #f1f5f9;
	--bg-card: #ffffff;
	--bg-sidebar: #1e293b;
	--text-primary: #1e293b;
	--text-secondary: #64748b;
	--text-muted: #94a3b8;
	--border: #e2e8f0;
	--border-light: #f1f5f9;
	--success: #10b981;
	--warning: #f59e0b;
	--danger: #ef4444;
	--info: #6366f1;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
	background: var(--bg-main);
	min-height: 100vh;
	color: var(--text-primary);
}

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

/* Sidebar - Keep dark for contrast */
.sidebar {
	width: 250px;
	background: var(--bg-sidebar);
	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;
	color: #fff;
}

.sidebar-logo h1 span {
	color: var(--primary-light);
}

.sidebar-nav {
	flex: 1;
}

.nav-item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.875rem 1.5rem;
	color: #94a3b8;
	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(37, 99, 235, 0.15);
	color: var(--primary-light);
	border-left-color: var(--primary-light);
}

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

.nav-item span {
	white-space: nowrap;
	overflow: hidden;
}

/* Sidebar Toggle Button */
.sidebar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 1.5rem;
	margin-bottom: 2rem;
}

.sidebar-header .sidebar-logo {
	padding: 0;
	margin-bottom: 0;
}

.sidebar-toggle {
	background: rgba(255, 255, 255, 0.1);
	border: none;
	color: #94a3b8;
	cursor: pointer;
	padding: 0.5rem;
	border-radius: 6px;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sidebar-toggle:hover {
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
}

.sidebar-toggle svg {
	width: 20px;
	height: 20px;
}

/* Collapsed Sidebar */
.sidebar.collapsed {
	width: 72px;
}

.sidebar.collapsed .sidebar-header {
	padding: 0 0.75rem;
	justify-content: center;
}

.sidebar.collapsed .sidebar-logo {
	display: none;
}

.sidebar.collapsed .sidebar-toggle {
	transform: rotate(180deg);
}

.sidebar.collapsed .nav-item {
	padding: 0.875rem;
	justify-content: center;
}

.sidebar.collapsed .nav-item span {
	display: none;
}

.sidebar.collapsed .sidebar-footer {
	padding: 1rem 0.75rem;
}

.sidebar.collapsed .user-details {
	display: none;
}

.sidebar.collapsed .user-info {
	justify-content: center;
}

.sidebar.collapsed .logout-btn {
	padding: 0.5rem;
	font-size: 0;
}

.sidebar.collapsed .logout-btn::before {
	content: '';
	display: block;
	width: 20px;
	height: 20px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1'/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
}

.portal-layout {
	transition: padding-left 0.2s;
}

body.sidebar-collapsed .main-content {
	margin-left: 72px;
}

.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: var(--primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	color: #fff;
}

.user-avatar img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

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

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

.user-email {
	font-size: 0.75rem;
	color: #94a3b8;
	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.4);
	border-radius: 6px;
	background: rgba(239, 68, 68, 0.1);
	color: #fca5a5;
	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 {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 2rem;
}

.page-header h1 {
	font-size: 1.75rem;
	margin-bottom: 0.5rem;
	color: var(--text-primary);
}

.page-header p {
	color: var(--text-secondary);
}

.header-actions {
	display: flex;
	gap: 0.75rem;
}

/* Cards */
.card {
	background: var(--bg-card);
	border-radius: 12px;
	padding: 1.5rem;
	border: 1px solid var(--border);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

.card-title {
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-primary);
}

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

.stat-card {
	background: var(--bg-card);
	border-radius: 12px;
	padding: 1.5rem;
	border: 1px solid var(--border);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.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(37, 99, 235, 0.1);
	color: var(--primary);
}

.stat-card .stat-icon.green {
	background: rgba(16, 185, 129, 0.1);
	color: var(--success);
}

.stat-card .stat-icon.orange {
	background: rgba(245, 158, 11, 0.1);
	color: var(--warning);
}

.stat-card .stat-icon.purple {
	background: rgba(99, 102, 241, 0.1);
	color: var(--info);
}

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

.stat-card .stat-value {
	font-size: 2rem;
	font-weight: 700;
	margin-bottom: 0.25rem;
	color: var(--text-primary);
}

.stat-card .stat-label {
	color: var(--text-secondary);
	font-size: 0.875rem;
}

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

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

.btn-primary:hover:not(:disabled) {
	background: var(--primary-dark);
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
	background: var(--bg-card);
	color: var(--text-primary);
	border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
	background: var(--bg-main);
	border-color: var(--text-muted);
}

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

.btn-danger:hover:not(:disabled) {
	background: rgba(239, 68, 68, 0.15);
	border-color: var(--danger);
}

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

.btn-sm {
	padding: 0.375rem 0.75rem;
	font-size: 0.75rem;
}

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

.btn-sm svg {
	width: 14px;
	height: 14px;
}

/* 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 var(--border);
}

th {
	color: var(--text-secondary);
	font-weight: 600;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	background: var(--bg-main);
}

td {
	font-size: 0.875rem;
	color: var(--text-primary);
}

tr:hover {
	background: var(--bg-main);
}

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

.form-group label {
	display: block;
	color: var(--text-primary);
	font-size: 0.875rem;
	font-weight: 500;
	margin-bottom: 0.5rem;
}

.form-control {
	width: 100%;
	padding: 0.75rem 1rem;
	font-size: 0.875rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--bg-card);
	color: var(--text-primary);
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
	color: var(--text-muted);
}

select.form-control {
	cursor: pointer;
}

select.form-control option {
	background: var(--bg-card);
	color: var(--text-primary);
}

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

.badge-success {
	background: rgba(16, 185, 129, 0.1);
	color: #059669;
}

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

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

.badge-info {
	background: rgba(99, 102, 241, 0.1);
	color: #4f46e5;
}

/* Pagination */
.pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 0;
	margin-top: 1rem;
	flex-wrap: wrap;
	gap: 1rem;
}

.pagination-info {
	color: var(--text-secondary);
	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 var(--border);
	border-radius: 6px;
	background: var(--bg-card);
	color: var(--text-primary);
	cursor: pointer;
	transition: all 0.2s;
	min-width: 36px;
	text-align: center;
}

.pagination-btn:hover:not(:disabled) {
	background: var(--bg-main);
	border-color: var(--text-muted);
}

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

.pagination-btn.active {
	background: var(--primary);
	border-color: var(--primary);
	color: #fff;
}

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

.pagination-size label {
	font-size: 0.875rem;
	color: var(--text-secondary);
}

.pagination-size select {
	padding: 0.375rem 0.5rem;
	font-size: 0.875rem;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: var(--bg-card);
	color: var(--text-primary);
	cursor: pointer;
}

.pagination-ellipsis {
	padding: 0.5rem 0.25rem;
	color: var(--text-muted);
}

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

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

.modal-content {
	background: var(--bg-card);
	border-radius: 16px;
	max-width: 600px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	border: 1px solid var(--border);
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	transform: translateY(20px);
	transition: transform 0.3s;
	padding: 0;
}

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

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

.modal-header h2,
.modal-header h3 {
	font-size: 1.125rem;
	margin: 0;
	color: var(--text-primary);
}

.modal-close {
	background: none;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	padding: 0.25rem;
	font-size: 1.5rem;
	line-height: 1;
	transition: color 0.2s;
}

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

.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 var(--border);
}

.modal-content form {
	padding: 1.5rem;
}

.modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

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

.empty-state svg {
	width: 64px;
	height: 64px;
	color: var(--text-muted);
	margin-bottom: 1rem;
}

.empty-state h3 {
	font-size: 1.125rem;
	margin-bottom: 0.5rem;
	color: var(--text-primary);
}

.empty-state p {
	color: var(--text-secondary);
	margin-bottom: 1.5rem;
}

/* Loading Spinner */
.spinner {
	width: 20px;
	height: 20px;
	border: 2px solid var(--border);
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

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

.loading-spinner {
	text-align: center;
	padding: 2rem;
	color: var(--text-secondary);
}

/* 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;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

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

.toast-success {
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	color: #059669;
}

.toast-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #dc2626;
}

.toast-info {
	background: #eef2ff;
	border: 1px solid #c7d2fe;
	color: #4f46e5;
}

/* 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: #059669;
}

.balance-label {
	font-size: 0.75rem;
	color: var(--text-secondary);
}

/* Auth Pages */
.auth-container {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.auth-card {
	background: var(--bg-card);
	border-radius: 16px;
	padding: 2.5rem;
	width: 100%;
	max-width: 400px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.auth-logo {
	text-align: center;
	margin-bottom: 2rem;
}

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

.auth-logo h1 {
	font-size: 2rem;
	color: var(--primary);
}

.auth-title {
	text-align: center;
	margin-bottom: 0.5rem;
	color: var(--text-primary);
}

.auth-subtitle {
	text-align: center;
	color: var(--text-secondary);
	margin-bottom: 2rem;
}

.auth-form .form-control {
	margin-bottom: 1rem;
}

.auth-form .btn {
	width: 100%;
	padding: 0.875rem;
	font-size: 1rem;
	margin-top: 0.5rem;
}

.auth-links {
	text-align: center;
	margin-top: 1.5rem;
	color: var(--text-secondary);
}

.auth-links a {
	color: var(--primary);
	text-decoration: none;
	font-weight: 500;
}

.auth-links a:hover {
	text-decoration: underline;
}

.auth-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
	padding: 1rem;
	margin-bottom: 1rem;
	color: #dc2626;
	text-align: center;
	display: none;
}

.auth-error.show {
	display: block;
}

.auth-success {
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	border-radius: 8px;
	padding: 1rem;
	margin-bottom: 1rem;
	color: #059669;
	text-align: center;
	display: none;
}

.auth-success.show {
	display: block;
}

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

.sidebar-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(15, 23, 42, 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: #94a3b8;
	cursor: pointer;
	padding: 0.5rem;
	transition: color 0.2s;
}

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

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

/* Action Buttons */
.action-buttons {
	display: flex;
	gap: 0.5rem;
}

/* Section Description */
.section-description {
	color: var(--text-secondary);
	margin-bottom: 1rem;
}

/* Quick Add Grid (Wallet) */
.quick-add-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
	gap: 0.75rem;
}

.quick-add-btn {
	padding: 1rem;
	background: var(--bg-main);
	border: 1px solid var(--border);
	border-radius: 8px;
	color: var(--text-primary);
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
}

.quick-add-btn:hover {
	background: var(--primary);
	color: #fff;
	border-color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
	.sidebar {
		transform: translateX(-100%);
		z-index: 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: var(--bg-card);
		border-radius: 12px;
		margin-bottom: 1.5rem;
		border: 1px solid var(--border);
	}

	.mobile-menu-btn {
		background: none;
		border: none;
		color: var(--text-primary);
		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;
		color: var(--primary);
	}

	.page-header {
		flex-direction: column;
		gap: 1rem;
		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;
	}

	.card {
		padding: 1rem;
	}

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

	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;
	}

	.auth-card {
		padding: 1.5rem;
	}

	.action-buttons {
		flex-direction: column;
	}
}
