/**
 * Myco panel — app shell: sidebar + main column, mobile top bar / bottom nav /
 * drawer and their responsive rules. (Wizard topbar + auth split: chrome.css)
 * Tokens only.
 */

/* ---- App shell ---- */

.myco-shell {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* Panel layout: fixed dark sidebar + scrolling main. */
.myco-app {
	display: flex;
	min-height: 100vh;
	flex: 1 1 auto;
}

.myco-sidebar {
	width: var( --myco-sidebar-w );
	flex: 0 0 var( --myco-sidebar-w );
	background: var( --myco-surface-dark );
	color: var( --myco-cream );
	display: flex;
	flex-direction: column;
	padding: 20px 14px;
	gap: 3px;
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
	border-right: 1px solid transparent;
}

:root[data-theme="dark"] .myco-sidebar {
	border-right-color: var( --myco-line-on-dark );
}

.myco-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 12px 22px;
	color: var( --myco-cream );
	text-decoration: none;
}

.myco-brand:hover {
	color: var( --myco-cream );
}

.myco-brand__mark {
	width: 26px;
	height: 26px;
	border-radius: var( --myco-radius-xs );
	background: var( --myco-accent );
	color: var( --myco-on-accent );
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font: 700 14px var( --myco-font-body );
	flex-shrink: 0;
}

.myco-brand__name {
	font-family: var( --myco-font-display );
	font-weight: var( --myco-display-weight );
	font-size: 16px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.myco-nav {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.myco-nav__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	border-radius: 9px;
	color: var( --myco-muted );
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: background 0.12s, color 0.12s;
}

.myco-nav__item:hover {
	color: var( --myco-cream );
	background: rgba( 236, 231, 219, 0.06 );
}

.myco-nav__item.is-active,
.myco-nav__item[aria-current="page"] {
	color: var( --myco-cream );
	font-weight: 600;
	background: var( --myco-overlay-active-dark );
	box-shadow: inset 3px 0 0 var( --myco-accent );
}

.myco-nav__item .myco-icon {
	flex-shrink: 0;
}

.myco-sidebar__foot {
	margin-top: auto;
	border-top: 1px solid var( --myco-line-on-dark );
	padding: 14px 12px 4px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.myco-sidebar__email {
	font-size: 12px;
	color: var( --myco-muted );
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.myco-sidebar__signout {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var( --myco-cream );
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	font-family: inherit;
}

.myco-sidebar__signout:hover {
	color: var( --myco-accent );
}

/* Theme switcher (sun / moon). */
.myco-theme {
	display: flex;
	gap: 6px;
	padding: 0 0 10px;
}

.myco-theme__btn {
	width: 30px;
	height: 30px;
	border-radius: var( --myco-radius-xs );
	border: 0;
	background: transparent;
	color: var( --myco-muted );
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
}

.myco-theme__btn:hover {
	color: var( --myco-cream );
}

.myco-theme__btn.is-active,
.myco-theme__btn[aria-pressed="true"] {
	background: var( --myco-overlay-active-dark );
	color: var( --myco-cream );
}

/* Main column. */
.myco-main {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.myco-panel__body {
	flex: 1 1 auto;
	width: 100%;
	max-width: 1440px;
	padding: var( --myco-content-pad-y ) var( --myco-content-pad-x ) 48px;
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.myco-panel__body--narrow {
	max-width: 960px;
}

/* Mobile header (brand + hamburger) and bottom nav — hidden on desktop. */
.myco-mobile-top,
.myco-bottom-nav,
.myco-drawer {
	display: none;
}

/* ---- Responsive ---- */

@media ( max-width: 1200px ) {
	.myco-panel__body {
		--myco-content-pad-x: 28px;
	}
}

@media ( max-width: 900px ) {
	.myco-sidebar {
		display: none;
	}

	.myco-panel__body {
		--myco-content-pad-y: 22px;
		--myco-content-pad-x: 18px;
		padding-bottom: calc( var( --myco-mobile-nav-h ) + 24px );
		gap: 16px;
	}

	/* Mobile top bar. */
	.myco-mobile-top {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 14px 18px;
		background: var( --myco-surface-dark );
		color: var( --myco-cream );
		position: sticky;
		top: 0;
		z-index: 30;
	}

	.myco-mobile-top .myco-brand {
		padding: 0;
	}

	.myco-mobile-top .myco-brand__name {
		font-family: var( --myco-font-body );
		font-weight: 700;
		font-size: 15px;
	}

	.myco-burger {
		width: 36px;
		height: 36px;
		border: 0;
		background: transparent;
		color: var( --myco-cream );
		display: inline-flex;
		flex-direction: column;
		align-items: flex-end;
		justify-content: center;
		gap: 4px;
		cursor: pointer;
		padding: 0 6px;
	}

	.myco-burger span {
		display: block;
		height: 2px;
		width: 18px;
		border-radius: 2px;
		background: currentColor;
	}

	.myco-burger span:last-child {
		width: 12px;
	}

	/* Bottom nav: 5 tabs. */
	.myco-bottom-nav {
		display: grid;
		grid-template-columns: repeat( 5, 1fr );
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 30;
		border-top: 1px solid var( --myco-border );
		background: var( --myco-card );
		padding: 8px 6px calc( 10px + env( safe-area-inset-bottom ) );
		min-height: var( --myco-mobile-nav-h );
	}

	.myco-bottom-nav__item {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 4px;
		font-size: 11px;
		font-weight: 500;
		color: var( --myco-muted );
		text-decoration: none;
		padding: 4px 0;
	}

	.myco-bottom-nav__item.is-active,
	.myco-bottom-nav__item[aria-current="page"] {
		color: var( --myco-accent-ink );
		font-weight: 600;
	}

	/* Full-screen dark drawer. */
	.myco-drawer {
		position: fixed;
		inset: 0;
		z-index: 60;
		background: var( --myco-surface-dark );
		color: var( --myco-cream );
		display: flex;
		flex-direction: column;
		transform: translateX( 100% );
		transition: transform 0.22s ease;
	}

	.myco-drawer.is-open {
		transform: translateX( 0 );
	}

	.myco-drawer__top {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 18px 20px;
		border-bottom: 1px solid var( --myco-line-on-dark );
	}

	.myco-drawer__top .myco-brand {
		padding: 0;
	}

	.myco-drawer__close {
		width: 32px;
		height: 32px;
		border-radius: 9px;
		border: 0;
		background: var( --myco-overlay-active-dark );
		color: var( --myco-cream );
		display: inline-flex;
		align-items: center;
		justify-content: center;
		cursor: pointer;
	}

	.myco-drawer__nav {
		flex: 1 1 auto;
		display: flex;
		flex-direction: column;
		gap: 4px;
		padding: 16px 14px;
		overflow-y: auto;
	}

	.myco-drawer__nav .myco-nav__item {
		padding: 13px 14px;
		border-radius: 10px;
		font-size: 15px;
		gap: 12px;
	}

	.myco-drawer__sep {
		height: 1px;
		background: var( --myco-line-on-dark );
		margin: 10px 4px;
	}

	.myco-drawer__cta {
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 13px 14px;
		border-radius: 10px;
		background: var( --myco-success-fill );
		color: var( --myco-accent );
		font-size: 15px;
		font-weight: 600;
		text-decoration: none;
	}

	.myco-drawer__foot {
		border-top: 1px solid var( --myco-line-on-dark );
		padding: 14px 16px calc( 22px + env( safe-area-inset-bottom ) );
		display: flex;
		flex-direction: column;
		gap: 12px;
	}

	.myco-drawer__user {
		display: flex;
		align-items: center;
		gap: 10px;
	}

	.myco-drawer__avatar {
		width: 30px;
		height: 30px;
		border-radius: var( --myco-radius-pill );
		background: var( --myco-accent );
		color: var( --myco-on-accent );
		display: inline-flex;
		align-items: center;
		justify-content: center;
		font: 700 12px var( --myco-font-body );
		flex-shrink: 0;
	}

	.myco-drawer__email {
		flex: 1 1 auto;
		min-width: 0;
		font-family: var( --myco-font-mono );
		font-size: 11px;
		color: var( --myco-muted );
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.myco-theme__btn {
		width: 34px;
		height: 34px;
		border-radius: 9px;
	}
}

body.myco-drawer-open {
	overflow: hidden;
}
