/* Shell móvil — menú lateral, safe areas y controles táctiles */
:root {
	--mobile-header-h: 3.25rem;
	--mobile-safe-top: env(safe-area-inset-top, 0px);
	--mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body.mobile-shell {
	-webkit-tap-highlight-color: transparent;
}

.mobile-shell__menu-btn {
	display: none;
	align-items: center;
	gap: 0.5rem;
	position: sticky;
	top: 0;
	z-index: 120;
	width: 100%;
	min-height: var(--mobile-header-h);
	padding: calc(0.65rem + var(--mobile-safe-top)) 1rem 0.65rem;
	border: none;
	border-bottom: 1px solid rgba(10, 73, 123, 0.12);
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(8px);
	color: #0a497b;
	font: 600 0.95rem/1.2 system-ui, sans-serif;
	cursor: pointer;
}

.mobile-shell__menu-icon {
	display: inline-block;
	width: 1.15rem;
	height: 0.12rem;
	background: currentColor;
	border-radius: 2px;
	box-shadow: 0 -0.38rem 0 currentColor, 0 0.38rem 0 currentColor;
}

.mobile-shell__backdrop {
	position: fixed;
	inset: 0;
	z-index: 180;
	border: none;
	padding: 0;
	margin: 0;
	background: rgba(8, 18, 30, 0.45);
	cursor: pointer;
}

@media (max-width: 768px) {
	body.mobile-shell .admin-layout,
	body.mobile-shell .reseller-layout {
		flex-direction: column;
		min-height: 100vh;
		min-height: 100dvh;
	}

	body.mobile-shell .admin-sidebar,
	body.mobile-shell .reseller-sidebar {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		z-index: 190;
		width: min(18.5rem, 88vw);
		max-width: 88vw;
		flex-direction: column;
		flex-wrap: nowrap;
		align-items: stretch;
		padding-top: calc(0.75rem + var(--mobile-safe-top));
		padding-bottom: calc(0.75rem + var(--mobile-safe-bottom));
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		transform: translateX(-105%);
		transition: transform 0.24s ease;
		box-shadow: 8px 0 28px rgba(10, 73, 123, 0.18);
	}

	body.mobile-shell.mobile-nav-open .admin-sidebar,
	body.mobile-shell.mobile-nav-open .reseller-sidebar {
		transform: translateX(0);
	}

	body.mobile-shell .admin-nav,
	body.mobile-shell .reseller-nav {
		flex-direction: column;
		flex-wrap: nowrap;
		width: 100%;
	}

	body.mobile-shell .admin-main,
	body.mobile-shell .reseller-main {
		width: 100%;
		padding-bottom: calc(1rem + var(--mobile-safe-bottom));
	}

	body.mobile-shell .admin-sidebar__foot,
	body.mobile-shell .reseller-sidebar__foot {
		margin-top: auto;
		border-top: 1px solid rgba(10, 73, 123, 0.1);
		padding-top: 0.75rem;
	}

	body.mobile-shell .button,
	body.mobile-shell .admin-input,
	body.mobile-shell .login-field__input,
	body.mobile-shell .reseller-input,
	body.mobile-shell .reseller-btn {
		min-height: 2.75rem;
	}

	body.mobile-shell table {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	body.mobile-shell .login-gate {
		padding: calc(1rem + var(--mobile-safe-top)) 1rem calc(1rem + var(--mobile-safe-bottom));
	}

	body.mobile-shell .login-gate__card {
		max-width: 100%;
	}
}

@media (max-width: 480px) {
	body.mobile-shell .admin-page-head,
	body.mobile-shell .reseller-page-head {
		padding-left: 0.85rem;
		padding-right: 0.85rem;
	}

	body.mobile-shell .admin-main,
	body.mobile-shell .reseller-main {
		padding-left: 0.85rem;
		padding-right: 0.85rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.mobile-shell .admin-sidebar,
	body.mobile-shell .reseller-sidebar {
		transition: none;
	}
}
