/* ── Layouts ─────────────────────────────────────────────────
   App shell, sidebar navigation, main content area.
   ─────────────────────────────────────────────────────────── */

body {
	margin: 0;
	color: var(--ink);
	font-family: "DM Sans", "Trebuchet MS", sans-serif;
	background: var(--surface);
}

body.app {
	min-height: 100vh;
	background: radial-gradient(1200px 500px at 10% 0%, #eaf3ff 0%, #f8f7f4 50%, #f5f2ed 100%);
}

.app-shell {
	min-height: 100vh;
	display: grid;
	grid-template-columns: auto 1fr;
}

.side-nav {
	width: 240px;
	background: #ffffff;
	border-right: 1px solid var(--border);
	box-shadow: var(--shadow-sm);
	padding: 24px 18px;
	display: flex;
	flex-direction: column;
	gap: 24px;
	position: sticky;
	top: 0;
	height: 100vh;
}

.nav-top {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	flex-shrink: 0;
}

.nav-brand {
	width: 100%;
	font-weight: 600;
	letter-spacing: 0.14em;
	padding-left: 0.14em;
	color: var(--blue-900);
	text-align: center;
}

.brand-reveal {
	position: fixed;
	transform: translateY(-50%) scale(0.92);
	width: 210px;
	background: #0f0f0f;
	color: #e2c97e;
	font-size: 12px;
	line-height: 1.6;
	padding: 12px 14px;
	border-radius: var(--radius-md);
	border: 1px solid #3d2e00;
	box-shadow: 0 0 18px rgba(255, 180, 0, 0.25), 0 4px 16px rgba(0, 0, 0, 0.6);
	pointer-events: none;
	opacity: 0;
	transition: opacity 300ms ease, transform 300ms ease;
	z-index: 9999;
}

.brand-reveal::before {
	content: "";
	position: absolute;
	right: 100%;
	top: 50%;
	transform: translateY(-50%);
	border: 6px solid transparent;
	border-right-color: #3d2e00;
}

.brand-reveal.is-visible {
	opacity: 1;
	transform: translateY(-50%) scale(1);
}

.nav-brand-link {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	font-size: 28px;
	font-weight: 700;
	letter-spacing: 0.24em;
	color: var(--blue-900);
	text-decoration: none;
}

.nav-brand-link:hover {
	color: var(--blue-700);
}

.nav-logo {
	width: 80px;
	height: auto;
	filter: drop-shadow(0 10px 16px rgba(37, 99, 235, 0.18));
}

.nav-links {
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--border) transparent;
}

.nav-links::-webkit-scrollbar {
	width: 6px;
}

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

.nav-links::-webkit-scrollbar-thumb {
	background: var(--border);
	border-radius: var(--radius-md);
}

.nav-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: var(--radius-md);
	background: var(--blue-50);
	color: var(--ink);
	font-weight: 600;
	text-decoration: none;
	border: 1px solid transparent;
	transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.nav-link:hover {
	border-color: var(--blue-200);
	background: #ffffff;
	color: var(--blue-700);
}

.nav-link.is-active {
	border-color: var(--green-500);
	background: #ffffff;
	color: var(--blue-900);
	box-shadow: 0 8px 20px rgba(34, 197, 94, 0.16);
}


.nav-footer {
	margin-top: auto;
	flex-shrink: 0;
}

.nav-version {
	text-align: center;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--text-muted, #9ca3af);
	padding: 6px 0 10px;
	cursor: default;
	transition: color 150ms ease;
	position: relative;
}

.nav-version:hover {
	color: var(--blue-400, #60a5fa);
}

.nav-logout {
	width: 100%;
	border: none;
	border-radius: var(--radius-md);
	padding: 12px 16px;
	background: var(--blue-600);
	color: #ffffff;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
	transition: transform 120ms ease, box-shadow 120ms ease, background 150ms ease;
}

.nav-logout:hover {
	background: var(--blue-700);
	transform: translateY(-1px);
}

.nav-logout:active {
	transform: translateY(0);
	box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

/* ── Nav groups (Personal / Team / Admin) ──────────────── */

.nav-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.nav-group-label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--text-muted, #9ca3af);
	padding: 0 4px 4px;
	margin-top: 4px;
}



/* ── Nav group divider (Admin) ──────────────────────────── */

.nav-group--admin {
	padding-top: 12px;
	border-top: 1px solid var(--border);
	margin-top: 8px;
}

/* ── Settings link in footer ────────────────────────────── */

.nav-settings-link {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 8px 12px;
	border-radius: var(--radius-md);
	color: var(--text-muted, #9ca3af);
	text-decoration: none;
	font-size: 13px;
	font-weight: 500;
	border: 1px solid transparent;
	transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.nav-settings-link:hover {
	background: var(--blue-50);
	color: var(--blue-700);
}

.nav-settings-link.is-active {
	border-color: var(--green-500);
	background: #ffffff;
	color: var(--blue-900);
	box-shadow: 0 8px 20px rgba(34, 197, 94, 0.16);
}

.nav-settings-icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.main-content {
	padding: 40px clamp(20px, 4vw, 48px);
}

@media (max-width: 900px) {
	.app-shell {
		grid-template-columns: 1fr;
	}

	.side-nav {
		position: sticky;
		top: 0;
		width: 100%;
		border-right: none;
		border-bottom: 1px solid var(--border);
		flex-direction: row;
		align-items: center;
		gap: 16px;
	}

	.nav-links {
		flex-direction: row;
		margin-left: auto;
	}

	.nav-footer {
		margin-top: 0;
	}

  .nav-group {
    flex-direction: row;
    align-items: center;
    gap: 4px;
    margin-top: 0;
  }

  .nav-group-label {
    display: none;
  }

  .nav-group--admin {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
  }
}
