/* Simulated Security ASM - Design System */
:root {
	--background: oklch(1 0 0);
	--foreground: oklch(0.1448 0 0);
	--card: oklch(0.9702 0 0);
	--card-foreground: oklch(0.1448 0 0);
	--popover: oklch(1 0 0);
	--popover-foreground: oklch(0.1448 0 0);
	--primary: oklch(0.5461 0.2152 262.8809);
	--primary-foreground: oklch(0.9851 0 0);
	--secondary: oklch(0.9702 0 0);
	--secondary-foreground: oklch(0.1448 0 0);
	--muted: oklch(0.9702 0 0);
	--muted-foreground: oklch(0.5555 0 0);
	--accent: oklch(0.9702 0 0);
	--accent-foreground: oklch(0.1448 0 0);
	--destructive: oklch(0.6368 0.2078 25.3313);
	--destructive-foreground: oklch(0.9851 0 0);
	--border: oklch(0.9219 0 0);
	--input: oklch(0.9219 0 0);
	--ring: oklch(0.5461 0.2152 262.8809);
	--chart-1: oklch(0.5461 0.2152 262.8809);
	--chart-2: oklch(0.6368 0.2078 25.3313);
	--chart-3: oklch(0.3715 0 0);
	--chart-4: oklch(0.5555 0 0);
	--chart-5: oklch(0.7155 0 0);
	--sidebar: oklch(0.9702 0 0);
	--sidebar-foreground: oklch(0.5555 0 0);
	--sidebar-primary: oklch(0.5461 0.2152 262.8809);
	--sidebar-primary-foreground: oklch(0.9851 0 0);
	--sidebar-accent: oklch(1 0 0);
	--sidebar-accent-foreground: oklch(0.1448 0 0);
	--sidebar-border: oklch(0.9219 0 0);
	--sidebar-ring: oklch(0.5461 0.2152 262.8809);
	--font-sans: Inter, sans-serif;
	--font-serif: serif;
	--font-mono: Roboto Mono, monospace;
	--radius: 0.5rem;
	--shadow-2xs: 0px 2px 4px 0px hsl(0 0% 0% / 0.05);
	--shadow-xs: 0px 2px 4px 0px hsl(0 0% 0% / 0.05);
	--shadow-sm:
		0px 2px 4px 0px hsl(0 0% 0% / 0.1), 0px 1px 2px -1px hsl(0 0% 0% / 0.1);
	--shadow:
		0px 2px 4px 0px hsl(0 0% 0% / 0.1), 0px 1px 2px -1px hsl(0 0% 0% / 0.1);
	--shadow-md:
		0px 2px 4px 0px hsl(0 0% 0% / 0.1), 0px 2px 4px -1px hsl(0 0% 0% / 0.1);
	--shadow-lg:
		0px 2px 4px 0px hsl(0 0% 0% / 0.1), 0px 4px 6px -1px hsl(0 0% 0% / 0.1);
	--shadow-xl:
		0px 2px 4px 0px hsl(0 0% 0% / 0.1), 0px 8px 10px -1px hsl(0 0% 0% / 0.1);
	--shadow-2xl: 0px 2px 4px 0px hsl(0 0% 0% / 0.25);
	--tracking-normal: 0rem;
	--spacing: 0.25rem;

	/* Backward-compat aliases */
	--color-primary: var(--destructive);
	--color-primary-light: oklch(0.7368 0.2078 25.3313);
	--color-primary-dark: oklch(0.5368 0.2078 25.3313);
	--color-text: var(--foreground);
	--color-text-secondary: var(--muted-foreground);
	--color-text-muted: var(--muted-foreground);
	--color-surface: var(--card);
	--color-border: var(--border);
	--color-danger: var(--destructive);
	--color-success: oklch(0.6 0.15 145);
	--color-warning: oklch(0.7 0.15 85);
	--color-info: var(--primary);
	--color-bg: var(--background);
	--color-surface-hover: var(--accent);
	--color-border-hover: oklch(0.85 0 0);
	--color-bg-tertiary: var(--muted);
	--color-informational: oklch(0.6 0.1 250);
	--color-critical: oklch(0.5 0.25 25);
	--color-high: oklch(0.6 0.2 40);
	--color-medium: oklch(0.7 0.15 85);
	--color-low: oklch(0.65 0.12 200);

	/* Asset-type graph colours (hex to match graph-explorer typeColors map).
	   Consumed by the Cytoscape graph pages so type colouring is consistent
	   app-wide. Vivid, saturated hues that read on both light and dark canvases. */
	--color-asset-domain: #4a90d9;
	--color-asset-subdomain: #4a90d9;
	--color-asset-ip: #50c878;
	--color-asset-url: #5bc0de;
	--color-asset-service: #f0ad4e;
	--color-asset-email: #9b59b6;
	--color-asset-asn: #1abc9c;
	--color-asset-phone: #e67e22;
	--color-asset-cidr: #27ae60;
	--color-asset-info: #95a5a6;
}

.dark {
	--background: oklch(0.1448 0 0);
	--foreground: oklch(0.9851 0 0);
	--card: oklch(0.2046 0 0);
	--card-foreground: oklch(0.9851 0 0);
	--popover: oklch(0.1448 0 0);
	--popover-foreground: oklch(0.9851 0 0);
	--primary: oklch(0.6231 0.188 259.8145);
	--primary-foreground: oklch(0.9851 0 0);
	--secondary: oklch(0.2686 0 0);
	--secondary-foreground: oklch(0.9851 0 0);
	--muted: oklch(0.2046 0 0);
	--muted-foreground: oklch(0.7155 0 0);
	--accent: oklch(0.2686 0 0);
	--accent-foreground: oklch(0.9851 0 0);
	--destructive: oklch(0.6447 0.241 27.376);
	--destructive-foreground: oklch(0.9851 0 0);
	--border: oklch(0.2686 0 0);
	--input: oklch(0.2686 0 0);
	--ring: oklch(0.6231 0.188 259.8145);
	--chart-1: oklch(0.6231 0.188 259.8145);
	--chart-2: oklch(0.6447 0.241 27.376);
	--chart-3: oklch(0.9249 0 0);
	--chart-4: oklch(0.6401 0 0);
	--chart-5: oklch(0.464 0 0);
	--sidebar: oklch(0.1448 0 0);
	--sidebar-foreground: oklch(0.7155 0 0);
	--sidebar-primary: oklch(0.6231 0.188 259.8145);
	--sidebar-primary-foreground: oklch(0.9851 0 0);
	--sidebar-accent: oklch(0.2686 0 0);
	--sidebar-accent-foreground: oklch(0.9851 0 0);
	--sidebar-border: oklch(0.2686 0 0);
	--sidebar-ring: oklch(0.6231 0.188 259.8145);

	/* Backward-compat aliases */
	--color-primary: var(--destructive);
	--color-primary-light: oklch(0.7447 0.241 27.376);
	--color-primary-dark: oklch(0.5447 0.241 27.376);
	--color-text: var(--foreground);
	--color-text-secondary: var(--muted-foreground);
	--color-text-muted: var(--muted-foreground);
	--color-surface: var(--card);
	--color-border: var(--border);
	--color-danger: var(--destructive);
	--color-success: oklch(0.65 0.15 145);
	--color-warning: oklch(0.75 0.15 85);
	--color-info: var(--primary);
	--color-bg: var(--background);
	--color-surface-hover: var(--accent);
	--color-border-hover: oklch(0.35 0 0);
	--color-bg-tertiary: var(--muted);
	--color-informational: oklch(0.6 0.1 250);
	--color-critical: oklch(0.5 0.25 25);
	--color-high: oklch(0.6 0.2 40);
	--color-medium: oklch(0.7 0.15 85);
	--color-low: oklch(0.65 0.12 200);
}

/* ===================================================================
   Shared graph (Cytoscape) styles — used by every graph explorer page
   so the loading treatment is identical across the app.
   =================================================================== */
.graph-loading-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background-color: var(--card);
	z-index: 20;
	gap: 0.75rem;
	transition: opacity 0.3s ease;
}
.graph-loading-overlay.hidden {
	opacity: 0;
	pointer-events: none;
}
.graph-loading-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid var(--border);
	border-top-color: var(--destructive);
	border-radius: 50%;
	animation: graph-spin 0.8s linear infinite;
}
@keyframes graph-spin {
	to { transform: rotate(360deg); }
}
.graph-loading-text {
	font-size: 0.8125rem;
	color: var(--muted-foreground);
	font-weight: 500;
}
.graph-loading-stats {
	font-size: 0.6875rem;
	color: var(--muted-foreground);
	font-family: var(--font-mono);
	opacity: 0.7;
}

/* Base Styles */
body {
	font-family: var(--font-sans);
	background: var(--background);
	color: var(--foreground);
	letter-spacing: var(--tracking-normal);
	line-height: 1.6;
	transition:
		background-color 0.2s ease,
		color 0.2s ease;
}

/* Theme utilities */
/* Sweet alert */
.dark .swal2-popup {
	background: var(--card) !important;
	color: var(--foreground) !important;
	border: 1px solid var(--border) !important;
}
.dark .swal2-title,
.dark .swal2-html-container {
	color: var(--foreground) !important;
}
.dark .swal2-actions .swal2-confirm,
.dark .swal2-actions .swal2-cancel {
	box-shadow: none !important;
}

/* Swap light/dark logos depending on theme */

/* Generic logo swap (public navbar, footer, auth pages) */
.logo-dark {
	display: none;
}
.dark .logo-light {
	display: none;
}
.dark .logo-dark {
	display: block;
}

/* Sidebar-specific logo swap (overrides above with higher specificity) */
.sidebar-logo-img.logo-dark {
	display: none;
}
.dark .sidebar-logo-img.logo-light {
	display: none;
}
.dark .sidebar-logo-img.logo-dark {
	display: block;
}

/* Toggle icon swap */
.icon-moon {
	display: none;
}
.dark .icon-sun {
	display: none;
}
.dark .icon-moon {
	display: inline;
}

.theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 9999px;
	border: 1px solid var(--border);
	background: var(--card);
	color: var(--foreground);
	transition: all 0.2s ease;
}
.theme-toggle:hover {
	box-shadow: var(--shadow-sm);
	transform: translateY(-1px);
}

/* Tailwind utility tweaks for dark mode harmony */
.dark .bg-red-100 {
	background-color: oklch(0.32 0.12 25.33) !important;
}
.dark .text-red-600 {
	color: oklch(0.66 0.2 27.3) !important;
}
.dark .hover\:bg-gray-50:hover {
	background-color: rgba(255, 255, 255, 0.06) !important;
}
.dark .hover\:bg-gray-100:hover {
	background-color: rgba(255, 255, 255, 0.08) !important;
}
.dark .border-gray-100 {
	border-color: rgba(255, 255, 255, 0.08) !important;
}
.dark .border-gray-200 {
	border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Role chips colors in dark */
.dark .bg-blue-100 {
	background-color: rgba(59, 130, 246, 0.15) !important;
}
.dark .text-blue-800 {
	color: oklch(0.72 0.12 260) !important;
}
.dark .bg-purple-100 {
	background-color: rgba(168, 85, 247, 0.15) !important;
}
.dark .text-purple-800 {
	color: oklch(0.73 0.15 300) !important;
}
.dark .bg-gray-100 {
	background-color: rgba(255, 255, 255, 0.08) !important;
}
.dark .text-gray-800 {
	color: var(--foreground) !important;
}

.dark .bg-white {
	background: oklch(0.2686 0 0) !important;
}

/* Modern UI Components */
.nav-link {
	position: relative;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	padding: 0.5rem 1rem;
	border-radius: calc(var(--radius) - 2px);
}

.nav-link::after {
	content: "";
	position: absolute;
	bottom: -2px;
	left: 50%;
	width: 0;
	height: 2px;
	background: var(--destructive);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
	width: 80%;
}

.nav-link.active {
	color: var(--destructive);
	font-weight: 600;
}

/* Card Animations */
.card-animated {
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	border: 1px solid var(--border);
	background: var(--card);
	border-radius: var(--radius);
}

.card-animated:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-lg);
	border-color: var(--destructive);
}

/* Buttons */
.btn {
	padding: 0.4375rem 0.875rem;
	border-radius: var(--radius);
	font-weight: 600;
	font-size: 0.8125rem;
	line-height: 1.25;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	border: none;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.btn-primary {
	background: var(--destructive);
	color: var(--destructive-foreground);
	position: relative;
	overflow: hidden;
}

.btn-signin {
	background: linear-gradient(
		135deg,
		var(--destructive),
		oklch(0.7368 0.2078 25.3313)
	);
	color: white;
	box-shadow: 0 4px 14px 0 rgba(220, 38, 38, 0.25);
	font-size: 0.875rem;
	padding: 0.625rem 1.25rem;
	font-weight: 600;
	border-radius: calc(var(--radius) + 2px);
}

.btn-signin:hover {
	background: linear-gradient(
		135deg,
		oklch(0.7368 0.2078 25.3313),
		var(--destructive)
	);
	box-shadow: 0 6px 20px 0 rgba(220, 38, 38, 0.4);
	transform: translateY(-2px);
}

.btn-signin::before {
	content: "";
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(255, 255, 255, 0.2),
		transparent
	);
	transition: left 0.5s;
}

.btn-signin:hover::before {
	left: 100%;
}

.btn-primary::before {
	content: "";
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(255, 255, 255, 0.2),
		transparent
	);
	transition: left 0.5s;
}

.btn-primary:hover::before {
	left: 100%;
}

.btn-primary:hover {
	background: oklch(0.7368 0.2078 25.3313);
	box-shadow: var(--shadow-lg);
	transform: translateY(-1px);
}

/* Form Elements */
.form-input {
	background: var(--background);
	border: 1px solid var(--border);
	color: var(--foreground);
	padding: 0.4375rem 0.75rem;
	font-size: 0.8125rem;
	border-radius: calc(var(--radius) - 2px);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	width: 100%;
}

.form-input:focus {
	outline: none;
	border-color: var(--destructive);
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Icon inputs: the Tailwind `pl-10` utility lives in a @layer and is overridden
   by the (unlayered) `.form-input` padding shorthand above — which is why the
   leading search/icon overlapped the placeholder. Restore the left padding here
   (unlayered rule, higher specificity) so it wins. */
.form-input.pl-10 { padding-left: 2.5rem; }

/* Toggle switch — self-contained (no Tailwind utility dependency), so it renders
   consistently regardless of the utility build. Markup:
   <label class="switch"><input type="checkbox"><span class="switch-track"></span>
   <span class="switch-thumb"></span></label> (an optional type=hidden may precede
   the checkbox). */
.switch {
	position: relative;
	display: inline-flex;
	align-items: center;
	width: 2.75rem;
	height: 1.5rem;
	flex-shrink: 0;
}
.switch input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}
.switch .switch-track {
	position: absolute;
	inset: 0;
	border-radius: 9999px;
	background-color: var(--border);
	transition: background-color 0.2s ease;
}
/* Matches the AI-summarization toggle: brand red when on. */
.switch input:checked ~ .switch-track {
	background-color: var(--destructive);
}
.switch .switch-thumb {
	position: absolute;
	left: 0;
	top: 0.25rem;
	width: 1rem;
	height: 1rem;
	border-radius: 9999px;
	background-color: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
	transform: translateX(0.25rem);
	transition: transform 0.2s ease;
	pointer-events: none;
}
.switch input:checked ~ .switch-thumb {
	transform: translateX(1.25rem);
}

.table-column-filter {
	width: 100%;
	min-width: 96px;
	height: 2rem;
	padding: 0 0.625rem;
	border-radius: calc(var(--radius) - 2px);
	border: 1px solid var(--border);
	background: var(--background);
	color: var(--foreground);
	font-size: 0.75rem;
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease,
		background-color 0.2s ease,
		color 0.2s ease;
}

.table-column-filter::placeholder {
	color: var(--muted-foreground);
	opacity: 1;
}

.table-column-filter:focus {
	outline: none;
	border-color: var(--ring);
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* Animations */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes slideInLeft {
	from {
		opacity: 0;
		transform: translateX(-30px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

@keyframes scaleIn {
	from {
		opacity: 0;
		transform: scale(0.9);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* Animation classes - only trigger once */
.animate-fade-in-up {
	animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-slide-in-left {
	animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-scale-in {
	animation: scaleIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Scroll animation classes - for elements that animate on scroll */
.scroll-animate {
	opacity: 0;
	transform: translateY(30px);
	transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animate.animate {
	opacity: 1;
	transform: translateY(0);
}

.animate-slide-in-left {
	animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-scale-in {
	animation: scaleIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Highlight Red Utility */
.highlight-red {
	color: var(--destructive);
	font-weight: 600;
}

/* Logo Animation */
.logo-hover {
	position: relative;
	overflow: hidden;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-hover::before {
	content: "";
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(255, 255, 255, 0.6),
		transparent
	);
	transition: left 0.6s ease-in-out;
	z-index: 1;
}

.logo-hover:hover::before {
	left: 100%;
}

/* Mobile Menu Animation */
.mobile-menu {
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	transform: translateY(-10px);
	opacity: 0;
}

.mobile-menu.active {
	transform: translateY(0);
	opacity: 1;
}

/* Minimal Scrollbar */
::-webkit-scrollbar {
	width: 6px;
}

::-webkit-scrollbar-track {
	background: var(--muted);
}

::-webkit-scrollbar-thumb {
	background: var(--muted-foreground);
	border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
	background: var(--destructive);
}

/* ═══════════════════════════════════════════════
   SIDEBAR COMPONENT
   ═══════════════════════════════════════════════ */

.sidebar {
	position: fixed;
	left: 0;
	top: 0;
	height: 100vh;
	width: 15.5rem; /* 248px — slightly narrower than 256 for density */
	z-index: 50;
	display: flex;
	flex-direction: column;
	background: var(--sidebar);
	border-right: 1px solid var(--sidebar-border);
	transition: background-color 0.2s ease;
}

/* Logo area */
.sidebar-logo {
	flex-shrink: 0;
	padding: 1.25rem 1.25rem 1rem;
	border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-logo-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	opacity: 0.92;
	transition: opacity 0.15s ease;
}
.sidebar-logo-link:hover {
	opacity: 1;
}
.sidebar-logo-img {
	height: 2.75rem; /* 44px */
	width: auto;
	max-width: 100%;
	display: block;
}

/* Scrollable nav region — KEY FIX for overlay bug */
.sidebar-nav-scroll {
	flex: 1 1 0%;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 0.5rem 0.625rem;
	/* thinner scrollbar inside sidebar */
	scrollbar-width: thin;
	scrollbar-color: var(--sidebar-border) transparent;
}
.sidebar-nav-scroll::-webkit-scrollbar {
	width: 3px;
}
.sidebar-nav-scroll::-webkit-scrollbar-track {
	background: transparent;
}
.sidebar-nav-scroll::-webkit-scrollbar-thumb {
	background: var(--sidebar-border);
	border-radius: 3px;
}

/* Nav container */
.sidebar-nav {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

/* Section labels */
.sidebar-section-label {
	padding: 1rem 0.625rem 0.375rem;
	font-size: 0.625rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--sidebar-foreground);
	opacity: 0.55;
	user-select: none;
}

/* Nav item (main links) */
.sidebar-nav-item {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	padding: 0.4375rem 0.625rem;
	border-radius: 0.375rem;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--sidebar-foreground);
	text-decoration: none;
	transition:
		background-color 0.15s ease,
		color 0.15s ease;
	line-height: 1.25;
}
.sidebar-nav-item:hover {
	background: var(--sidebar-accent);
	color: var(--sidebar-accent-foreground);
}
.sidebar-nav-item--active {
	background: var(--sidebar-accent);
	color: var(--sidebar-primary);
	font-weight: 600;
}
.sidebar-nav-item--active:hover {
	background: var(--sidebar-accent);
	color: var(--sidebar-primary);
}

/* Nav icons */
.sidebar-icon {
	width: 1rem;
	height: 1rem;
	flex-shrink: 0;
	opacity: 0.7;
}
.sidebar-nav-item--active .sidebar-icon {
	opacity: 1;
}

/* Active project block */
.sidebar-active-project {
	margin: 0.25rem 0 0.125rem;
	padding: 0.5rem 0.5rem 0.5rem 0.75rem;
	border-left: 2px solid var(--sidebar-primary);
	margin-left: 0.375rem;
	border-radius: 0 0.375rem 0.375rem 0;
	background: var(--sidebar-accent);
	transition: background-color 0.15s ease;
}

.sidebar-active-project-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.375rem;
}

.sidebar-active-project-name {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--sidebar-primary);
	text-decoration: none;
	line-height: 1.2;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.sidebar-active-project-name:hover {
	text-decoration: underline;
}

.sidebar-active-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--sidebar-primary);
	flex-shrink: 0;
	animation: sb-pulse 3s ease-in-out infinite;
}
@keyframes sb-pulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.4;
	}
}

.sidebar-active-project-actions {
	display: flex;
	align-items: center;
	gap: 0.125rem;
	opacity: 0;
	transition: opacity 0.15s ease;
}
.sidebar-active-project:hover .sidebar-active-project-actions {
	opacity: 1;
}

.sidebar-action-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.25rem;
	height: 1.25rem;
	border-radius: 0.25rem;
	color: var(--sidebar-foreground);
	background: transparent;
	border: none;
	cursor: pointer;
	transition: background-color 0.15s ease;
}
.sidebar-action-btn:hover {
	background: var(--sidebar-border);
}

/* Sub-navigation (project quick links) */
.sidebar-sub-nav {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.sidebar-sub-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.3125rem 0.5rem;
	border-radius: 0.25rem;
	font-size: 0.75rem;
	font-weight: 450;
	color: var(--sidebar-foreground);
	text-decoration: none;
	transition:
		background-color 0.15s ease,
		color 0.15s ease;
	line-height: 1.25;
}
.sidebar-sub-item:hover {
	background: var(--sidebar-border);
	color: var(--sidebar-accent-foreground);
}
.sidebar-sub-item--active {
	color: var(--sidebar-primary);
	font-weight: 600;
}

.sidebar-sub-icon {
	width: 0.875rem;
	height: 0.875rem;
	flex-shrink: 0;
	opacity: 0.6;
}
.sidebar-sub-item--active .sidebar-sub-icon {
	opacity: 1;
}

/* Footer / User section — KEY: flex-shrink-0 keeps it pinned */
.sidebar-footer {
	flex-shrink: 0;
	padding: 0.5rem 0.625rem 0.75rem;
	border-top: 1px solid var(--sidebar-border);
}

.sidebar-user-btn {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	width: 100%;
	padding: 0.4375rem 0.5rem;
	border-radius: 0.375rem;
	background: transparent;
	border: none;
	cursor: pointer;
	transition: background-color 0.15s ease;
	color: var(--sidebar-foreground);
}
.sidebar-user-btn:hover {
	background: var(--sidebar-accent);
}

.sidebar-avatar {
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 0.375rem;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	background: var(--sidebar-accent);
	border: 1px solid var(--sidebar-border);
}

/* Dropdown shared styles */
.sidebar-dropdown {
	position: absolute;
	left: 0;
	right: 0;
	border-radius: 0.5rem;
	border: 1px solid var(--sidebar-border);
	background: var(--sidebar);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
	z-index: 60;
	padding: 0.25rem;
}
.sidebar-dropdown--up {
	bottom: 100%;
	margin-bottom: 0.375rem;
}

.sidebar-dropdown-item {
	display: flex;
	align-items: center;
	padding: 0.4375rem 0.625rem;
	font-size: 0.8125rem;
	border-radius: 0.25rem;
	color: var(--sidebar-foreground);
	text-decoration: none;
	transition: background-color 0.15s ease;
}
.sidebar-dropdown-item:hover {
	background: var(--sidebar-accent);
}
.sidebar-dropdown-item--danger {
	color: var(--destructive);
}
.sidebar-dropdown-item--danger:hover {
	background: oklch(0.6368 0.2078 25.3313 / 0.08);
}
.dark .sidebar-dropdown-item--danger:hover {
	background: oklch(0.6447 0.241 27.376 / 0.12);
}

.sidebar-dropdown-divider {
	height: 1px;
	margin: 0.25rem 0;
	background: var(--sidebar-border);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE / MOBILE
   ═══════════════════════════════════════════════ */

/* Main content wrapper — offset by sidebar on large screens */
.app-main {
	margin-left: 15.5rem;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar overlay (mobile backdrop) */
.sidebar-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 45;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	opacity: 0;
	transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
	display: block;
	opacity: 1;
}

/* Mobile hamburger toggle button */
.sidebar-mobile-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 0.375rem;
	border: 1px solid var(--border);
	background: var(--card);
	color: var(--foreground);
	cursor: pointer;
	transition: all 0.2s ease;
	flex-shrink: 0;
}
.sidebar-mobile-toggle:hover {
	background: var(--accent);
	box-shadow: var(--shadow-sm);
}

/* Mobile close button inside sidebar */
.sidebar-close-btn {
	display: none;
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	z-index: 60;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 0.375rem;
	border: none;
	background: transparent;
	color: var(--sidebar-foreground);
	cursor: pointer;
	transition: background-color 0.15s ease;
}
.sidebar-close-btn:hover {
	background: var(--sidebar-accent);
}

/* Header bar — wraps on mobile */
.app-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}
.app-header-actions {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-shrink: 0;
}
.app-header-welcome {
	white-space: nowrap;
}

/* ── Breakpoint: tablets and below (< 1024px / lg) ── */
@media (max-width: 1023px) {
	/* Sidebar: off-canvas by default */
	.sidebar {
		transform: translateX(-100%);
		transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
		z-index: 50;
	}
	.sidebar.sidebar--open {
		transform: translateX(0);
	}

	/* Main content takes full width */
	.app-main {
		margin-left: 0;
	}

	/* Show hamburger button */
	.sidebar-mobile-toggle {
		display: inline-flex;
	}

	/* Show close button in sidebar */
	.sidebar-close-btn {
		display: inline-flex;
	}

	/* Header wraps vertically on narrow screens */
	.app-header-inner {
		flex-wrap: wrap;
	}

	/* Hide long welcome text on tablets */
	.app-header-welcome {
		display: none;
	}
}

/* ── Breakpoint: phones (< 640px / sm) ── */
@media (max-width: 639px) {
	/* Sidebar full-width on phones */
	.sidebar {
		width: 100%;
		max-width: 18rem;
	}

	/* Tenant selector dropdown: anchor to right edge of screen */
	.tenant-dropdown {
		position: fixed !important;
		right: 0.5rem !important;
		left: 0.5rem !important;
		width: auto !important;
		max-width: none !important;
	}

	/* Tighter padding on content */
	.app-main main {
		padding: 1rem !important;
	}

	/* Header: smaller title, tighter spacing */
	.app-header-inner {
		padding: 0.75rem 1rem;
	}
	.app-header-inner h1 {
		font-size: 1.25rem;
	}

	/* Stack page actions on small screens */
	.app-header-actions {
		gap: 0.5rem;
	}

	/* Breadcrumbs: horizontal scroll */
	nav[aria-label="Breadcrumb"] ol {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		white-space: nowrap;
		padding-bottom: 0.25rem;
	}
}

/* ═══════════════════════════════════════════════
   CARD COMPONENT
   ═══════════════════════════════════════════════ */

.card {
	background: var(--card);
	color: var(--card-foreground);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.25rem;
	transition:
		background-color 0.2s ease,
		border-color 0.2s ease;
}

/* ═══════════════════════════════════════════════
   STAT CARD COMPONENT
   ═══════════════════════════════════════════════ */

.stat-card {
	background: var(--card);
	color: var(--card-foreground);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1rem 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	transition:
		background-color 0.2s ease,
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

.stat-card:hover {
	box-shadow: var(--shadow-sm);
}

.stat-label {
	font-size: 0.75rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--muted-foreground);
	line-height: 1.2;
}

.stat-value {
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--foreground);
}

/* ═══════════════════════════════════════════════
   DATA TABLE COMPONENT
   ═══════════════════════════════════════════════ */

.data-table-wrapper {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.data-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
}

.data-table thead {
	background: var(--muted);
}

.data-table th {
	padding: 0.625rem 0.75rem;
	text-align: left;
	font-size: 0.6875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--muted-foreground);
	border-bottom: 1px solid var(--border);
	white-space: nowrap;
}

.data-table td {
	padding: 0.625rem 0.75rem;
	border-bottom: 1px solid var(--border);
	color: var(--foreground);
	vertical-align: middle;
}

.data-table tbody tr {
	transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
	background: var(--accent);
}

.data-table tbody tr:last-child td {
	border-bottom: none;
}

/* ═══════════════════════════════════════════════
   BUTTON VARIANTS
   ═══════════════════════════════════════════════ */

.btn-outline {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.375rem;
	padding: 0.4375rem 0.875rem;
	border-radius: var(--radius);
	font-weight: 600;
	font-size: 0.8125rem;
	line-height: 1.25;
	cursor: pointer;
	text-decoration: none;
	background: transparent;
	color: var(--foreground);
	border: 1px solid var(--border);
	transition: all 0.2s ease;
}

.btn-outline:hover {
	background: var(--accent);
	border-color: var(--foreground);
}

.btn-danger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.375rem;
	padding: 0.4375rem 0.875rem;
	border-radius: var(--radius);
	font-weight: 600;
	font-size: 0.8125rem;
	line-height: 1.25;
	cursor: pointer;
	text-decoration: none;
	background: var(--destructive);
	color: var(--destructive-foreground);
	border: 1px solid var(--destructive);
	transition: all 0.2s ease;
}

.btn-danger:hover {
	opacity: 0.9;
	box-shadow: var(--shadow-md);
	transform: translateY(-1px);
}

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

/* ═══════════════════════════════════════════════
   BADGE COMPONENTS
   ═══════════════════════════════════════════════ */

[class*="badge-"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.125rem 0.5rem;
	font-size: 0.6875rem;
	font-weight: 600;
	line-height: 1.4;
	border-radius: 9999px;
	white-space: nowrap;
}

.badge-success {
	background: rgba(45, 212, 191, 0.15);
	color: #2DD4BF;
}
.dark .badge-success {
	background: rgba(45, 212, 191, 0.2);
	color: #5EEAD4;
}

.badge-warning {
	background: rgba(217, 119, 6, 0.15);
	color: #d97706;
}
.dark .badge-warning {
	background: rgba(217, 119, 6, 0.2);
	color: #FBBF24;
}

.badge-danger {
	background: rgba(224, 11, 11, 0.12);
	color: #e00b0b;
}
.dark .badge-danger {
	background: rgba(224, 11, 11, 0.18);
	color: #FCA5A5;
}

.badge-critical {
	background: rgba(224, 11, 11, 0.12);
	color: #e00b0b;
}
.dark .badge-critical {
	background: rgba(224, 11, 11, 0.18);
	color: #FCA5A5;
}

.badge-high {
	background: rgba(217, 119, 6, 0.15);
	color: #d97706;
}
.dark .badge-high {
	background: rgba(217, 119, 6, 0.2);
	color: #FBBF24;
}

.badge-medium {
	background: rgba(202, 138, 4, 0.15);
	color: #ca8a04;
}
.dark .badge-medium {
	background: rgba(202, 138, 4, 0.2);
	color: #FDE047;
}

.badge-low {
	background: rgba(45, 212, 191, 0.15);
	color: #2DD4BF;
}
.dark .badge-low {
	background: rgba(45, 212, 191, 0.2);
	color: #5EEAD4;
}

.badge-info {
	background: rgba(129, 146, 166, 0.15);
	color: #8192A6;
}
.dark .badge-info {
	background: rgba(129, 146, 166, 0.2);
	color: #A3B4C8;
}

/* ═══════════════════════════════════════════════
   FORM SELECT COMPONENT
   ═══════════════════════════════════════════════ */

.form-select {
	appearance: none;
	-webkit-appearance: none;
	background: var(--background);
	border: 1px solid var(--border);
	color: var(--foreground);
	padding: 0.4375rem 2rem 0.4375rem 0.75rem;
	border-radius: calc(var(--radius) - 2px);
	font-size: 0.8125rem;
	line-height: 1.5;
	width: 100%;
	cursor: pointer;
	transition: all 0.2s ease;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.625rem center;
	background-size: 0.75rem;
}

.form-select:focus {
	outline: none;
	border-color: var(--destructive);
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-select:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.dark .form-select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
