/* ── Dark theme overrides ── */
[data-bs-theme='dark'] body {
	background: #0f1117;
	color: #e2e8f0;
}
.navbar {
	position: sticky;
	top: 0;
	z-index: 1030;
	padding-top: calc(var(--bs-navbar-padding-y, 0.5rem) + env(safe-area-inset-top, 0px));
}
/* Respect the device safe areas (notch, home indicator, gesture bar). */
body {
	padding-bottom: env(safe-area-inset-bottom, 0px);
}
[data-bs-theme='dark'] .navbar {
	background: #1a1d2e !important;
	border-bottom: 1px solid #2d3148;
}
[data-bs-theme='dark'] .card {
	background: #1e2235;
	border: 1px solid #2d3148;
}
[data-bs-theme='dark'] .card-header {
	background: #252840;
	border-bottom: 1px solid #2d3148;
}
[data-bs-theme='dark'] .form-control,
[data-bs-theme='dark'] .form-select {
	background: #252840;
	border-color: #3d4268;
	color: #e2e8f0;
}
[data-bs-theme='dark'] .form-control:focus,
[data-bs-theme='dark'] .form-select:focus {
	background: #2d3154;
	border-color: #818cf8;
	color: #e2e8f0;
}
[data-bs-theme='dark'] .form-control::placeholder {
	color: #64748b;
}
[data-bs-theme='dark'] .table {
	color: #e2e8f0;
}
[data-bs-theme='dark'] .table-bordered td,
[data-bs-theme='dark'] .table-bordered th {
	border-color: #2d3148;
}

/* Fix dropdown menu positioning - only for specific dropdowns */
.navbar-nav .dropdown-menu {
	position: fixed !important;
	right: 10px !important;
	left: auto !important;
	transform: none !important;
	top: auto !important;
	margin-top: 5px !important;
}

@media (max-width: 768px) {
	.navbar-nav .dropdown-menu {
		right: 5px !important;
		left: 5px !important;
		width: auto !important;
		max-width: calc(100vw - 10px) !important;
	}
}

/* ── Tailwind dark theme fixes ── */
.dark .bg-white {
	background-color: #1e2235 !important;
}
.dark .bg-gray-50 {
	background-color: #334155 !important;
}
.dark .bg-gray-100 {
	background-color: #374151 !important;
}
.dark .bg-gray-200 {
	background-color: #4b5563 !important;
}
.dark .bg-gray-700 {
	background-color: #374151 !important;
}
.dark .bg-gray-800 {
	background-color: #1f2937 !important;
}
.dark .bg-blue-50 {
	background-color: #1e3a8a !important;
}
.dark .bg-blue-100 {
	background-color: #1e40af !important;
}
.dark .bg-green-100 {
	background-color: #064e3b !important;
}
.dark .bg-red-100 {
	background-color: #7f1d1d !important;
}
.dark .bg-yellow-100 {
	background-color: #78350f !important;
}
.dark .border-gray-200 {
	border-color: #374151 !important;
}
.dark .border-gray-300 {
	border-color: #4b5563 !important;
}
.dark .border-gray-600 {
	border-color: #4b5563 !important;
}
.dark .border-blue-200 {
	border-color: #1e40af !important;
}
.dark .border-blue-800 {
	border-color: #1e40af !important;
}
.dark .text-gray-100 {
	color: #e2e8f0 !important;
}
.dark .text-gray-200 {
	color: #d1d5db !important;
}
.dark .text-gray-300 {
	color: #9ca3af !important;
}
.dark .text-gray-400 {
	color: #6b7280 !important;
}
.dark .text-gray-500 {
	color: #6b7280 !important;
}
.dark .text-gray-600 {
	color: #9ca3af !important;
}
.dark .text-gray-700 {
	color: #d1d5db !important;
}
.dark .text-gray-900 {
	color: #e2e8f0 !important;
}
.dark .text-blue-100 {
	color: #dbeafe !important;
}
.dark .text-blue-200 {
	color: #bfdbfe !important;
}
.dark .text-green-600 {
	color: #34d399 !important;
}
.dark .text-green-400 {
	color: #10b981 !important;
}
.dark .text-red-600 {
	color: #f87171 !important;
}
.dark .text-red-400 {
	color: #ef4444 !important;
}
.dark .text-yellow-600 {
	color: #fbbf24 !important;
}
.dark .text-yellow-400 {
	color: #f59e0b !important;
}
.dark .hover\:bg-gray-50:hover {
	background-color: #374151 !important;
}
.dark .hover\:bg-gray-200:hover {
	background-color: #4b5563 !important;
}
.dark .hover\:bg-gray-700:hover {
	background-color: #4b5563 !important;
}
.dark .hover\:bg-blue-600:hover {
	background-color: #2563eb !important;
}
.dark .hover\:bg-blue-700:hover {
	background-color: #1d4ed8 !important;
}
.dark .hover\:opacity-80:hover {
	opacity: 0.8 !important;
}

/* Additional fixes for form elements */
.dark input[type='text'],
.dark input[type='number'],
.dark input[type='email'],
.dark input[type='password'],
.dark textarea,
.dark select {
	background-color: #374151 !important;
	border-color: #4b5563 !important;
	color: #e2e8f0 !important;
}
.dark input[type='text']:focus,
.dark input[type='number']:focus,
.dark input[type='email']:focus,
.dark input[type='password']:focus,
.dark textarea:focus,
.dark select:focus {
	background-color: #4b5563 !important;
	border-color: #8b5cf6 !important;
	color: #e2e8f0 !important;
}
.dark input[type='checkbox'] {
	background-color: #374151 !important;
	border-color: #4b5563 !important;
	accent-color: #8b5cf6 !important;
}
.dark .shadow-md {
	box-shadow:
		0 4px 6px -1px rgba(0, 0, 0, 0.3),
		0 2px 4px -1px rgba(0, 0, 0, 0.2) !important;
}

/* ── Shared (both themes) ── */
.navbar-brand {
	position: absolute;
	left: 50%;
	top: 50%;
	translate: -50% -50%;
	z-index: 1;
	font-size: 1.6em;
	font-weight: 700;
	letter-spacing: 0.5px;
	margin-right: 8px;
}

.navbar-brand span {
	transition: color 0.2s ease;
}

.navbar-brand .brand-inner {
	scale: 1;
	transform-origin: center;
	will-change: scale;
	transition: scale 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.navbar-brand:hover .brand-inner {
	scale: 1.05;
}

[data-bs-theme='dark'] .navbar-brand {
	color: #a78bfa !important;
}

[data-bs-theme='dark'] .navbar-brand:hover {
	color: #c4b5fd !important;
}

[data-bs-theme='light'] .navbar-brand {
	color: #7c3aed !important;
}

[data-bs-theme='light'] .navbar-brand:hover {
	color: #8b5cf6 !important;
}

[data-bs-theme='dark'] .nav-link {
	color: #cbd5e1 !important;
	padding-left: 8px !important;
	padding-right: 8px !important;
	transition: color 0.2s ease, transform 0.2s ease;
	position: relative;
}

[data-bs-theme='dark'] .nav-link:not(.dropdown-toggle)::after {
	content: '';
	position: absolute;
	bottom: -2px;
	left: 50%;
	width: 0;
	height: 2px;
	background: #a78bfa;
	transition: width 0.2s ease, left 0.2s ease;
}

[data-bs-theme='dark'] .nav-link:not(.dropdown-toggle):hover::after,
[data-bs-theme='dark'] .nav-link:not(.dropdown-toggle).active::after {
	width: 100%;
	left: 0;
}

[data-bs-theme='dark'] .nav-link:hover,
[data-bs-theme='dark'] .nav-link.active {
	color: #f1f5f9 !important;
}

[data-bs-theme='light'] .nav-link {
	color: #64748b !important;
	padding-left: 8px !important;
	padding-right: 8px !important;
	transition: color 0.2s ease, transform 0.2s ease;
	position: relative;
}

[data-bs-theme='light'] .nav-link:not(.dropdown-toggle)::after {
	content: '';
	position: absolute;
	bottom: -2px;
	left: 50%;
	width: 0;
	height: 2px;
	background: #7c3aed;
	transition: width 0.2s ease, left 0.2s ease;
}

[data-bs-theme='light'] .nav-link:not(.dropdown-toggle):hover::after,
[data-bs-theme='light'] .nav-link:not(.dropdown-toggle).active::after {
	width: 100%;
	left: 0;
}

[data-bs-theme='light'] .nav-link:hover,
[data-bs-theme='light'] .nav-link.active {
	color: #0f172a !important;
}

[data-bs-theme='dark'] .btn-primary {
	background: #8b5cf6;
	border-color: #8b5cf6;
}
[data-bs-theme='dark'] .btn-primary:hover {
	background: #a78bfa;
	border-color: #a78bfa;
}

[data-bs-theme='light'] .btn-primary {
	background: #7c3aed;
	border-color: #7c3aed;
}
[data-bs-theme='light'] .btn-primary:hover {
	background: #8b5cf6;
	border-color: #8b5cf6;
}

/* ── Light theme navbar ── */
[data-bs-theme='light'] .navbar {
	background: #f1f5f9 !important;
	border-bottom: 1px solid #cbd5e1;
}

/* ── Light theme hover effects ── */
[data-bs-theme='light'] a:hover {
	transition: color 0.2s ease;
}

[data-bs-theme='light'] button:hover {
	transition: transform 200ms ease-out, opacity 200ms ease-out;
}

.alert {
	border-radius: 8px;
}

/* ── Typography improvements ── */
body {
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
	line-height: 1.3;
	font-weight: 600;
	letter-spacing: -0.02em;
}

h1 {
	font-size: 2.25rem;
	font-weight: 700;
}

h2 {
	font-size: 1.875rem;
	font-weight: 700;
}

h3 {
	font-size: 1.5rem;
	font-weight: 600;
}

h4 {
	font-size: 1.25rem;
	font-weight: 600;
}

h5 {
	font-size: 1.125rem;
	font-weight: 600;
}

h6 {
	font-size: 1rem;
	font-weight: 600;
}

p {
	line-height: 1.7;
	margin-bottom: 1rem;
}

/* Improved readability for small text */
.text-sm, .small {
	line-height: 1.5;
	letter-spacing: 0.01em;
}

/* Modal typography */
.modal-title {
	font-weight: 600;
	letter-spacing: -0.01em;
}

/* Form labels */
.form-label {
	font-weight: 500;
	letter-spacing: 0.01em;
	line-height: 1.5;
}

/* Task title readability */
.task-title {
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.4;
}

/* Task description readability */
.task-description {
	line-height: 1.6;
	letter-spacing: 0.01em;
}

/* Link text readability */
a {
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

/* Button text readability */
.btn {
	letter-spacing: 0.01em;
	font-weight: 500;
}

/* ── Uniform button outline ──
   Kill the native light-gray browser bevel and use a thin dark outline.
   Bootstrap .btn / .btn-close set their own border and win on specificity. */
button {
	border: 1px solid #3d4268;
}

[data-bs-theme='light'] button {
	border-color: #64748b;
}

/* Buttons that set an explicit light-gray utility border: keep it dark too */
button.border-gray-200,
button.border-gray-300,
button.border-gray-600,
button.border-gray-700 {
	border-color: #3d4268;
}

/* Table cell text readability */
td, th {
	line-height: 1.5;
}

/* Input text readability */
input, textarea, select {
	line-height: 1.5;
	letter-spacing: 0.01em;
}

/* Theme toggle button */
#themeToggle {
	width: 32px;
	height: 32px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	border-radius: 4px;
	transition: transform 200ms ease-out, opacity 200ms ease-out;
}

#themeToggle:hover {
	transform: scale(1.05);
}

#themeToggle:active {
	transform: scale(0.95);
}

/* Button transitions */
.btn {
	transition: transform 200ms ease-out, opacity 200ms ease-out;
}

.btn:hover {
	transform: translateY(-1px);
}

.btn:active {
	transform: scale(0.98);
}

/* Button click feedback */
.btn:active {
	transform: scale(0.95);
}

.btn-primary {
	transition: transform 200ms ease-out, opacity 200ms ease-out;
}

.btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

[data-bs-theme='light'] .btn-primary:hover {
	box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.btn-outline-primary {
	transition: transform 200ms ease-out, opacity 200ms ease-out;
}

.btn-outline-primary:hover {
	transform: translateY(-1px);
}

.btn-outline-secondary {
	transition: transform 200ms ease-out, opacity 200ms ease-out;
}

.btn-outline-secondary:hover {
	transform: translateY(-1px);
}

/* ── Light theme: fix hardcoded dark-theme text colors ──
             #e2e8f0 ≈ off-white  →  #1e293b near-black
             #94a3b8 ≈ light slate →  #475569 dark slate
             #cbd5e1 ≈ very light  →  #334155 dark slate
             These selectors target inline style attributes so we
             don't have to touch every template. ── */
[data-bs-theme='light'] [style*='color:#e2e8f0'] {
	color: #1e293b !important;
}
[data-bs-theme='light'] [style*='color: #e2e8f0'] {
	color: #1e293b !important;
}
[data-bs-theme='light'] [style*='color:#cbd5e1'] {
	color: #334155 !important;
}
[data-bs-theme='light'] [style*='color: #cbd5e1'] {
	color: #334155 !important;
}
[data-bs-theme='light'] [style*='color:#94a3b8'] {
	color: #475569 !important;
}
[data-bs-theme='light'] [style*='color: #94a3b8'] {
	color: #475569 !important;
}

/* ── Keep modals always dark (overlay style) ── */
[data-bs-theme='light'] .modal-content {
	background-color: #1e2235 !important;
	border-color: #2d3148 !important;
	color: #e2e8f0;
}

/* ── Modal animations ── */
.modal {
	transition: opacity 0.15s ease;
}

.modal.fade .modal-dialog {
	transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s ease;
	transform: scale(0.95);
	opacity: 0;
}

.modal.show .modal-dialog {
	transform: scale(1);
	opacity: 1;
}

.modal-backdrop {
	transition: opacity 0.15s ease;
	backdrop-filter: blur(4px);
}

.modal-backdrop.fade {
	opacity: 0;
}

.modal-backdrop.show {
	opacity: 0.5;
}
/* Restore original light colors inside dark modals */
[data-bs-theme='light'] .modal-content [style*='color:#e2e8f0'] {
	color: #e2e8f0 !important;
}
[data-bs-theme='light'] .modal-content [style*='color: #e2e8f0'] {
	color: #e2e8f0 !important;
}
[data-bs-theme='light'] .modal-content [style*='color:#94a3b8'] {
	color: #94a3b8 !important;
}
[data-bs-theme='light'] .modal-content [style*='color: #94a3b8'] {
	color: #94a3b8 !important;
}
[data-bs-theme='light'] .modal-content [style*='color:#cbd5e1'] {
	color: #cbd5e1 !important;
}
[data-bs-theme='light'] .modal-content [style*='color:#64748b'] {
	color: #64748b !important;
}
[data-bs-theme='light'] .modal-content .text-muted {
	color: #94a3b8 !important;
}
/* Form controls inside dark modals stay dark-styled */
[data-bs-theme='light'] .modal-content .form-control,
[data-bs-theme='light'] .modal-content .form-select {
	background: #252840 !important;
	border-color: #3d4268 !important;
	color: #e2e8f0 !important;
}
[data-bs-theme='light'] .modal-content .form-control:focus,
[data-bs-theme='light'] .modal-content .form-select:focus {
	background: #2d3154 !important;
	border-color: #818cf8 !important;
	box-shadow: 0 0 0 0.2rem rgba(129, 140, 248, 0.2) !important;
}
[data-bs-theme='light'] .modal-content .form-control::placeholder {
	color: #64748b !important;
}
[data-bs-theme='light'] .modal-content .form-check-input {
	background-color: #252840 !important;
	border-color: #3d4268 !important;
}
[data-bs-theme='light'] .modal-content .check-area {
	background: #252840 !important;
	border-color: #3d4268 !important;
}
[data-bs-theme='light'] .modal-content .form-label {
	color: #94a3b8;
}
[data-bs-theme='light'] .modal-content .form-check-label {
	color: #e2e8f0;
}
[data-bs-theme='light'] .modal-content .btn-outline-secondary {
	color: #94a3b8;
	border-color: #3d4268;
}
[data-bs-theme='light'] .modal-content .btn-outline-secondary:hover {
	background-color: #2d3154;
	color: #e2e8f0;
}
/* Table inside dark modals */
[data-bs-theme='light'] .modal-content .table {
	color: #cbd5e1;
	--bs-table-bg: transparent;
}
[data-bs-theme='light'] .modal-content .text-muted {
	color: #94a3b8 !important;
}

/* ── Light theme: settings page labels ── */
[data-bs-theme='light'] .card-header .fw-semibold {
	color: #1e293b;
}

/* ── Task viewer modal text fixes ── */
#unifiedTaskViewModal .modal-content {
	background: #1e2235 !important;
	border: 1px solid #2d3148 !important;
	color: #e2e8f0 !important;
}
#unifiedTaskViewModal .modal-title {
	color: #e2e8f0 !important;
}
#unifiedTaskViewModal .text-muted {
	color: #94a3b8 !important;
}
#unifiedTaskViewModal p,
#unifiedTaskViewModal td,
#unifiedTaskViewModal span,
#unifiedTaskViewModal div {
	color: inherit !important;
}
#unifiedTaskViewModal .table {
	color: #cbd5e1 !important;
	--bs-table-bg: transparent !important;
}
#unifiedTaskViewModal .badge {
	color: #fff !important;
}
#unifiedTaskViewModal .btn-outline-primary {
	color: #818cf8 !important;
	border-color: #818cf8 !important;
}
#unifiedTaskViewModal .btn-outline-primary:hover {
	color: #fff !important;
	background-color: #818cf8 !important;
}
#unifiedTaskViewModal .btn-outline-secondary {
	color: #94a3b8 !important;
	border-color: #3d4268 !important;
}
#unifiedTaskViewModal .btn-outline-secondary:hover {
	color: #e2e8f0 !important;
	background-color: #2d3154 !important;
}

/* ── Mobile navigation improvements ── */
.navbar-nav-scroll {
	overflow-x: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--bs-border-color) transparent;
	-webkit-overflow-scrolling: touch;
	flex: 1;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

/* Task button with contrast background */
.navbar-nav .btn-outline-primary[onclick*='openUnifiedTaskModal'] {
	background-color: rgba(139, 92, 246, 0.25) !important;
	border-color: rgba(139, 92, 246, 0.5) !important;
	backdrop-filter: blur(4px);
	color: #c4b5fd !important;
	transition: transform 200ms ease-out, opacity 200ms ease-out;
	font-weight: 500;
	animation: pulse 3s ease-in-out infinite;
}

.navbar-nav .btn-outline-primary[onclick*='openUnifiedTaskModal']:hover {
	background-color: rgba(139, 92, 246, 0.35) !important;
	border-color: rgba(139, 92, 246, 0.6) !important;
	color: #ddd6fe !important;
	animation: none;
}

.navbar-nav .btn-outline-primary[onclick*='openUnifiedTaskModal']:active {
	animation: none;
}

@keyframes pulse {
	0%, 100% {
		box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
	}
	50% {
		box-shadow: 0 0 0 8px rgba(139, 92, 246, 0);
	}
}

[data-bs-theme='light']
	.navbar-nav
	.btn-outline-primary[onclick*='openUnifiedTaskModal'] {
	background-color: rgba(124, 58, 237, 0.15) !important;
	border-color: rgba(124, 58, 237, 0.4) !important;
	color: #7c3aed !important;
	font-weight: 500;
	animation: pulse-light 3s ease-in-out infinite;
}

[data-bs-theme='light']
	.navbar-nav
	.btn-outline-primary[onclick*='openUnifiedTaskModal']:hover {
	background-color: rgba(124, 58, 237, 0.25) !important;
	border-color: rgba(124, 58, 237, 0.5) !important;
	color: #8b5cf6 !important;
	animation: none;
}

[data-bs-theme='light']
	.navbar-nav
	.btn-outline-primary[onclick*='openUnifiedTaskModal']:active {
	animation: none;
}

@keyframes pulse-light {
	0%, 100% {
		box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.4);
	}
	50% {
		box-shadow: 0 0 0 8px rgba(124, 58, 237, 0);
	}
}

.navbar-nav-scroll::-webkit-scrollbar {
	height: 4px;
}

.navbar-nav-scroll::-webkit-scrollbar-track {
	background: transparent;
}

.navbar-nav-scroll::-webkit-scrollbar-thumb {
	background-color: var(--bs-border-color);
	border-radius: 2px;
}

@media (max-width: 768px) {
	.navbar {
		padding-bottom: 0.25rem;
		min-height: auto;
	}

	.navbar .container-fluid {
		padding-left: 10px;
		padding-right: 10px;
	}

	.navbar-brand {
		display: none !important;
	}

	.navbar-nav .dropdown {
		display: none !important;
	}

	.navbar-nav-scroll {
		gap: 0.1rem;
		flex-direction: row;
		align-items: center;
		flex-wrap: nowrap;
		overflow-x: auto;
	}

	.navbar-nav-scroll > ul {
		width: auto;
	}

	.navbar-nav {
		gap: 0.1rem;
		flex-wrap: nowrap;
	}

	.navbar-nav .nav-link {
		font-size: 0.75rem;
		padding: 0.15rem 0.3rem !important;
		white-space: nowrap;
		min-width: 0;
	}

	.navbar-nav .nav-item {
		flex-shrink: 0;
	}

	#newTaskBtn {
		font-size: 0.75rem !important;
		font-weight: bold !important;
	}

	#themeToggle {
		width: 28px;
		height: 28px;
		padding: 0;
		font-size: 12px;
	}

	.navbar-nav .dropdown-toggle {
		font-size: 0.75rem;
		padding: 0.15rem 0.3rem !important;
	}
}

@media (max-width: 480px) {
	.navbar {
		padding-bottom: 0.2rem;
	}

	.navbar-brand {
		font-size: 1em !important;
		padding: 1px 3px !important;
		margin-right: 2px !important;
	}

	.navbar-nav-scroll {
		gap: 0.05rem;
	}

	.navbar-nav {
		gap: 0.05rem;
	}

	.navbar-nav .nav-link {
		font-size: 0.7rem;
		padding: 0.1rem 0.25rem !important;
	}

	#themeToggle {
		width: 26px;
		height: 26px;
		padding: 0;
		font-size: 11px;
	}

	.navbar-nav .dropdown-toggle {
		font-size: 0.7rem;
		padding: 0.1rem 0.25rem !important;
	}

	#newTaskBtn {
		font-size: 0.7rem !important;
		padding: 0.2rem 0.3rem !important;
	}

	.navbar-nav .nav-link[href*="changelog"] {
		font-size: 0.7rem !important;
		padding: 0.1rem 0.2rem !important;
	}
}

@media (max-width: 360px) {
	.navbar-brand {
		font-size: 0.9em !important;
	}

	.navbar-nav .nav-link {
		font-size: 0.65rem;
		padding: 0.1rem 0.2rem !important;
	}

	#themeToggle {
		width: 24px;
		height: 24px;
		padding: 0;
		font-size: 10px;
	}

	.navbar-nav .dropdown-toggle {
		font-size: 0.65rem;
		padding: 0.1rem 0.2rem !important;
	}
}

@media (max-width: 480px) {
	.container-fluid {
		padding-left: 5px !important;
		padding-right: 5px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

@media (hover: hover) and (pointer: fine) {
	.gcal-task:hover {
		filter: brightness(1.15);
		transform: scale(1.02);
		box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6) !important;
	}
	.gcal-allday-task:hover {
		box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5) !important;
		filter: brightness(1.1);
		transform: scale(1.02);
	}
	.btn:hover {
		transform: translateY(-1px);
	}
}

/* ══════════════════════════════════════════════ Tailwind utility replacements ══════════════════════════════════════════════ */

/* ── Flex & Grid ── */
.flex { display: flex; }
.d-flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-start { justify-content: flex-start; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.col-span-full { grid-column: 1 / -1; }
@media (min-width: 1024px) {
	.lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── Gap ── */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-8 { gap: 2rem; }

/* ── Padding ── */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-1\.5 { padding-left: 0.375rem; padding-right: 0.375rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 0.25rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-4 { padding-top: 1rem; }
.pb-1 { padding-bottom: 0.25rem; }
.pb-3 { padding-bottom: 0.75rem; }

/* ── Margin ── */
.m-0 { margin: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-5 { margin-left: 1.25rem; }
.ml-6 { margin-left: 1.5rem; }
.mr-2 { margin-right: 0.5rem; }
.ms-2 { margin-inline-start: 0.5rem; }
.ms-4 { margin-inline-start: 1rem; }
.ms-auto { margin-inline-start: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ── Text Size ── */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

/* ── Font Weight ── */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ── Background Colors ── */
.bg-white { background-color: #fff; }
.bg-transparent { background-color: transparent; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-blue-600 { background-color: #2563eb; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-500 { background-color: #6b7280; }
.bg-gray-600 { background-color: #4b5563; }
.bg-gray-700 { background-color: #374151; }
.bg-gray-800 { background-color: #1f2937; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-100 { background-color: #dcfce7; }
.bg-green-500 { background-color: #22c55e; }
.bg-green-600 { background-color: #16a34a; }
.bg-green-900\/30 { background-color: rgba(20, 83, 45, 0.3); }
.bg-red-100 { background-color: #fee2e2; }
.bg-red-500 { background-color: #ef4444; }
.bg-red-600 { background-color: #dc2626; }
.bg-red-900\/30 { background-color: rgba(127, 29, 29, 0.3); }
.bg-yellow-100 { background-color: #fef3c7; }
.bg-yellow-500 { background-color: #eab308; }
.bg-yellow-600 { background-color: #ca8a04; }
.bg-yellow-900\/30 { background-color: rgba(113, 63, 18, 0.3); }

/* ── Text Colors ── */
.text-white { color: #fff; }
.text-blue-300 { color: #93c5fd; }
.text-blue-400 { color: #60a5fa; }
.text-blue-600 { color: #2563eb; }
.text-blue-800 { color: #1e40af; }
.text-blue-900 { color: #1e3a8a; }
.text-gray-100 { color: #f3f4f6; }
.text-gray-200 { color: #e5e7eb; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-900 { color: #111827; }
.text-green-400 { color: #4ade80; }
.text-green-600 { color: #16a34a; }
.text-green-700 { color: #15803d; }
.text-red-400 { color: #f87171; }
.text-red-500 { color: #ef4444; }
.text-red-600 { color: #dc2626; }
.text-yellow-200 { color: #fef08a; }
.text-yellow-300 { color: #fde047; }
.text-yellow-600 { color: #ca8a04; }
.text-yellow-700 { color: #a16207; }
.text-yellow-800 { color: #854d0e; }

/* ── Border ── */
.border { border: 1px solid var(--bs-border-color); }
.border-0 { border: 0 !important; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-gray-600 { border-color: #4b5563; }
.border-gray-700 { border-color: #374151; }
.border-blue-200 { border-color: #bfdbfe; }
.border-blue-400\/30 { border-color: rgba(96, 165, 250, 0.3); }
.border-blue-800 { border-color: #1e40af; }
.border-green-700\/30 { border-color: rgba(21, 128, 61, 0.3); }
.border-red-400\/30 { border-color: rgba(248, 113, 113, 0.3); }
.border-b { border-bottom: 1px solid var(--bs-border-color); }
.border-t { border-top: 1px solid var(--bs-border-color); }
.border-l-2 { border-left: 2px solid var(--bs-border-color); }
.border-r { border-right: 1px solid var(--bs-border-color); }

/* ── Overflow ── */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-ellipsis { text-overflow: ellipsis; }

/* ── Text ── */
.text-ellipsis { text-overflow: ellipsis; overflow: hidden; }
.whitespace-nowrap { white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-start { text-align: start; }
.text-right { text-align: right; }

/* ── Sizing ── */
.w-full { width: 100%; }
.h-\[31px\] { height: 31px; }
.max-w-xs { max-width: 20rem; }

/* ── Display & Position ── */
.block { display: block; }
.hidden { display: none; }
.inline { display: inline; }
.inline-block { display: inline-block; }

/* ── Cursor ── */
.cursor-pointer { cursor: pointer; }

/* ── Transitions ── */
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

/* ── Border Radius ── */
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

/* ── Shadow ── */
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }

/* ── Space Between Children ── */
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }

/* ── Placeholder ── */
.placeholder-gray-400::placeholder { color: #9ca3af; }
.placeholder-gray-500::placeholder { color: #6b7280; }

/* ── Focus ── */
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5); }
.focus\:ring-blue-500:focus { box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5); }
.focus\:ring-green-500:focus { box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.5); }

/* ── Hover (light mode) ── */
.hover\:bg-blue-300:hover { background-color: #93c5fd; }
.hover\:bg-blue-400\/10:hover { background-color: rgba(96, 165, 250, 0.1); }
.hover\:bg-blue-500:hover { background-color: #3b82f6; }
.hover\:bg-blue-600:hover { background-color: #2563eb; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.hover\:bg-gray-50:hover { background-color: #f9fafb; }
.hover\:bg-gray-200:hover { background-color: #e5e7eb; }
.hover\:bg-gray-600:hover { background-color: #4b5563; }
.hover\:bg-gray-700:hover { background-color: #374151; }
.hover\:bg-green-100:hover { background-color: #dcfce7; }
.hover\:bg-green-700:hover { background-color: #15803d; }
.hover\:bg-red-400\/10:hover { background-color: rgba(248, 113, 113, 0.1); }
.hover\:bg-red-700:hover { background-color: #b91c1c; }
.hover\:bg-yellow-700:hover { background-color: #a16207; }
.hover\:text-blue-300:hover { color: #93c5fd; }
.hover\:text-blue-500:hover { color: #3b82f6; }
.hover\:opacity-80:hover { opacity: 0.8; }

/* ── File Input ── */
.file\:mr-4::file-selector-button { margin-right: 1rem; }
.file\:py-1::file-selector-button { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.file\:px-3::file-selector-button { padding-left: 0.75rem; padding-right: 0.75rem; }
.file\:rounded::file-selector-button { border-radius: 0.25rem; }
.file\:border-0::file-selector-button { border: 0; }
.file\:text-sm::file-selector-button { font-size: 0.875rem; }
.file\:font-medium::file-selector-button { font-weight: 500; }
.file\:bg-green-50::file-selector-button { background-color: #f0fdf4; }
.file\:text-green-700::file-selector-button { color: #15803d; }

/* ── Opacity ── */
.disabled\:opacity-50:disabled { opacity: 0.5; }
.opacity-50 { opacity: 0.5; }

/* ── Additional dark mode overrides ── */
.dark .bg-green-900\/30 { background-color: rgba(20, 83, 45, 0.3) !important; }
.dark .bg-red-900\/30 { background-color: rgba(127, 29, 29, 0.3) !important; }
.dark .bg-yellow-900\/30 { background-color: rgba(113, 63, 18, 0.3) !important; }
.dark .text-blue-400 { color: #60a5fa !important; }
.dark .text-blue-500 { color: #3b82f6 !important; }
.dark .text-red-500 { color: #ef4444 !important; }
.dark .text-yellow-200 { color: #fef08a !important; }
.dark .text-yellow-300 { color: #fde047 !important; }
.dark .text-yellow-400 { color: #facc15 !important; }
.dark .hover\:bg-blue-700:hover { background-color: #1d4ed8 !important; }
.dark .hover\:bg-green-700:hover { background-color: #15803d !important; }
.dark .hover\:bg-red-400\/10:hover { background-color: rgba(248, 113, 113, 0.1) !important; }
.dark .hover\:bg-red-700:hover { background-color: #b91c1c !important; }
.dark .hover\:bg-yellow-700:hover { background-color: #a16207 !important; }
.dark .hover\:text-blue-300:hover { color: #93c5fd !important; }
.dark .hover\:text-blue-500:hover { color: #3b82f6 !important; }
.dark .placeholder-gray-400::placeholder { color: #6b7280 !important; }
.dark .placeholder-gray-500::placeholder { color: #6b7280 !important; }

/* ── Align middle ── */
.align-middle { vertical-align: middle; }

/* --- Boris button on topics page (в main.css, т.к. boris.css грузится лениво) --- */
.boris-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  line-height: 1;
}
.boris-btn:hover {
  background: rgba(99, 102, 241, 0.35);
  border-color: #818cf8;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
  transform: scale(1.1);
}
