/* App Drawer Menu — v1.5.2 */
body.adm-on {
	--adm-accent: #4f46e5;
	--adm-w: 280px;
	--adm-rail: 72px;
	--adm-top: 60px;
	--adm-wpbar: 0px;
	--adm-bg: #ffffff;
	--adm-fg: #1d2130;
	--adm-muted: #6b7183;
	--adm-line: #e7e8ee;
	--adm-hover: #f3f4f8;
	--adm-soft: color-mix(in srgb, var(--adm-accent) 12%, transparent);
	--adm-ease: cubic-bezier(.2, .8, .2, 1);
	--adm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	padding-top: var(--adm-top);
}
body.adm-on.admin-bar { --adm-wpbar: 32px; }
@media (max-width: 782px) { body.adm-on.admin-bar { --adm-wpbar: 46px; } }

body.adm-scheme-dark {
	--adm-bg: #13151c; --adm-fg: #e8e9ef; --adm-muted: #9aa0b2; --adm-line: #252834; --adm-hover: #1c1f29;
	--adm-soft: color-mix(in srgb, var(--adm-accent) 22%, transparent);
}
@media (prefers-color-scheme: dark) {
	body.adm-scheme-auto {
		--adm-bg: #13151c; --adm-fg: #e8e9ef; --adm-muted: #9aa0b2; --adm-line: #252834; --adm-hover: #1c1f29;
		--adm-soft: color-mix(in srgb, var(--adm-accent) 22%, transparent);
	}
}

/* Hide the theme's own header (optional) */
body.adm-hide-theme-header #masthead,
body.adm-hide-theme-header .site-header,
body.adm-hide-theme-header header.wp-block-template-part,
body.adm-hide-theme-header .elementor-location-header,
body.adm-hide-theme-header #header { display: none !important; }

/* ---------- Astra ---------- */
/* Astra's header builder: desktop + mobile headers, above/below rows, sticky clone, mobile popup menu */
body.adm-hide-theme-header.adm-astra #masthead,
body.adm-hide-theme-header.adm-astra #ast-desktop-header,
body.adm-hide-theme-header.adm-astra #ast-mobile-header,
body.adm-hide-theme-header.adm-astra .ast-above-header-wrap,
body.adm-hide-theme-header.adm-astra .ast-below-header-wrap,
body.adm-hide-theme-header.adm-astra #ast-fixed-header,
body.adm-hide-theme-header.adm-astra .ast-mobile-popup-drawer,
body.adm-hide-theme-header.adm-astra #ast-mobile-popup-wrapper,
body.adm-hide-theme-header.adm-astra .main-header-bar-wrap { display: none !important; }
/* Transparent-header pages: Astra pulls content up under its header; undo that */
body.adm-hide-theme-header.adm-astra.ast-theme-transparent-header #content { margin-top: 0 !important; }
/* Keep Astra's scroll-to-top button above our bottom bar */
body.adm-astra.adm-has-bottom #ast-scroll-top { bottom: calc(80px + env(safe-area-inset-bottom)) !important; }
@media (min-width: 1024px) { body.adm-astra.adm-has-bottom #ast-scroll-top { bottom: 30px !important; } }
/* Astra full-width sections (stretched rows, Spectra/Elementor full width) must respect the sidebar */
@media (min-width: 1024px) {
	body.adm-astra.adm-pinned .alignfull { max-width: 100%; }
}

.adm-topbar *, .adm-drawer * { box-sizing: border-box; }
.adm-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.adm-skip {
	position: fixed; left: 12px; top: -60px; z-index: 100001;
	background: var(--adm-accent); color: #fff; padding: 8px 14px; border-radius: 8px; text-decoration: none;
	font: 600 14px/1.2 var(--adm-font);
}
.adm-skip:focus { top: calc(var(--adm-wpbar) + 10px); }

/* ---------- Top bar ---------- */
.adm-topbar {
	position: fixed; top: var(--adm-wpbar); left: 0; right: 0; z-index: 99990;
	height: var(--adm-top); padding: 0 14px;
	display: flex; align-items: center; gap: 10px;
	background: color-mix(in srgb, var(--adm-bg) 88%, transparent);
	-webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
	color: var(--adm-fg); border-bottom: 1px solid var(--adm-line);
	font-family: var(--adm-font);
}
.adm-icon-btn {
	width: 40px; height: 40px; flex: none; padding: 0; margin: 0;
	display: inline-grid; place-items: center;
	border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer;
	transition: background .15s;
}
.adm-icon-btn:hover { background: var(--adm-hover); }
.adm-icon-btn:focus-visible, .adm-drawer a:focus-visible, .adm-drawer button:focus-visible, .adm-topbar a:focus-visible {
	outline: 2px solid var(--adm-accent); outline-offset: 2px;
}
.adm-brand {
	display: inline-flex; align-items: center; gap: 10px; min-width: 0;
	color: inherit; text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -.01em;
}
.adm-brand .adm-logo { height: 32px; width: auto; max-width: 140px; object-fit: contain; }
.adm-site-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.adm-avatar img, .adm-user img { display: block; border-radius: 50%; }
.adm-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 8px 14px; border-radius: 10px; background: var(--adm-accent); color: #fff !important;
	font: 600 14px/1.2 var(--adm-font); text-decoration: none;
}
.adm-btn:hover { filter: brightness(1.08); }
.adm-btn svg { width: 18px; height: 18px; }
.adm-btn-block { width: 100%; }

/* ---------- Drawer ---------- */
.adm-backdrop {
	position: fixed; inset: 0; z-index: 99998;
	background: rgba(12, 14, 22, .45); opacity: 0; pointer-events: none;
	transition: opacity .26s var(--adm-ease);
}
.adm-open .adm-backdrop { opacity: 1; pointer-events: auto; }
body.adm-lock { overflow: hidden; }

.adm-drawer {
	position: fixed; z-index: 99999; left: 0; top: var(--adm-wpbar); bottom: 0;
	width: var(--adm-w); max-width: 86vw;
	display: flex; flex-direction: column;
	background: var(--adm-bg); color: var(--adm-fg); border-right: 1px solid var(--adm-line);
	font-family: var(--adm-font); font-size: 15px; line-height: 1.35;
	transform: translateX(-100%);
	transition: transform .26s var(--adm-ease), width .22s var(--adm-ease);
	outline: none;
}
.adm-open .adm-drawer {
	transform: none;
	transition: transform .26s var(--adm-ease);
	box-shadow: 0 0 24px rgba(0, 0, 0, .18);
}
.adm-drawer-head {
	height: var(--adm-top); flex: none; padding: 0 10px 0 16px;
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	border-bottom: 1px solid var(--adm-line);
}


.adm-nav { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; -webkit-transform: translateZ(0); transform: translateZ(0); padding: 8px 10px 16px; }
.adm-menu, .adm-menu ul { list-style: none; margin: 0; padding: 0; }
.adm-menu li { position: relative; margin: 2px 0; }
.adm-menu a {
	display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px;
	border-radius: 10px; color: inherit; text-decoration: none; font-weight: 500;
	transition: background .15s, color .15s;
}
@media (hover: hover) { .adm-menu a:hover { background: var(--adm-hover); } }
.adm-menu .current-menu-item > a,
.adm-menu .current_page_item > a { background: var(--adm-soft); color: var(--adm-accent); font-weight: 600; }
.adm-menu .current-menu-ancestor > a,
.adm-menu .current_page_ancestor > a { color: var(--adm-accent); }
.adm-menu .dashicons { flex: none; width: 20px; height: 20px; font-size: 20px; }
.adm-initial {
	display: none; flex: none; width: 28px; height: 28px; border-radius: 8px;
	place-items: center; background: var(--adm-hover); font-size: 13px; font-weight: 700; text-transform: uppercase;
}
.adm-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Submenus */
.adm-menu .menu-item-has-children > a,
.adm-menu .page_item_has_children > a { padding-right: 44px; }
.adm-sub-toggle {
	position: absolute; right: 4px; top: 6px; width: 32px; height: 32px; padding: 0;
	display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--adm-muted); cursor: pointer;
}
.adm-sub-toggle:hover { background: var(--adm-hover); color: var(--adm-fg); }
.adm-sub-toggle svg { transition: transform .2s var(--adm-ease); }
.adm-sub-open > .adm-sub-toggle svg { transform: rotate(180deg); }
.adm-menu .sub-menu, .adm-menu .children {
	margin-left: 22px; padding-left: 10px; border-left: 1px solid var(--adm-line);
}
.adm-menu .sub-menu > li, .adm-menu .children > li { margin: 0; }
.adm-menu .adm-sub-open > .sub-menu, .adm-menu .adm-sub-open > .children { animation: adm-sub-in .2s var(--adm-ease); }
@keyframes adm-sub-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
/* Submenus are closed from the first paint (current section is opened server-side) */
.adm-menu li:not(.adm-sub-open) > .sub-menu,
.adm-menu li:not(.adm-sub-open) > .children { display: none; }
.adm-menu .sub-menu > li:first-child, .adm-menu .children > li:first-child { margin-top: 2px; }
.adm-menu .sub-menu a, .adm-menu .children a { min-height: 38px; padding: 8px 12px; font-size: 14px; color: var(--adm-muted); }
.adm-menu .sub-menu .current-menu-item > a, .adm-menu .children .current_page_item > a { color: var(--adm-accent); }

.adm-hint { margin: 12px; font-size: 12px; color: var(--adm-muted); }
.adm-hint a { color: var(--adm-accent); }

.adm-drawer-foot { flex: none; padding: 12px; border-top: 1px solid var(--adm-line); }
.adm-user { display: flex; align-items: center; gap: 10px; }
.adm-user-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.adm-user-meta strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-user-meta a { color: var(--adm-muted); font-size: 12px; text-decoration: none; }
.adm-user-meta a:hover { color: var(--adm-accent); }
.adm-logout { color: var(--adm-muted); }

/* ---------- Colour lock: theme CSS (Astra, WooCommerce) must not recolour drawer items ---------- */
#adm-drawer, #adm-drawer .adm-nav { background: var(--adm-bg) !important; color: var(--adm-fg) !important; }
#adm-drawer .adm-menu a, #adm-drawer .adm-menu a:visited,
#adm-drawer .adm-quick a, #adm-drawer .adm-quick a:visited { color: var(--adm-fg) !important; opacity: 1 !important; }
#adm-drawer .adm-menu .sub-menu a, #adm-drawer .adm-menu .children a { color: var(--adm-muted) !important; }
#adm-drawer .adm-menu .current-menu-item > a, #adm-drawer .adm-menu .current_page_item > a,
#adm-drawer .adm-menu .current-menu-ancestor > a, #adm-drawer .adm-menu .current_page_ancestor > a { color: var(--adm-accent) !important; }
#adm-drawer .adm-menu .current-menu-item > a, #adm-drawer .adm-menu .current_page_item > a { background-color: var(--adm-soft); }
#adm-drawer a, #adm-drawer button, .adm-topbar a, .adm-topbar button, .adm-bottom a { -webkit-tap-highlight-color: transparent; }
.adm-bottom .adm-bottom-menu a { color: var(--adm-muted) !important; }
.adm-bottom .adm-bottom-menu .current-menu-item > a, .adm-bottom .adm-bottom-menu .current_page_item > a { color: var(--adm-accent) !important; }

#adm-drawer:focus, #adm-drawer a:focus:not(:focus-visible), #adm-drawer button:focus:not(:focus-visible) { outline: none !important; box-shadow: none; }
#adm-drawer .adm-brand { outline: none; }

/* ---------- Wallet (TeraWallet) ---------- */
.adm-bal-mask { display: none; letter-spacing: .12em; }
.adm-bal-hidden .adm-bal-val { display: none; }
.adm-bal-hidden .adm-bal-mask { display: inline; }
.adm-bal-val .woocommerce-Price-amount, .adm-bal-val bdi { font: inherit; color: inherit; }

.adm-wallet-chip {
	display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px;
	border-radius: 999px; background: var(--adm-soft); color: var(--adm-accent); text-decoration: none;
	font: 700 14px/1 var(--adm-font); white-space: nowrap;
}
.adm-wallet-chip svg { width: 18px; height: 18px; }
.adm-wallet-chip:hover { filter: brightness(1.05); }

.adm-wallet {
	flex: none; margin: 14px 14px 4px; padding: 16px; border-radius: 16px; color: #fff;
	background:
		radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,.22), transparent 55%),
		linear-gradient(135deg, var(--adm-accent), color-mix(in srgb, var(--adm-accent) 55%, #000));
	box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--adm-accent) 80%, transparent);
}
.adm-wallet-top { display: flex; align-items: center; justify-content: space-between; font-size: 13px; opacity: .9; }
.adm-eye {
	width: 30px; height: 30px; padding: 0; display: grid; place-items: center;
	border: 0; border-radius: 8px; background: rgba(255,255,255,.14); color: #fff; cursor: pointer;
}
.adm-eye svg { width: 17px; height: 17px; }
.adm-eye[aria-pressed="true"] { background: rgba(255,255,255,.3); }
.adm-wallet-amt { margin: 4px 0 14px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.adm-wallet-actions { display: flex; gap: 8px; }
.adm-wbtn {
	flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 38px; padding: 8px 10px; border-radius: 10px;
	background: rgba(255,255,255,.16); color: #fff !important; text-decoration: none;
	font: 600 13px/1.1 var(--adm-font); white-space: nowrap; transition: background .15s;
}
.adm-wbtn:hover { background: rgba(255,255,255,.26); }
.adm-wbtn svg { width: 16px; height: 16px; }
.adm-wbtn-solid { background: #fff; color: var(--adm-accent) !important; }
.adm-wbtn-solid:hover { background: #fff; filter: brightness(.96); }
.adm-wallet-guest strong { display: block; font-size: 15px; line-height: 1.35; margin-bottom: 12px; }

/* ---------- Quick action tiles ---------- */
.adm-section-title {
	margin: 12px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
	text-transform: uppercase; color: var(--adm-muted);
}
.adm-quick { list-style: none; margin: 0 0 6px; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.adm-quick li { margin: 0; }
.adm-quick a {
	display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px;
	border: 1px solid var(--adm-line); border-radius: 12px; color: inherit; text-decoration: none;
	font-size: 13px; font-weight: 600; transition: border-color .15s, background .15s, transform .15s;
}
.adm-quick a:hover { border-color: var(--adm-accent); background: var(--adm-soft); }
.adm-quick a:active { transform: scale(.97); }
.adm-quick .dashicons, .adm-quick .adm-initial {
	display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
	background: var(--adm-soft); color: var(--adm-accent); font-size: 18px; line-height: 34px;
}
.adm-quick .dashicons:before { width: 18px; height: 18px; }
.adm-quick .adm-label { width: 100%; }
.adm-quick .current-menu-item > a { border-color: var(--adm-accent); background: var(--adm-soft); }

/* ---------- Mobile bottom bar ---------- */
.adm-bottom {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 99980;
	padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
	background: color-mix(in srgb, var(--adm-bg) 92%, transparent);
	-webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
	border-top: 1px solid var(--adm-line); color: var(--adm-fg); font-family: var(--adm-font);
}
.adm-bottom-menu { list-style: none; margin: 0 auto; padding: 0; max-width: 560px; display: flex; }
.adm-bottom-menu li { flex: 1; margin: 0; }
.adm-bottom-menu a {
	display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px;
	border-radius: 12px; color: var(--adm-muted); text-decoration: none; font-size: 11px; font-weight: 600;
}
.adm-bottom-menu .dashicons { width: 22px; height: 22px; font-size: 22px; }
.adm-bottom-menu .adm-initial { display: grid; width: 24px; height: 24px; font-size: 12px; }
.adm-bottom-menu .adm-label { max-width: 100%; text-align: center; }
.adm-bottom-menu .current-menu-item > a, .adm-bottom-menu .current_page_item > a { color: var(--adm-accent); }
.adm-bottom-menu .current-menu-item .adm-initial { background: var(--adm-soft); }
body.adm-has-bottom { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) {
	.adm-bottom { display: none; }
	body.adm-has-bottom { padding-bottom: 0; }
}
@media (max-width: 420px) { .adm-wallet-chip svg { display: none; } .adm-site-name { font-size: 15px; } }

/* ---------- Performance on phones ----------
 * Blur behind fixed bars repaints on every scroll frame and makes cheap Android
 * phones lag; use solid backgrounds below desktop width. */
@media (max-width: 1023px) {
	.adm-topbar, .adm-bottom { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--adm-bg); }
	.adm-wallet { box-shadow: none; }
}

/* ---------- Desktop: pinned sidebar ---------- */
@media (min-width: 1024px) {
	body.adm-pinned { padding-left: var(--adm-w); transition: padding-left .22s var(--adm-ease); }
	.adm-pinned .adm-drawer {
		top: calc(var(--adm-wpbar) + var(--adm-top)); max-width: none;
		transform: none; visibility: visible; box-shadow: none;
		transition: width .22s var(--adm-ease);
	}
	.adm-pinned .adm-drawer-head, .adm-pinned .adm-backdrop { display: none; }

	/* Collapsed icon rail */
	.adm-collapsed body.adm-pinned { padding-left: var(--adm-rail); }
	.adm-collapsed .adm-pinned .adm-drawer { width: var(--adm-rail); }
	.adm-collapsed .adm-pinned .adm-label,
	.adm-collapsed .adm-pinned .adm-sub-toggle,
	.adm-collapsed .adm-pinned .sub-menu,
	.adm-collapsed .adm-pinned .children,
	.adm-collapsed .adm-pinned .adm-user-meta,
	.adm-collapsed .adm-pinned .adm-logout,
	.adm-collapsed .adm-pinned .adm-hint,
	.adm-collapsed .adm-pinned .adm-wallet,
	.adm-collapsed .adm-pinned .adm-quick,
	.adm-collapsed .adm-pinned .adm-section-title { display: none; }
	.adm-collapsed .adm-pinned .adm-nav { padding-top: 14px; }
	.adm-collapsed .adm-pinned .adm-menu a { justify-content: center; padding: 10px; }
	.adm-collapsed .adm-pinned .adm-initial { display: grid; }
	.adm-collapsed .adm-pinned .adm-user { justify-content: center; }
	.adm-collapsed .adm-pinned .adm-btn-block { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
	.adm-drawer, .adm-backdrop, body.adm-pinned, .adm-menu .sub-menu, .adm-menu .children { transition: none !important; animation: none !important; }
}
