@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

.page {
	color: #111827;
}

.auth-screen,
.loading-screen {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
}

.auth-screen {
	padding-inline: 1rem;
	background-color: #f3f4f6;
}

.auth-card {
	width: 100%;
	max-width: 24rem;
	padding: 2rem;
	text-align: center;
	background-color: #ffffff;
	border-radius: 0.5rem;
	box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.auth-logo {
	margin-bottom: 1rem;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 2rem;
	letter-spacing: 0.1em;
}

.auth-title {
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.75rem;
}

.auth-description {
	margin-top: 0.75rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: #4b5563;
}

.login-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 1.5rem;
	padding: 0.75rem 1.25rem;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.25rem;
	color: #ffffff;
	cursor: pointer;
	background-color: #2563eb;
	border: 0;
	border-radius: 0.375rem;
}

.login-button:hover {
	background-color: #1d4ed8;
}

.login-button:focus {
	outline: 2px solid transparent;
	outline-offset: 2px;
	box-shadow: 0 0 0 2px #3b82f6, 0 0 0 4px #ffffff;
}

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

.auth-error {
	margin-top: 1rem;
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: #b91c1c;
}

.loading-spinner {
	width: 2.5rem;
	height: 2.5rem;
	border: 4px solid #d1d5db;
	border-top-color: #2563eb;
	border-radius: 9999px;
	animation: spin 1s linear infinite;
}

.is-hidden {
	display: none;
}

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

:root {
	--bg: #071127;
	--sidebar: #0c1836;
	--surface: #101e41;
	--soft: #15274f;
	--border: #20345c;
	--text: #f7f9ff;
	--muted: #8fa0c4;
	--primary: #6467f2;
	--green: #36d7a1;
	--amber: #f6b94b;
	--coral: #ff746c;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Manrope', sans-serif; }
button, input, select { font: inherit; }
.page { min-width: 320px; color: var(--text); background: var(--bg); }
.page.light-theme { --bg: #f3f6fb; --sidebar: #fff; --surface: #fff; --soft: #e9eef8; --border: #dce3ef; --text: #17213b; --muted: #6d7893; }
.auth-screen { background: radial-gradient(circle at 50% 0%, #192c5b, var(--bg) 55%); }
.auth-card { color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.auth-logo { display: grid; place-items: center; width: 3rem; height: 3rem; margin: 0 auto 1rem; font-size: 1rem; color: #fff; background: var(--primary); border-radius: 8px; }
.auth-description { color: var(--muted); }
.login-button { background: var(--primary); border-radius: 7px; }
.admin-shell { min-height: 100vh; background: var(--bg); }

.sidebar {
	position: fixed;
	inset: 0 auto 0 0;
	z-index: 40;
	display: flex;
	flex-direction: column;
	width: 248px;
	padding: 1.5rem 1rem 1rem;
	background: var(--sidebar);
	border-right: 1px solid var(--border);
	transition: transform 220ms ease;
}

.brand-row, .sidebar-profile, .topbar, .topbar-actions, .search-box, .page-heading, .panel-heading, .person-cell, .progress-cell { display: flex; align-items: center; }
.brand-row { gap: .75rem; padding: 0 .55rem 1.6rem; border-bottom: 1px solid var(--border); }
.brand-mark { display: grid; place-items: center; width: 2.35rem; height: 2.35rem; font-size: .9rem; font-weight: 800; color: #fff; background: var(--primary); border-radius: 7px; }
.brand-copy, .profile-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.brand-copy strong { font-size: 1rem; letter-spacing: .08em; }
.brand-copy span, .profile-copy span { overflow: hidden; font-size: .66rem; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav { flex: 1; padding-top: 1.25rem; }
.nav-label { margin: 0 .7rem .55rem; font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #65779d; }
.nav-label-secondary { margin-top: 1.5rem; }
.nav-link { position: relative; display: flex; align-items: center; gap: .8rem; height: 2.8rem; margin-bottom: .2rem; padding: 0 .8rem; font-size: .78rem; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: 7px; transition: 150ms ease; }
.nav-link svg, .icon-button svg { width: 1.05rem; height: 1.05rem; stroke-width: 2; }
.nav-link:hover, .nav-link.is-active { color: var(--text); background: var(--soft); }
.nav-link.is-active::before { position: absolute; inset: 0 auto 0 -1rem; width: 3px; content: ''; background: #8d8ff8; border-radius: 0 3px 3px 0; }
.nav-count { margin-left: auto; padding: .16rem .42rem; font-size: .6rem; color: #9fa1ff; background: rgb(100 103 242 / .15); border-radius: 99px; }
.nav-count-alert { color: var(--amber); background: rgb(246 185 75 / .12); }
.sidebar-profile { gap: .65rem; padding: 1rem .5rem 0; border-top: 1px solid var(--border); }
.profile-copy strong { overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.user-avatar, .activity-avatar, .mini-avatar { display: grid; flex: 0 0 auto; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(145deg, #7c7ff6, #484dcf); border-radius: 50%; }
.user-avatar { width: 2rem; height: 2rem; font-size: .62rem; box-shadow: 0 0 0 2px var(--border); }
.icon-button { display: grid; flex: 0 0 auto; place-items: center; width: 2.25rem; height: 2.25rem; color: var(--muted); cursor: pointer; background: transparent; border: 0; border-radius: 7px; }
.icon-button:hover { color: var(--text); background: var(--soft); }
.sidebar-close, .menu-button { display: none; }

.workspace { min-height: 100vh; margin-left: 248px; }
.topbar { position: sticky; top: 0; z-index: 20; justify-content: flex-end; gap: 1rem; height: 72px; padding: 0 2rem; background: rgb(7 17 39 / .88); border-bottom: 1px solid var(--border); backdrop-filter: blur(14px); }
.light-theme .topbar { background: rgb(243 246 251 / .9); }
.search-box { gap: .65rem; width: min(100%, 390px); height: 2.55rem; margin-right: auto; padding: 0 .8rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 7px; }
.search-box svg { width: 1rem; }
.search-box input { flex: 1; min-width: 0; font-size: .75rem; color: var(--text); background: transparent; border: 0; outline: 0; }
.search-box input::placeholder { color: var(--muted); }
.search-box kbd { padding: .17rem .38rem; font-size: .57rem; color: var(--muted); background: var(--soft); border: 1px solid var(--border); border-radius: 4px; }
.topbar-actions { gap: .35rem; }
.notification-button { position: relative; }
.notification-button span { position: absolute; top: .48rem; right: .48rem; width: .38rem; height: .38rem; background: var(--coral); border: 2px solid var(--bg); border-radius: 50%; }
.dashboard-content { width: min(100%, 1500px); margin: 0 auto; padding: 1.9rem 2rem 2.5rem; }
.page-heading { align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.65rem; }
.eyebrow { margin: 0 0 .3rem; font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #9fa1ff; }
.page-heading h1 { margin: 0; font-size: clamp(1.5rem, 2.2vw, 2rem); font-weight: 800; line-height: 1.15; }
.page-heading p:last-child { margin: .4rem 0 0; font-size: .77rem; color: var(--muted); }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 2.75rem; padding: .65rem 1.1rem; font-size: .82rem; font-weight: 700; color: #fff; cursor: pointer; background: var(--primary); border: 0; border-radius: 7px; box-shadow: 0 8px 20px rgb(100 103 242 / .25); }
.primary-button:hover { background: #7779f5; }
.primary-button svg, .text-button svg { width: 1rem; height: 1rem; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.metric-card, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 18px 42px rgb(0 0 0 / .16); }
.metric-card { display: flex; align-items: center; gap: .9rem; min-height: 118px; padding: 1.15rem; transition: 160ms ease; }
.metric-card:hover { border-color: #3a4e7d; transform: translateY(-2px); }
.metric-card-highlight { background: linear-gradient(135deg, #343998, #575bea); border-color: transparent; }
.metric-icon { display: grid; flex: 0 0 auto; place-items: center; width: 2.75rem; height: 2.75rem; color: #9fa1ff; background: rgb(100 103 242 / .16); border-radius: 7px; }
.metric-card-highlight .metric-icon { color: #fff; background: rgb(255 255 255 / .13); }
.metric-icon-green { color: var(--green); background: rgb(54 215 161 / .12); }
.metric-icon-amber { color: var(--amber); background: rgb(246 185 75 / .12); }
.metric-icon-coral { color: var(--coral); background: rgb(255 116 108 / .12); }
.metric-icon svg { width: 1.25rem; }
.metric-card div:last-child { display: flex; flex-direction: column; min-width: 0; }
.metric-card span { font-size: .66rem; color: var(--muted); }
.metric-card-highlight span, .metric-card-highlight small { color: #dfe1ff; }
.metric-card strong { margin: .2rem 0; font-size: 1.35rem; line-height: 1.2; }
.metric-card small { font-size: .58rem; color: var(--muted); }
.metric-card small b { color: var(--green); }
.metric-card-highlight small b { color: #a9ffd9; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 1rem; margin-top: 1rem; }
.panel { padding: 1.25rem; }
.panel-heading { align-items: flex-start; justify-content: space-between; gap: 1rem; }
.panel-heading h2 { margin: 0; font-size: .92rem; font-weight: 700; }
.panel-heading p { margin: .28rem 0 0; font-size: .64rem; color: var(--muted); }
.panel-heading select { padding: .45rem .65rem; font-size: .64rem; color: var(--text); background: var(--soft); border: 1px solid var(--border); border-radius: 5px; }
.text-button { display: inline-flex; align-items: center; gap: .3rem; padding: .35rem; font-size: .65rem; font-weight: 700; color: #9fa1ff; cursor: pointer; background: transparent; border: 0; }
.chart-wrap { display: flex; height: 235px; padding-top: 1.5rem; }
.chart-scale { display: flex; flex: 0 0 24px; flex-direction: column; justify-content: space-between; padding-bottom: 1.7rem; font-size: .55rem; color: var(--muted); }
.bar-chart { display: grid; flex: 1; grid-template-columns: repeat(6, 1fr); gap: clamp(.7rem, 2.6vw, 2rem); background: repeating-linear-gradient(to bottom, var(--border) 0, var(--border) 1px, transparent 1px, transparent 25%); }
.chart-column { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; text-align: center; }
.chart-bar { width: min(100%, 30px); height: var(--bar-height); min-height: 2rem; margin: 0 auto .6rem; background: #384c7e; border-radius: 5px 5px 2px 2px; animation: grow-bar 650ms ease both; }
.chart-bar-current { background: linear-gradient(to top, #5559dc, #8588f8); box-shadow: 0 0 20px rgb(100 103 242 / .25); }
.bar-march { --bar-height: 48%; } .bar-april { --bar-height: 66%; } .bar-may { --bar-height: 57%; } .bar-june { --bar-height: 79%; } .bar-july { --bar-height: 68%; } .bar-august { --bar-height: 92%; }
.chart-column span { font-size: .58rem; color: var(--muted); }
.activity-list { margin-top: .8rem; }
.activity-list article { display: flex; align-items: center; gap: .75rem; padding: .78rem 0; border-bottom: 1px solid var(--border); }
.activity-list article:last-child { border-bottom: 0; }
.activity-avatar { width: 2.1rem; height: 2.1rem; font-size: .58rem; }
.avatar-blue { background: #4754be; } .avatar-green { background: #188b70; } .avatar-amber { background: #bd7e1e; } .avatar-coral { background: #bc514e; }
.activity-list p { margin: 0; font-size: .67rem; line-height: 1.4; }
.activity-list span { display: block; margin-top: .17rem; font-size: .56rem; color: var(--muted); }
.projects-panel { margin-top: 1rem; padding-bottom: .35rem; }
.table-wrap { overflow-x: auto; margin: .9rem -1.25rem 0; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: .8rem 1.25rem; font-size: .64rem; text-align: left; border-top: 1px solid var(--border); }
th { font-size: .56rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: rgb(255 255 255 / .015); }
td > strong, td > span { display: block; }
td > span:not(.status) { margin-top: .2rem; font-size: .56rem; color: var(--muted); }
.person-cell, .progress-cell { gap: .55rem; white-space: nowrap; }
.mini-avatar { width: 1.7rem; height: 1.7rem; font-size: .5rem; }
.progress-cell > span { width: 80px; height: 5px; overflow: hidden; background: var(--soft); border-radius: 99px; }
.progress-cell i { display: block; width: var(--progress); height: 100%; background: var(--primary); border-radius: inherit; }
.progress-78 { --progress: 78%; } .progress-54 { --progress: 54%; } .progress-91 { --progress: 91%; }
.progress-cell b { font-size: .58rem; }
.status { display: inline-block; padding: .3rem .52rem; font-size: .55rem; font-weight: 700; border-radius: 99px; }
.status-progress { color: var(--green); background: rgb(54 215 161 / .11); }
.status-review { color: var(--amber); background: rgb(246 185 75 / .11); }
.sidebar-backdrop { display: none; }

@keyframes grow-bar { from { height: 0; } }

@media (max-width: 1100px) {
	.metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
	.sidebar { transform: translateX(-100%); }
	.sidebar.is-open { transform: translateX(0); }
	.sidebar-close, .menu-button { display: grid; }
	.sidebar-backdrop { position: fixed; inset: 0; z-index: 30; display: block; background: rgb(2 8 23 / .68); opacity: 0; pointer-events: none; transition: opacity 220ms ease; }
	.sidebar-backdrop.is-visible { opacity: 1; pointer-events: auto; }
	.workspace { margin-left: 0; }
	.topbar { gap: .5rem; height: 64px; padding: 0 1rem; }
	.menu-button { margin-right: .25rem; }
	.search-box { flex: 1; width: auto; }
	.search-box kbd, #header-avatar { display: none; }
	.dashboard-content { padding: 1.4rem 1rem 2rem; }
	.page-heading { align-items: flex-start; }
	.primary-button { width: 2.7rem; padding: 0; font-size: 0; }
}

@media (max-width: 520px) {
	.metrics-grid { grid-template-columns: 1fr; }
	.metric-card { min-height: 100px; }
	.chart-wrap { height: 205px; }
	.bar-chart { gap: .55rem; }
	.panel { padding: 1rem; }
	.table-wrap { margin-inline: -1rem; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}