/* IGBot Portal Styles - Sidebar Layout */

/* Auth Pages Layout */
.auth-layout {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #F3F0EE 0%, #BDD9D7 100%);
	padding: var(--space-4);
}

.auth-container {
	width: 100%;
	max-width: 420px;
}

.auth-card {
	background-color: var(--white);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-lg);
	padding: var(--space-8);
}

.auth-logo {
	text-align: center;
	margin-bottom: var(--space-6);
}

.auth-logo .logo {
	font-size: 2rem;
}

.auth-title {
	text-align: center;
	font-size: 1.5rem;
	margin-bottom: var(--space-2);
}

.auth-subtitle {
	text-align: center;
	color: var(--gray-500);
	margin-bottom: var(--space-6);
}

.auth-form .btn-primary {
	width: 100%;
	padding: var(--space-4);
	font-size: 1rem;
}

.auth-footer {
	text-align: center;
	margin-top: var(--space-6);
	color: var(--gray-500);
	font-size: 0.875rem;
}

.auth-footer a {
	font-weight: 500;
}

/* Turnstile Widget */
.turnstile-container {
	display: flex;
	justify-content: center;
	margin-bottom: var(--space-4);
}

/* Portal Layout - Sidebar */
.portal-layout {
	display: flex;
	min-height: 100vh;
	background-color: var(--gray-50);
}

/* Sidebar */
.sidebar {
	width: 260px;
	background-color: var(--primary);
	padding: 1.5rem 0;
	display: flex;
	flex-direction: column;
	position: fixed;
	height: 100vh;
	overflow-y: auto;
	z-index: 100;
}

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

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

.sidebar-logo h1 {
	font-size: 1.75rem;
	color: var(--white);
}

.sidebar-nav {
	flex: 1;
}

.nav-item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.875rem 1.5rem;
	color: var(--accent);
	text-decoration: none;
	transition: all 0.2s;
	border-left: 3px solid transparent;
	position: relative;
}

/* Support notification badge */
.nav-badge {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 10px;
	height: 10px;
	background: #f59e0b;
	border-radius: 50%;
	border: 2px solid var(--primary);
}

.nav-item:hover {
	background: rgba(255, 255, 255, 0.1);
	color: var(--white);
}

.nav-item.active {
	background: rgba(255, 255, 255, 0.15);
	color: var(--white);
	border-left-color: var(--accent);
}

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

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

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

.user-email {
	font-size: 0.75rem;
	color: var(--accent);
	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(255, 255, 255, 0.3);
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.1);
	color: var(--white);
	cursor: pointer;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.logout-btn svg {
	flex-shrink: 0;
}

.logout-btn:hover {
	background: rgba(255, 255, 255, 0.2);
	border-color: var(--white);
}

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

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

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

.page-header p {
	color: var(--gray-500);
	margin-bottom: 0;
}

/* Cards */
.card {
	background: var(--white);
	border-radius: 12px;
	padding: 1.5rem;
	border: 1px solid var(--gray-200);
	box-shadow: var(--shadow-sm);
}

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

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

/* 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(--white);
	border-radius: 12px;
	padding: 1.5rem;
	border: 1px solid var(--gray-200);
}

.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.primary {
	background: rgba(3, 54, 61, 0.1);
	color: var(--primary);
}

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

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

.stat-card .stat-icon.info {
	background: rgba(59, 130, 246, 0.1);
	color: #3b82f6;
}

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

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

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

/* Subscription Banner (Compact) */
.subscription-banner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.75rem 1rem;
	border-radius: 8px;
	margin-bottom: 1.5rem;
}

.subscription-banner-trial {
	background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
	color: var(--white);
}

.subscription-banner-warning {
	background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
	color: var(--white);
}

.subscription-banner-expired {
	background: linear-gradient(135deg, var(--gray-600) 0%, var(--gray-700) 100%);
	color: var(--white);
}

.subscription-banner-content {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	font-size: 0.875rem;
	font-weight: 500;
}

.subscription-banner-content svg {
	flex-shrink: 0;
	opacity: 0.9;
}

.subscription-banner .btn {
	background-color: var(--white);
	color: var(--gray-900);
	padding: 0.375rem 0.875rem;
	font-size: 0.8125rem;
	white-space: nowrap;
}

.subscription-banner .btn:hover {
	background-color: var(--gray-100);
}

@media (max-width: 480px) {
	.subscription-banner {
		flex-direction: column;
		align-items: stretch;
		gap: 0.75rem;
		text-align: center;
	}

	.subscription-banner-content {
		justify-content: center;
	}

	.subscription-banner .btn {
		width: 100%;
		justify-content: center;
	}
}

/* Buttons in Portal */
.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: var(--primary);
	color: var(--white);
}

.btn-primary:hover:not(:disabled) {
	background: var(--primary-dark);
	transform: translateY(-1px);
	box-shadow: 0 4px 15px rgba(3, 54, 61, 0.3);
}

.btn-secondary {
	background: var(--white);
	color: var(--gray-700);
	border: 1px solid var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
	background: var(--gray-50);
	border-color: var(--gray-400);
}

.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-warning {
	background: rgba(245, 158, 11, 0.1);
	color: #f59e0b;
	border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-warning:hover:not(:disabled) {
	background: rgba(245, 158, 11, 0.2);
}

.btn-success {
	background: rgba(34, 197, 94, 0.1);
	color: #22c55e;
	border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-success:hover:not(:disabled) {
	background: rgba(34, 197, 94, 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 var(--gray-200);
}

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

td {
	font-size: 0.875rem;
	color: var(--gray-700);
}

tr:hover {
	background: var(--gray-50);
}

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

.form-group label {
	display: block;
	color: var(--gray-600);
	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(--gray-300);
	border-radius: 8px;
	background: var(--white);
	color: var(--gray-900);
	outline: none;
	transition: border-color 0.3s, box-shadow 0.3s;
}

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

.form-control::placeholder {
	color: var(--gray-400);
}

select.form-control {
	cursor: pointer;
}

/* 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.1);
	color: #10b981;
}

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

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

.badge-info {
	background: rgba(59, 130, 246, 0.1);
	color: #3b82f6;
}

/* Modal */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	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: var(--white);
	border-radius: 16px;
	max-width: 600px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	border: 1px solid var(--gray-200);
	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 var(--gray-200);
}

.modal-header h3 {
	font-size: 1.125rem;
	color: var(--gray-900);
}

.modal-close {
	background: none;
	border: none;
	color: var(--gray-400);
	cursor: pointer;
	padding: 0.25rem;
	transition: color 0.2s;
}

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

.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(--gray-200);
}

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

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

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

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

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

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

/* Button Spinner */
.btn .btn-icon {
	flex-shrink: 0;
}

.btn .btn-icon.spinning {
	animation: spin 1s linear infinite;
}

/* 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;
	background: var(--white);
	border: 1px solid var(--gray-200);
	box-shadow: var(--shadow-lg);
}

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

.toast-success {
	background: #f0fdf4;
	border-color: #86efac;
	color: #166534;
}

.toast-error {
	background: #fef2f2;
	border-color: #fca5a5;
	color: #991b1b;
}

.toast-info {
	background: #eff6ff;
	border-color: #93c5fd;
	color: #1e40af;
}

/* Settings Tabs */
.settings-tabs {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
	border-bottom: 1px solid var(--gray-200);
	padding-bottom: 0.5rem;
}

.tab-btn {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	background: none;
	border: none;
	padding: 0.75rem 1.25rem;
	color: var(--gray-500);
	cursor: pointer;
	font-size: 0.875rem;
	font-weight: 500;
	border-radius: 6px;
	transition: all 0.2s;
}

.tab-btn svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.tab-btn:hover {
	background: var(--gray-50);
	color: var(--gray-700);
}

.tab-btn.active {
	background: rgba(3, 54, 61, 0.1);
	color: var(--primary);
}

.tab-content {
	display: none;
}

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

.settings-section {
	margin-bottom: 2rem;
}

.settings-section h3 {
	font-size: 1rem;
	color: var(--gray-900);
	margin-bottom: 1rem;
}

.settings-form {
	max-width: 500px;
}

/* Instagram Card */
.instagram-card {
	background-color: var(--white);
	border-radius: 12px;
	border: 1px solid var(--gray-200);
	padding: 1.5rem;
	margin-bottom: 1.5rem;
}

.instagram-connected {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.instagram-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcaf45 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-weight: 600;
	font-size: 0.875rem;
	text-transform: uppercase;
	flex-shrink: 0;
	overflow: hidden;
}

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

.instagram-info {
	flex: 1;
}

.instagram-username {
	font-weight: 600;
	color: var(--gray-900);
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.instagram-status {
	font-size: 0.875rem;
	color: var(--gray-500);
}

.instagram-not-connected {
	text-align: center;
	padding: 1rem;
}

.instagram-not-connected svg {
	width: 48px;
	height: 48px;
	color: var(--gray-300);
	margin-bottom: 0.75rem;
}

/* Posts Grid - Instagram Style */
.posts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 4px;
	justify-content: center;
}

@media (max-width: 768px) {
	.posts-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 3px;
	}
}

@media (max-width: 480px) {
	.posts-grid {
		gap: 2px;
	}
}

.post-card {
	position: relative;
	background-color: var(--gray-100);
	overflow: hidden;
	cursor: pointer;
	aspect-ratio: 4 / 5;
	max-width: 580px;
	max-height: 725px;
	width: 100%;
	justify-self: center;
	transition: box-shadow 0.3s ease;
}

/* New post highlight animation */
.post-card-new {
	animation: newPostHighlight 2s ease-out;
	box-shadow: 0 0 0 3px var(--primary), 0 0 20px rgba(72, 161, 153, 0.4);
}

@keyframes newPostHighlight {
	0% {
		box-shadow: 0 0 0 3px var(--primary), 0 0 30px rgba(72, 161, 153, 0.6);
		transform: scale(1.02);
	}
	50% {
		box-shadow: 0 0 0 3px var(--primary), 0 0 20px rgba(72, 161, 153, 0.4);
	}
	100% {
		box-shadow: none;
		transform: scale(1);
	}
}

/* Deleted post fade-out animation */
.post-card-deleted {
	animation: deletedPostFadeOut 0.3s ease-out forwards;
}

@keyframes deletedPostFadeOut {
	0% {
		opacity: 1;
		transform: scale(1);
	}
	100% {
		opacity: 0;
		transform: scale(0.9);
	}
}

.post-card:hover .post-overlay {
	opacity: 1;
}

.post-card:hover .post-video-icon {
	opacity: 0;
}

/* Video Icon - centered, disappears on hover */
.post-video-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 40px;
	height: 40px;
	background: rgba(255, 255, 255, 0.95);
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	transition: opacity 0.2s ease;
	pointer-events: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.post-video-icon svg {
	margin-left: 2px; /* Optical centering for play icon */
	fill: #4b5563;
}

.post-image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: var(--gray-100);
}

.post-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.post-image-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: var(--gray-400);
}

.post-image-placeholder svg {
	width: 48px;
	height: 48px;
}

/* Hover Overlay */
.post-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.4);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.post-stats {
	display: flex;
	align-items: center;
	gap: 1.5rem;
}

.post-stat {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--white);
	font-weight: 600;
	font-size: 1rem;
}

.post-stat svg {
	width: 20px;
	height: 20px;
	fill: var(--white);
}

.post-action-btn {
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
	font-weight: 600;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s;
}

.post-action-btn.manage {
	background: var(--white);
	color: var(--gray-900);
}

.post-action-btn.manage:hover {
	background: var(--gray-100);
}

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

.post-action-btn.resume:hover {
	background: var(--primary-dark);
}

.post-action-btn.create {
	background: var(--white);
	color: var(--gray-900);
}

.post-action-btn.create:hover {
	background: var(--gray-100);
}

/* Automation Badge */
.post-automation-badge {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	padding: 0.25rem 0.5rem;
	font-size: 0.625rem;
	font-weight: 600;
	border-radius: 4px;
	text-transform: uppercase;
	z-index: 1;
}

.post-automation-badge.active {
	background-color: var(--success);
	color: var(--white);
}

.post-automation-badge.paused {
	background-color: var(--gray-500);
	color: var(--white);
}

.post-automation-badge.scheduled {
	background-color: var(--warning, #f59e0b);
	color: var(--white);
}

/* Account Badge (shown when multiple accounts) */
.post-account-badge {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	padding: 0.25rem 0.5rem;
	font-size: 0.625rem;
	font-weight: 600;
	border-radius: 4px;
	background-color: rgba(0, 0, 0, 0.7);
	color: var(--white);
	z-index: 1;
}

/* Post Skeleton */
.post-skeleton {
	aspect-ratio: 4 / 5;
	border-radius: 0;
}

/* Keywords Input */
.keywords-input {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding: 0.75rem;
	border: 1px solid var(--gray-300);
	border-radius: 8px;
	min-height: 44px;
	cursor: text;
}

.keywords-input:focus-within {
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(3, 54, 61, 0.1);
}

.keyword-tag {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.25rem 0.5rem;
	background-color: var(--gray-100);
	border-radius: 4px;
	font-size: 0.8125rem;
}

.keyword-tag button {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--gray-500);
	padding: 0;
	display: flex;
	line-height: 1;
}

.keyword-tag button:hover {
	color: var(--error);
}

.keywords-input input {
	flex: 1;
	min-width: 100px;
	border: none;
	outline: none;
	font-size: 0.875rem;
}

/* Schedule Section */
.schedule-section {
	margin-top: 1rem;
	padding: 1rem;
	background-color: var(--blue-50, #eff6ff);
	border-radius: 8px;
}

.schedule-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.schedule-label {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--gray-700);
}

.schedule-info {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem;
	background-color: var(--blue-100, #dbeafe);
	border-radius: 6px;
	font-size: 0.875rem;
	color: var(--blue-700, #1d4ed8);
	margin-top: 0.75rem;
}

.timezone-hint {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.25rem;
	margin-top: 0.5rem;
	color: var(--gray-600);
}

.timezone-change-link {
	color: var(--primary);
	text-decoration: none;
	margin-left: 0.5rem;
}

.timezone-change-link:hover {
	text-decoration: underline;
}

.schedule-info-icon {
	flex-shrink: 0;
}

.btn-link {
	background: none;
	border: none;
	color: var(--primary);
	text-decoration: underline;
	cursor: pointer;
	font-size: inherit;
	padding: 0;
	margin-left: auto;
}

.btn-link:hover {
	color: var(--primary-hover);
}

/* Auto Reply Section */
.auto-reply-section {
	margin-top: 1rem;
	padding: 1rem;
	background-color: var(--gray-50);
	border-radius: 8px;
}

.auto-reply-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.75rem;
}

.auto-reply-label {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--gray-700);
}

/* Logs */
.logs-filters {
	display: flex;
	gap: 0.75rem;
	margin-bottom: 1rem;
	flex-wrap: wrap;
}

.logs-filters select {
	padding: 0.5rem 0.75rem;
	font-size: 0.875rem;
	border: 1px solid var(--gray-300);
	border-radius: 6px;
	background-color: var(--white);
}

.log-status {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	font-size: 0.75rem;
	font-weight: 500;
}

.log-status-sent {
	background-color: var(--success-light);
	color: #065f46;
}

.log-status-failed {
	background-color: var(--error-light);
	color: #991b1b;
}

.log-status-pending {
	background-color: var(--warning-light);
	color: #92400e;
}

.log-message {
	max-width: 300px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

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

.pagination-info {
	color: var(--gray-500);
	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(--gray-300);
	border-radius: 6px;
	background: var(--white);
	color: var(--gray-700);
	cursor: pointer;
	transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
	background: var(--gray-50);
	border-color: var(--gray-400);
}

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

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

/* 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, width 0.3s ease;
}

/* Collapsed Sidebar (Compact Mode) */
.sidebar.collapsed {
	width: 72px;
}

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

.sidebar.collapsed .sidebar-logo {
	padding: 0;
	display: flex;
	justify-content: center;
}

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

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

.sidebar.collapsed .nav-item svg {
	width: 22px;
	height: 22px;
}

.sidebar.collapsed .nav-item.active {
	border-left: none;
	border-radius: 8px;
	margin: 0 0.5rem;
}

/* Badge position when sidebar is collapsed - must override .nav-item span display:none */
.sidebar.collapsed .nav-item span.nav-badge {
	display: block;
	top: 4px;
	right: 18px;
}

/* Badge position when sidebar is collapsed AND nav-item is active (has extra margin) */
.sidebar.collapsed .nav-item.active span.nav-badge {
	right: 10px;
}

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

.sidebar.collapsed .user-info {
	flex-direction: column;
	gap: 0;
}

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

.sidebar.collapsed .user-avatar {
	width: 36px;
	height: 36px;
	font-size: 0.75rem;
}

.sidebar.collapsed .logout-btn {
	padding: 0.5rem;
	display: flex;
	justify-content: center;
}

.sidebar.collapsed .logout-btn span {
	display: none;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
	position: absolute;
	top: 1.75rem;
	right: 0.75rem;
	width: 28px;
	height: 28px;
	background: rgba(255, 255, 255, 0.15);
	border: none;
	border-radius: 6px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 101;
	transition: background 0.2s ease;
}

.sidebar-toggle:hover {
	background: rgba(255, 255, 255, 0.25);
}

.sidebar-toggle svg {
	width: 16px;
	height: 16px;
	stroke: var(--accent);
	transition: transform 0.3s ease;
}

.sidebar-toggle:hover svg {
	stroke: white;
}

.sidebar.collapsed .sidebar-toggle {
	top: 0.75rem;
	right: 50%;
	transform: translateX(50%);
}

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

.sidebar.collapsed .sidebar-logo {
	margin-bottom: 3rem;
}

/* Adjust main content for collapsed sidebar */
.portal-layout.sidebar-collapsed .main-content {
	margin-left: 72px;
}

.main-content {
	transition: margin-left 0.3s ease;
}

.sidebar-close {
	display: none;
	position: absolute;
	top: 1rem;
	right: 1rem;
	background: none;
	border: none;
	color: var(--accent);
	cursor: pointer;
	padding: 0.5rem;
	transition: color 0.2s;
}

.sidebar-close:hover {
	color: var(--white);
}

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

/* Responsive */
@media (max-width: 768px) {
	.sidebar {
		transform: translateX(-100%);
		z-index: 100;
		width: 260px !important;
	}

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

	.sidebar.collapsed {
		width: 260px !important;
	}

	.sidebar.collapsed .sidebar-logo h1,
	.sidebar.collapsed .nav-item span,
	.sidebar.collapsed .user-details {
		display: block;
	}

	.sidebar.collapsed .nav-item {
		padding: 0.875rem 1.5rem;
		justify-content: flex-start;
	}

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

	.sidebar.collapsed .user-info {
		flex-direction: row;
		gap: 0.75rem;
	}

	.sidebar.collapsed .logout-btn {
		font-size: 0.875rem;
		padding: 0.625rem;
	}

	.sidebar.collapsed .logout-btn span {
		display: inline;
	}

	.sidebar-toggle {
		display: none;
	}

	.sidebar-close {
		display: block;
	}

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

	.mobile-header {
		display: flex;
		align-items: center;
		gap: 1rem;
		padding: 1rem;
		background: var(--white);
		border-radius: 12px;
		margin-bottom: 1.5rem;
		box-shadow: var(--shadow-sm);
	}

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

	/* Settings tabs responsive */
	.settings-tabs {
		flex-wrap: wrap;
	}

	.tab-btn {
		flex: 1;
		min-width: 100px;
		text-align: center;
	}

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

/* Billing Styles */
.plan-options {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1rem;
	margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
	.plan-options {
		grid-template-columns: 1fr;
	}
}

.plan-card {
	background: var(--white);
	border: 2px solid var(--gray-200);
	border-radius: 12px;
	padding: 1.5rem;
	cursor: pointer;
	transition: all 0.2s;
}

.plan-card:hover {
	border-color: var(--primary);
}

.plan-card.selected {
	border-color: var(--primary);
	background: rgba(3, 54, 61, 0.05);
}

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

.plan-name {
	font-weight: 600;
	color: var(--gray-900);
}

.plan-badge {
	background: var(--success);
	color: var(--white);
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	font-size: 0.625rem;
	font-weight: 600;
	text-transform: uppercase;
}

.plan-price {
	font-size: 2rem;
	font-weight: 700;
	color: var(--primary);
}

.plan-period {
	font-size: 0.875rem;
	color: var(--gray-500);
	font-weight: normal;
}

.plan-description {
	font-size: 0.875rem;
	color: var(--gray-500);
	margin-top: 0.5rem;
}

/* Danger Zone */
.danger-zone {
	border: 1px solid rgba(239, 68, 68, 0.3);
	background-color: rgba(239, 68, 68, 0.03);
	border-radius: 12px;
}

.danger-zone .settings-section-header {
	border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

.danger-zone .settings-section-title {
	color: #dc2626;
}

/* Settings Section Styles */
.settings-section {
	background: var(--white);
	border: 1px solid var(--gray-200);
	border-radius: 12px;
	margin-bottom: 1.5rem;
}

.settings-section-header {
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid var(--gray-200);
}

.settings-section-title {
	font-size: 1rem;
	font-weight: 600;
	color: var(--gray-900);
	margin: 0;
}

.settings-section-body {
	padding: 1.5rem;
}

.settings-row {
	display: flex;
	gap: 2rem;
	padding: 1rem 0;
	border-bottom: 1px solid var(--gray-100);
}

.settings-row:first-child {
	padding-top: 0;
}

.settings-row:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.settings-label {
	flex: 0 0 200px;
}

.settings-label h4 {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--gray-900);
	margin: 0 0 0.25rem 0;
}

.settings-label p {
	font-size: 0.8125rem;
	color: var(--gray-500);
	margin: 0;
}

.settings-value {
	flex: 1;
}

@media (max-width: 768px) {
	.settings-row {
		flex-direction: column;
		gap: 0.75rem;
	}

	.settings-label {
		flex: none;
	}
}

/* Infinite Scroll Loading Indicator */
.loading-more {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	padding: 2rem;
	color: var(--gray-500);
	font-size: 0.875rem;
}

.loading-more .spinner {
	width: 20px;
	height: 20px;
	border-width: 2px;
}

/* End of Posts Indicator */
.end-of-posts {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	color: var(--gray-400);
	font-size: 0.875rem;
}

.end-of-posts::before,
.end-of-posts::after {
	content: '';
	flex: 1;
	max-width: 100px;
	height: 1px;
	background: var(--gray-200);
	margin: 0 1rem;
}
