/* --- 1. SOPHISTICATED FOUNDATION & VARIABLES --- */
:root {
	/* Brand Colors */
	--brand-dark: #111122;
	--brand-red: #cc0000;
	--brand-red-subtle: rgba(204, 0, 0, 0.1);

	/* Glass & Depth */
	--glass-bg: rgba(255, 255, 255, 0.70);
	--glass-border: 1px solid rgba(255, 255, 255, 0.8);
	--glass-shadow: 0 10px 30px -5px rgba(17, 17, 34, 0.15);
	--glass-blur: 30px;

	/* Transitions - The heartbeat of the interface */
	--ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy */
	--ease-smooth: cubic-bezier(0.4, 0, 0.2, 1); /* Standard elegant */
	--ease-tap: cubic-bezier(0.1, 0.7, 1.0, 0.1); /* Quick press feel */
}

body {
	font-family: "Helvetica Neue", "Arial Narrow", Helvetica, Arial, sans-serif;
	color: var(--brand-dark);
	background-color: #e0e5ec;
	/* The vibrant mesh background restored */
	background-image: 
		radial-gradient(at 20% 20%, hsla(353, 85%, 61%, 0.36) 0px, transparent 50%),
		radial-gradient(at 80% 10%, hsla(227, 79%, 54%, 0.32) 0px, transparent 50%),
		radial-gradient(at 40% 80%, hsla(337, 78%, 57%, 0.43) 0px, transparent 50%),
		radial-gradient(at 90% 90%, hsla(258, 65%, 54%, 0.34) 0px, transparent 50%);
	background-attachment: fixed;
	background-size: cover;
	min-height: 100vh;
	overflow-x: hidden;
}

/* --- 2. THE "LIQUID GLASS" COMPONENT --- */
.glass-panel {
	background: var(--glass-bg);
	backdrop-filter: blur(var(--glass-blur));
	-webkit-backdrop-filter: blur(var(--glass-blur));
	border: var(--glass-border);
	border-radius: 24px;
	box-shadow: var(--glass-shadow);
	transition: all 0.4s var(--ease-smooth);
}

/* --- 3. ORGANIC MICRO-INTERACTIONS ("WOW" Effects) --- */

/* The "Piano Press" effect for buttons and interactive elements */
.interactive-tap {
	transition: transform 0.1s var(--ease-tap), background 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth);
}

.interactive-tap:active {
	transform: scale(0.96) translateY(2px) !important; /* Physical depression */
}

/* Tile Hover: Lift and Inner Glow */
.glass-hoverable {
	position: relative;
	overflow: hidden;
}

.glass-hoverable:hover {
	transform: translateY(-8px) scale(1.01);
	box-shadow: 0 25px 60px -10px rgba(17, 17, 34, 0.2), 
				inset 0 0 20px rgba(255,255,255,0.5); /* Add inner light on hover */
	border-color: #ffffff;
}

/* Navigation organic hover */
.nav-item {
	border-radius: 16px;
	transition: all 0.35s var(--ease-elastic);
	position: relative;
	overflow: hidden;
}

.nav-item:hover {
	background: rgba(255,255,255,0.7);
	transform: translateX(6px); /* Subtle slide right */
	box-shadow: inset 4px 0 15px var(--brand-red-subtle); /* Inner subtle red glow from left */
}

.nav-item.active {
	background: #fff;
	box-shadow: 0 4px 20px rgba(204, 0, 0, 0.1);
}

/* Table Row Breathing*/ 
.dashboardTable tr {
	transition: all 0.3s var(--ease-smooth);
	border-radius: 12px;
}

/* We need to set border-radius on cells for it to show on tr */
.dashboardTable tr td:first-child { 
	border-top-left-radius: 12px; 
	border-bottom-left-radius: 12px; 
}

.dashboardTable tr td:last-child { 
	border-top-right-radius: 12px; 
	border-bottom-right-radius: 12px; 
}

.dashboardTable tr:hover {
	background: rgba(255,255,255,0.5) !important;
	transform: scale(1.015) translateY(-2px);
	box-shadow: 0 10px 20px -5px rgba(0,0,0,0.05);
	z-index: 2;
	position: relative;
}

/* --- 4. LAYOUT --- */
.layout-grid {
	display: grid;
	grid-template-columns: 260px 1fr; /* Changed to 2 columns */
	gap: 30px;
	padding: 25px 0px 25px 25px;
	height: 100vh;
	box-sizing: border-box;
}

.sidebar-left {
	display: flex;
	flex-direction: column;
	height: 100%;
	z-index: 10;
}

.main-area {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow-y: auto;
	overflow-x: hidden;
	padding-right: 5px;
	/* Padding for the fixed right button area */
	padding-right: 50px; 
}

/* --- 5. CONTEXTUAL RIGHT PANEL (Offcanvas) --- */

/* The trigger button */
.context-trigger-btn {
	position: fixed;
	top: 50%;
	right: 0;
	transform: translateY(-50%);
	background: var(--glass-bg);
	backdrop-filter: blur(var(--glass-blur));
	border: var(--glass-border);
	border-right: none;
	border-radius: 30px 0 0 30px;
	padding: 20px 10px;
	box-shadow: -5px 0 20px rgba(0,0,0,0.05);
	cursor: pointer;
	z-index: 1040;
	color: var(--brand-red);
	transition: all 0.3s var(--ease-elastic);
}

.context-trigger-btn:hover {
	padding-right: 20px; /* Slide out effect */
	background: #fff;
}

/* The panel itself */
.offcanvas-glass {
	background: rgba(255, 255, 255, 0.85) !important;
	backdrop-filter: blur(40px) !important;
	border-left: 1px solid rgba(255, 255, 255, 0.8);
	box-shadow: -10px 0 40px rgba(0,0,0,0.1);
}

/* --- 6. SEARCH BAR (The Masterpiece) --- */
.top-header {
	display: flex; 
	justify-content: space-between; 
	align-items: center;
	margin-bottom: 40px; 
	padding-top: 10px; 
	position: relative; 
	z-index: 100;
}
.search-wrapper {
	position: relative;
	width: 320px; 
	transition: width 0.6s var(--ease-elastic);
}

body.search-active .search-wrapper { 
	width: 650px; 
}

.search-input-group {
	display: flex; 
	align-items: center; background: #fff;
	border-radius: 50px; 
	padding: 5px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.04);
	border: 2px solid transparent; /* Setup for red glow */
	transition: all 0.4s var(--ease-smooth);
}

/* The Red Glow & Expansion Effect */
body.search-active .search-input-group {
	box-shadow: 0 15px 40px rgba(204, 0, 0, 0.25);
	border-color: rgba(204, 0, 0, 0.4);
	transform: scale(1.02);
}

.search-field {
	border: none; background: transparent; 
	padding: 12px 20px;
	flex-grow: 1; 
	outline: none; 
	font-size: 1rem; 
	color: var(--brand-dark);
}

.search-btn {
	background: var(--brand-dark); 
	color: #fff; 
	border: none;
	width: 45px; 
	height: 45px; 
	border-radius: 50%;
	display: flex; 
	align-items: center; 
	justify-content: center; 
	cursor: pointer;
}

.search-btn:hover { 
	background: var(--brand-red); 
	transform: rotate(90deg) scale(1.1); 
}

/* Suggestions Dropdown */
.search-suggestions {
	position: absolute; 
	top: 120%; 
	left: 0; 
	width: 100%;
	background: rgba(255, 255, 255, 0.95); 
	backdrop-filter: blur(30px);
	border-radius: 24px; 
	padding: 20px;
	box-shadow: 0 30px 60px rgba(0,0,0,0.15);
	opacity: 0; 
	transform: translateY(-20px) scale(0.95);
	pointer-events: none; 
	transition: all 0.4s var(--ease-elastic);
}
body.search-active .search-suggestions {
	opacity: 1; 
	transform: translateY(0) scale(1); 
	pointer-events: all;
}
.dim-overlay {
	position: fixed; 
	top: 0; 
	left: 0; 
	width: 100vw; 
	height: 100vh;
	background: rgba(17, 17, 34, 0.3); 
	backdrop-filter: blur(4px);
	z-index: 90; 
	opacity: 0; 
	pointer-events: none; 
	transition: all 0.5s var(--ease-smooth);
}
body.search-active .dim-overlay { 
	opacity: 1; 
	pointer-events: all; }

/* --- 7. UTILITIES & ANIMATIONS --- */
.brand-logo img { 
	height: 40px; 
	width: auto;
	margin-bottom: 40px; 
	margin-left: 10px; 
}

.kpi-card { 
	padding: 25px; 
	height: 100%; 
	display: flex; 
	flex-direction: column; 
	justify-content: space-between;
}

.kpi-value { 
	font-size: 2.5rem; 
	font-weight: 800; 
	line-height: 1; 
	margin-top: 10px; 
}

/* Entrance Animations */
.fade-in-stagger { 
	opacity: 0; 
	animation: fadeInUp 0.8s var(--ease-smooth) forwards; 
}

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

.d-1 { 
	animation-delay: 0.1s; 
} 

.d-2 { 
	animation-delay: 0.2s; 
} 

.d-3 { 
	animation-delay: 0.3s; 
}

/* Responsive */
@media (max-width: 992px) {
	.layout-grid { 
		grid-template-columns: 1fr; 
		padding: 15px; 
	}
	.sidebar-left { 
		display: none; 
	}
	.main-area { 
		padding-right: 0; 
	}
	.context-trigger-btn { 
		display: none; 
	} /* Hide side panel trigger on mobile for now */
}

/* --- HEADER MENU BAR --- */
.header-menu{
	display:flex;
	align-items:center;
	gap:14px;
	margin-left:40px;
}

.header-menu-item{
	display:flex;
	align-items:center;
	gap:8px;
	padding:8px 14px;
	border-radius:12px;
	border:none;
	background:none;
	font-weight:600;
	color:#555;
	transition:all .25s ease;
}

.header-menu-item:hover{
	background:rgba(255,255,255,0.6);
	backdrop-filter:blur(10px);
	color:#000;
}

.header-menu-item.active{
	background:rgba(255,255,255,0.6);
	backdrop-filter:blur(10px);
	color:#000;
}

.header-dropdown{
	position:relative;
}

/* Glass dropdown style */
.dropdown-menu-glass{
	border-radius:14px;
	border:1px solid rgba(255,255,255,0.3);
	background:rgba(255,255,255,0.85);
	backdrop-filter:blur(20px);
	box-shadow:0 10px 30px rgba(0,0,0,0.1);
	padding:10px;
}

.dropdown-item{
	border-radius:8px;
	padding:8px 12px;
	font-weight:500;
}

.dropdown-item:hover{
	background:rgba(220,53,69,0.08);
	color:#dc3545;
}