/* =========================================================================
   Arex Account Panel — v1.1
   Design reference: "My Journal" (light, airy, sky-blue accent, soft cards)
   ========================================================================= */
:root {
	--aap-primary: #0ea5e9;
	--aap-primary-soft: color-mix(in srgb, var(--aap-primary) 11%, transparent);
	--aap-primary-line: color-mix(in srgb, var(--aap-primary) 30%, transparent);
	--aap-primary-ink: #fff;
	--aap-font: IRANYekan, IRANSans, Vazirmatn, Estedad, Tahoma, sans-serif;

	--aap-bg: #f0f4f9;
	--aap-surface: #ffffff;
	--aap-surface-2: #f6f8fb;
	--aap-border: #e6ebf2;
	--aap-text: #0f172a;
	--aap-text-2: #334155;
	--aap-muted: #7b8798;

	--aap-success: #10b981;
	--aap-warning: #f59e0b;
	--aap-danger: #ef4444;
	--aap-info: #6366f1;

	--aap-radius: 14px;
	--aap-radius-sm: 10px;
	--aap-shadow: 0 1px 2px rgba(15, 23, 42, .04);
	--aap-shadow-lg: 0 12px 32px rgba(15, 23, 42, .08);
	--aap-sidebar-w: 252px;
	--aap-container: 1360px;
	--aap-topbar-h: 60px;
}

:root[data-aap-theme="dark"] {
	--aap-bg: #0a101c;
	--aap-surface: #111827;
	--aap-surface-2: #0d1422;
	--aap-border: #1f2a3c;
	--aap-text: #e7edf6;
	--aap-text-2: #c4cedc;
	--aap-muted: #8794a8;
	--aap-shadow: none;
	--aap-shadow-lg: 0 12px 32px rgba(0, 0, 0, .45);
	color-scheme: dark;
}

/* ---------- base ---------- */
.aap-body, .aap-body *, .aap-body *::before, .aap-body *::after { box-sizing: border-box; }
.aap-body {
	margin: 0; background: var(--aap-bg); color: var(--aap-text);
	font-family: var(--aap-font); font-size: 14px; line-height: 1.8;
	-webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.aap-shell { min-height: 100vh; }
.aap-body a { color: inherit; text-decoration: none; }
.aap-body h1, .aap-body h2, .aap-body h3, .aap-body h4 { margin: 0; font-family: inherit; color: var(--aap-text); line-height: 1.5; letter-spacing: 0; }
.aap-body p { margin: 0 0 .75em; }
.aap-body img { max-width: 100%; height: auto; }
.aap-body button, .aap-body input, .aap-body select, .aap-body textarea { font-family: inherit; font-size: inherit; }
.aap-i { flex: none; display: block; }
.aap-muted { color: var(--aap-muted); }
.aap-link { color: var(--aap-primary); font-weight: 600; }
.aap-link:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.aap-body :focus-visible { outline: 2px solid var(--aap-primary); outline-offset: 2px; }

/* Screen-reader / skip links (theme skip links were showing as plain text) */
.aap-body .screen-reader-text,
.aap-body .skip-link,
.aap-body .screen-reader-shortcut,
.aap-skip {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); border: 0; white-space: nowrap;
}
.aap-body .screen-reader-text:focus,
.aap-body .skip-link:focus,
.aap-skip:focus {
	clip: auto; clip-path: none; width: auto; height: auto; margin: 0; overflow: visible;
	top: 10px; inset-inline-start: 10px; z-index: 100000; padding: 10px 16px;
	background: var(--aap-surface); color: var(--aap-text); border-radius: var(--aap-radius-sm); box-shadow: var(--aap-shadow-lg);
}

/* ---------- layout ----------
   Centered frame: sidebar card sits right next to the content so the eye
   doesn't travel across the whole screen. Sidebar stays put while scrolling. */
html:has(body.aap-shell), body.aap-shell { overflow: visible !important; }
/* Theme styles stay loaded on theme tabs (wishlist, courses, notifications);
   keep the panel's own background and text colours there too. */
html:has(body.aap-shell), html body.aap-shell { background: var(--aap-bg) !important; background-image: none !important; color: var(--aap-text); }
.aap-theme-extras { display: none !important; }

.aap-layout {
	width: 100%; max-width: var(--aap-container); margin: 0 auto; padding: 20px;
	display: grid; grid-template-columns: var(--aap-sidebar-w) minmax(0, 1fr); gap: 20px; align-items: start;
}
.aap-main { min-width: 0; }
.aap-page { outline: none; padding-bottom: 40px; }

.aap-sidebar {
	position: sticky; top: calc(var(--aap-topbar-h) + 20px);
	max-height: calc(100vh - var(--aap-topbar-h) - 40px);
	display: flex; flex-direction: column; z-index: 30;
	background: var(--aap-surface); border: 1px solid var(--aap-border); border-radius: var(--aap-radius);
	box-shadow: var(--aap-shadow); overflow: hidden;
}
.aap-sidebar__user {
	display: flex; align-items: center; gap: 10px; padding: 16px; flex: none;
	border-bottom: 1px solid var(--aap-border);
	background: linear-gradient(180deg, var(--aap-primary-soft), transparent);
}
.aap-sidebar__user .aap-avatar img { width: 44px; height: 44px; box-shadow: 0 0 0 2px var(--aap-surface), 0 0 0 3px var(--aap-primary-line); }
.aap-sidebar__meta { display: grid; min-width: 0; line-height: 1.5; }
.aap-sidebar__meta strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aap-sidebar__meta small { font-size: 11px; color: var(--aap-muted); direction: ltr; text-align: end; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aap-sidebar .aap-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 10px; scrollbar-width: thin; }
.aap-sidebar__foot { padding: 8px 10px 10px; border-top: 1px solid var(--aap-border); flex: none; }

.aap-brand { display: flex; align-items: center; flex: none; }
.aap-brand img { max-height: 34px; width: auto; }
.aap-brand__text { font-weight: 800; font-size: 16px; }

/* ---------- nav ---------- */
.aap-nav__group + .aap-nav__group { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--aap-border); }
.aap-nav__title { font-size: 11px; color: var(--aap-muted); padding: 0 12px 6px; }
.aap-nav__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.aap-nav__link {
	position: relative; display: flex; align-items: center; gap: 10px;
	padding: 9px 12px; border-radius: var(--aap-radius-sm);
	color: var(--aap-text-2); font-weight: 500; font-size: 13.5px; transition: background .15s, color .15s;
}
.aap-nav__link .aap-i { color: var(--aap-muted); transition: color .15s; }
.aap-nav__link:hover { background: var(--aap-surface-2); color: var(--aap-text); }
.aap-nav__link.is-active { background: var(--aap-primary-soft); color: var(--aap-primary); font-weight: 700; }
.aap-nav__link.is-active .aap-i { color: var(--aap-primary); }
.aap-nav__link.is-active::before {
	content: ""; position: absolute; inset-block: 9px; inset-inline-start: 0;
	width: 3px; border-radius: 3px; background: var(--aap-primary);
}
.aap-nav__link--logout:hover, .aap-nav__link--logout:hover .aap-i { background: color-mix(in srgb, var(--aap-danger) 9%, transparent); color: var(--aap-danger); }

/* ---------- topbar ---------- */
.aap-topbar {
	position: sticky; top: 0; z-index: 40; height: var(--aap-topbar-h);
	background: color-mix(in srgb, var(--aap-surface) 90%, transparent);
	backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--aap-border);
}
.aap-topbar__inner { max-width: var(--aap-container); height: 100%; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 10px; }
.aap-topbar__tools { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.aap-iconbtn.aap-burger { display: none; }
.aap-clock { display: grid; text-align: end; line-height: 1.35; }
.aap-clock strong { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.aap-clock small { font-size: 11px; color: var(--aap-muted); }
.aap-sep { width: 1px; height: 26px; background: var(--aap-border); margin: 0 4px; }

.aap-iconbtn {
	width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0;
	border: 1px solid var(--aap-border); border-radius: var(--aap-radius-sm);
	background: var(--aap-surface); color: var(--aap-muted); cursor: pointer; transition: .15s;
}
.aap-iconbtn:hover { color: var(--aap-primary); border-color: var(--aap-primary-line); background: var(--aap-primary-soft); }
.aap-chipbtn {
	height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px;
	border: 1px solid var(--aap-border); border-radius: var(--aap-radius-sm); color: var(--aap-text-2); font-size: 13px; font-weight: 600;
}
.aap-chipbtn:hover { border-color: var(--aap-primary-line); color: var(--aap-primary); }
.aap-avatar { flex: none; display: block; }
.aap-avatar img { width: 34px; height: 34px; border-radius: 50%; display: block; object-fit: cover; background: var(--aap-surface-2); }
.aap-avatar--lg img { width: 60px; height: 60px; box-shadow: 0 0 0 3px var(--aap-surface), 0 0 0 5px var(--aap-primary-line); }
.aap-ico-sun { display: none; }
[data-aap-theme="dark"] .aap-ico-sun { display: block; }
[data-aap-theme="dark"] .aap-ico-moon { display: none; }

/* ---------- page header (inside the content column) ---------- */
.aap-pagehead { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; min-height: 44px; }
.aap-pagehead h1 { font-size: 20px; font-weight: 800; }
.aap-pagehead p { margin: 0; color: var(--aap-muted); font-size: 12.5px; }
.aap-pagehead__actions { display: flex; gap: 8px; }

/* ---------- buttons ---------- */
.aap-btn,
.aap-content .button,
.aap-content button.woocommerce-Button,
.aap-content .woocommerce-button,
.aap-content button[type="submit"],
.aap-content input[type="submit"] {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	padding: 8px 16px; min-height: 38px; border-radius: var(--aap-radius-sm); border: 1px solid transparent;
	background: var(--aap-primary); color: var(--aap-primary-ink) !important; font-weight: 700; font-size: 13px; cursor: pointer;
	line-height: 1.6; transition: filter .15s, background .15s, border-color .15s; text-decoration: none !important; white-space: nowrap;
	box-shadow: 0 1px 2px color-mix(in srgb, var(--aap-primary) 30%, transparent);
}
.aap-btn:hover, .aap-content .button:hover, .aap-content button[type="submit"]:hover, .aap-content input[type="submit"]:hover { filter: brightness(1.07); }
.aap-btn--ghost { background: var(--aap-surface); color: var(--aap-text-2) !important; border-color: var(--aap-border); box-shadow: none; }
.aap-btn--ghost:hover { filter: none; border-color: var(--aap-primary-line); color: var(--aap-primary) !important; background: var(--aap-primary-soft); }
/* Ghost/warning buttons must win over the generic submit-button rule inside content. */
.aap-body .aap-btn.aap-btn--ghost { background: var(--aap-surface); color: var(--aap-text-2) !important; border-color: var(--aap-border); box-shadow: none; }
.aap-body .aap-btn.aap-btn--ghost:hover { border-color: var(--aap-primary-line); color: var(--aap-primary) !important; background: var(--aap-primary-soft); filter: none; }
.aap-body .aap-btn.aap-btn--warning { background: var(--aap-warning); }
.aap-btn--warning { background: var(--aap-warning); box-shadow: none; }
.aap-btn--sm { padding: 4px 12px; min-height: 32px; font-size: 12.5px; }
.aap-btn--block { width: 100%; min-height: 44px; }

/* ---------- cards ---------- */
.aap-card {
	background: var(--aap-surface); border: 1px solid var(--aap-border); border-radius: var(--aap-radius);
	box-shadow: var(--aap-shadow); padding: 18px; min-width: 0;
}
.aap-card--flush { padding: 0; overflow: hidden; }
.aap-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.aap-card__icon { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--aap-primary-soft); color: var(--aap-primary); }
.aap-card__titles { flex: 1; min-width: 0; }
.aap-card__titles h3 { font-size: 14.5px; font-weight: 800; }
.aap-card__titles p { margin: 0; font-size: 12px; color: var(--aap-muted); line-height: 1.5; }
.aap-card__link { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 700; color: var(--aap-primary); padding: 4px 8px; border-radius: 8px; }
.aap-card__link:hover { background: var(--aap-primary-soft); }

/* ---------- dashboard ---------- */
.aap-hero {
	display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
	padding: 20px 22px; margin-bottom: 14px;
	background:
		radial-gradient(120% 140% at 100% 0%, var(--aap-primary-soft) 0%, transparent 55%),
		var(--aap-surface);
}
.aap-hero__user { display: flex; align-items: center; gap: 16px; min-width: 0; }
.aap-hero__user h2 { font-size: 19px; font-weight: 800; }
.aap-hero__user p { margin: 0; color: var(--aap-muted); font-size: 12.5px; }
.aap-hero__profile {
	display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 18px;
	background: var(--aap-surface); border: 1px solid var(--aap-border); border-radius: var(--aap-radius);
}
.aap-hero__profile strong { display: block; font-size: 13.5px; margin-bottom: 4px; }
.aap-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.aap-chip { font-size: 11.5px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px dashed var(--aap-primary-line); color: var(--aap-primary); background: var(--aap-primary-soft); }
.aap-chip:hover { border-style: solid; }

.aap-ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.aap-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.aap-ring circle { fill: none; stroke-width: 6; }
.aap-ring__track { stroke: var(--aap-border); }
.aap-ring__bar { stroke: var(--aap-primary); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.aap-ring b { position: absolute; font-size: 14px; font-weight: 800; }

.aap-alert {
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
	padding: 10px 12px 10px 14px; border-radius: var(--aap-radius); margin-bottom: 14px; border: 1px solid;
}
.aap-alert > span:not(.aap-alert__icon) { flex: 1; }
.aap-alert__icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.aap-alert--warning { background: color-mix(in srgb, var(--aap-warning) 9%, var(--aap-surface)); border-color: color-mix(in srgb, var(--aap-warning) 30%, transparent); }
.aap-alert--warning .aap-alert__icon { background: color-mix(in srgb, var(--aap-warning) 18%, transparent); color: #b45309; }
[data-aap-theme="dark"] .aap-alert--warning .aap-alert__icon { color: #fbbf24; }

.aap-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.aap-stat {
	display: flex; flex-direction: column; gap: 6px; padding: 16px;
	background: var(--aap-surface); border: 1px solid var(--aap-border); border-radius: var(--aap-radius);
	box-shadow: var(--aap-shadow); transition: transform .15s, border-color .15s, box-shadow .15s;
}
a.aap-stat:hover { transform: translateY(-2px); border-color: var(--aap-primary-line); box-shadow: var(--aap-shadow-lg); }
.aap-stat__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.aap-stat__label { color: var(--aap-muted); font-size: 12.5px; font-weight: 500; }
.aap-stat__icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--aap-tone-soft); color: var(--aap-tone); }
.aap-stat__value { font-size: 26px; font-weight: 800; line-height: 1.3; }
.aap-stat__value em { font-style: normal; font-size: 12px; color: var(--aap-muted); font-weight: 500; }
.aap-stat__foot { display: flex; align-items: center; gap: 2px; font-size: 11.5px; color: var(--aap-muted); padding-top: 8px; border-top: 1px dashed var(--aap-border); }
a.aap-stat:hover .aap-stat__foot { color: var(--aap-tone); }

.aap-tone--primary { --aap-tone: var(--aap-primary); --aap-tone-soft: var(--aap-primary-soft); }
.aap-tone--success { --aap-tone: var(--aap-success); --aap-tone-soft: color-mix(in srgb, var(--aap-success) 13%, transparent); }
.aap-tone--warning { --aap-tone: #d97706; --aap-tone-soft: color-mix(in srgb, var(--aap-warning) 15%, transparent); }
.aap-tone--danger  { --aap-tone: var(--aap-danger);  --aap-tone-soft: color-mix(in srgb, var(--aap-danger) 11%, transparent); }
.aap-tone--info    { --aap-tone: var(--aap-info);    --aap-tone-soft: color-mix(in srgb, var(--aap-info) 12%, transparent); }

.aap-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.aap-w--full { grid-column: span 6; }
.aap-w--wide { grid-column: span 4; }
.aap-w--half { grid-column: span 3; }
.aap-w--narrow { grid-column: span 2; }
.aap-dash-extra { margin-top: 14px; }

/* list rows (recent orders) */
.aap-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.aap-row {
	display: flex; align-items: center; gap: 12px; padding: 10px 12px;
	border: 1px solid var(--aap-border); border-radius: var(--aap-radius-sm); background: var(--aap-surface-2); transition: .15s;
}
.aap-row:hover { border-color: var(--aap-primary-line); background: var(--aap-surface); }
.aap-row__icon { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--aap-surface); border: 1px solid var(--aap-border); color: var(--aap-muted); }
.aap-row__main { flex: 1; min-width: 0; display: grid; line-height: 1.5; }
.aap-row__main strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aap-row__main strong em { font-style: normal; color: var(--aap-muted); font-weight: 500; font-size: 12px; }
.aap-row__main small { color: var(--aap-muted); font-size: 11.5px; }
.aap-row__end { display: flex; align-items: center; gap: 12px; flex: none; }
.aap-row__end b { font-size: 13px; }

.aap-mini-empty { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px dashed var(--aap-border); border-radius: var(--aap-radius-sm); color: var(--aap-muted); }
.aap-mini-empty > div { flex: 1; display: grid; line-height: 1.6; }
.aap-mini-empty strong { color: var(--aap-text); font-size: 13px; }
.aap-mini-empty span { font-size: 12px; }

.aap-shortcuts { display: grid; gap: 6px; }
.aap-shortcut {
	display: flex; align-items: center; gap: 10px; padding: 9px 10px;
	border-radius: var(--aap-radius-sm); color: var(--aap-text-2); font-weight: 600; font-size: 13px; transition: .15s;
}
.aap-shortcut > span:not(.aap-shortcut__icon) { flex: 1; }
.aap-shortcut__icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--aap-surface-2); border: 1px solid var(--aap-border); color: var(--aap-muted); }
.aap-shortcut > .aap-i { color: var(--aap-muted); }
.aap-shortcut:hover { background: var(--aap-surface-2); color: var(--aap-primary); }
.aap-shortcut:hover .aap-shortcut__icon { color: var(--aap-primary); border-color: var(--aap-primary-line); background: var(--aap-primary-soft); }

/* product cards */
.aap-products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.aap-product {
	display: flex; flex-direction: column; border: 1px solid var(--aap-border); border-radius: var(--aap-radius-sm);
	overflow: hidden; background: var(--aap-surface); transition: .15s;
}
.aap-product:hover { border-color: var(--aap-primary-line); transform: translateY(-2px); box-shadow: var(--aap-shadow-lg); }
.aap-product__img { display: block; aspect-ratio: 16 / 10; background: var(--aap-surface-2); overflow: hidden; }
.aap-product__img img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0 !important; }
.aap-product__body { display: grid; gap: 4px; padding: 10px 12px 12px; }
.aap-product__title { font-size: 13px; font-weight: 700; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.2em; }
.aap-product__price { font-size: 12.5px; font-weight: 800; color: var(--aap-primary); }
.aap-product__price del { color: var(--aap-muted); font-weight: 500; margin-inline-end: 4px; }
.aap-product__price ins { text-decoration: none; }

/* ---------- empty state ---------- */
.aap-emptybox { padding: 0; overflow: hidden; }
.aap-empty { display: grid; justify-items: center; text-align: center; padding: 44px 20px 40px; }
.aap-empty__art {
	position: relative; width: 112px; height: 112px; display: grid; place-items: center; margin-bottom: 18px;
	border-radius: 50%; background: radial-gradient(circle, var(--aap-primary-soft) 0 38%, transparent 39%);
}
.aap-empty__art::before, .aap-empty__art::after { content: ""; position: absolute; border-radius: 50%; border: 1px dashed var(--aap-primary-line); }
.aap-empty__art::before { inset: 10px; }
.aap-empty__art::after { inset: -6px; border-style: solid; border-color: var(--aap-border); }
.aap-empty__icon {
	width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center;
	background: var(--aap-surface); color: var(--aap-primary); border: 1px solid var(--aap-primary-line);
	box-shadow: 0 8px 20px color-mix(in srgb, var(--aap-primary) 18%, transparent); transform: rotate(-6deg);
}
.aap-empty h3 { font-size: 16.5px; font-weight: 800; margin-bottom: 4px; }
.aap-empty p { color: var(--aap-muted); max-width: 420px; margin: 0 0 18px; font-size: 13px; }
.aap-empty__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.aap-suggest { border-top: 1px solid var(--aap-border); background: var(--aap-surface-2); padding: 16px 18px 18px; }
.aap-suggest__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-weight: 800; font-size: 13.5px; }
.aap-suggest__head a { font-size: 12.5px; }

.aap-features {
	list-style: none; margin: 0; padding: 0 18px 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
	max-width: 860px; margin-inline: auto;
}
.aap-features li { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--aap-border); border-radius: var(--aap-radius-sm); background: var(--aap-surface-2); text-align: start; }
.aap-features__icon { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--aap-surface); border: 1px solid var(--aap-border); color: var(--aap-primary); }
.aap-features strong { display: block; font-size: 12.5px; line-height: 1.6; }
.aap-features small { display: block; font-size: 11.5px; color: var(--aap-muted); line-height: 1.6; }

/* ---------- tables ---------- */
.aap-table-wrap { overflow-x: auto; }
.aap-table { width: 100%; border-collapse: collapse; border: 0; margin: 0; }
.aap-table th {
	text-align: start; font-size: 12px; font-weight: 600; color: var(--aap-muted);
	padding: 11px 16px; background: var(--aap-surface-2); border: 0; border-bottom: 1px solid var(--aap-border); white-space: nowrap;
}
.aap-table td { padding: 13px 16px; border: 0; border-bottom: 1px solid var(--aap-border); vertical-align: middle; background: transparent; }
.aap-table tbody tr:last-child td { border-bottom: 0; }
.aap-table tbody tr:hover td { background: var(--aap-surface-2); }
.aap-table__act { text-align: end; white-space: nowrap; }
.aap-table__act .aap-btn + .aap-btn { margin-inline-start: 4px; }
.aap-card--flush .aap-table th:first-child, .aap-card--flush .aap-table td:first-child { padding-inline-start: 18px; }
.aap-card--flush .aap-table th:last-child, .aap-card--flush .aap-table td:last-child { padding-inline-end: 18px; }

.aap-file { display: flex; align-items: center; gap: 10px; }
.aap-file__icon { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--aap-primary-soft); color: var(--aap-primary); }
.aap-file__meta { display: grid; line-height: 1.5; }
.aap-file__meta small { color: var(--aap-muted); font-size: 11.5px; }

.aap-badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.9; white-space: nowrap; }
.aap-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.aap-badge--success { background: color-mix(in srgb, var(--aap-success) 13%, transparent); color: #059669; }
.aap-badge--info    { background: color-mix(in srgb, var(--aap-info) 12%, transparent); color: var(--aap-info); }
.aap-badge--warning { background: color-mix(in srgb, var(--aap-warning) 15%, transparent); color: #b45309; }
.aap-badge--danger  { background: color-mix(in srgb, var(--aap-danger) 11%, transparent); color: #dc2626; }
.aap-badge--muted   { background: var(--aap-surface-2); color: var(--aap-muted); border: 1px solid var(--aap-border); }
[data-aap-theme="dark"] .aap-badge--success { color: #34d399; }
[data-aap-theme="dark"] .aap-badge--warning { color: #fbbf24; }
[data-aap-theme="dark"] .aap-badge--danger { color: #f87171; }

.aap-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }

/* ---------- view order ---------- */
.aap-ordersum {
	display: flex; align-items: center; gap: 0; flex-wrap: wrap;
	background: var(--aap-surface); border: 1px solid var(--aap-border); border-radius: var(--aap-radius); padding: 6px 8px 6px 14px;
}
.aap-ordersum__item { display: grid; gap: 2px; padding: 10px 16px; border-inline-end: 1px solid var(--aap-border); line-height: 1.5; }
.aap-ordersum__item:last-of-type { border-inline-end: 0; }
.aap-ordersum__item small { color: var(--aap-muted); font-size: 11.5px; }
.aap-ordersum__item strong { font-size: 14px; }
.aap-ordersum > .aap-btn { margin-inline-start: auto; }
.aap-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.aap-timeline li { position: relative; padding-inline-start: 20px; }
.aap-timeline li::before { content: ""; position: absolute; inset-inline-start: 0; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--aap-primary); box-shadow: 0 0 0 4px var(--aap-primary-soft); }
.aap-timeline small { color: var(--aap-muted); font-size: 11.5px; }
.aap-timeline p { margin: 0; }

/* ---------- addresses ---------- */
.aap-intro { color: var(--aap-muted); font-size: 13px; }
.aap-addresses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.aap-address address { font-style: normal; line-height: 2; color: var(--aap-text-2); margin: 0; }
.aap-address__empty {
	display: flex; align-items: center; gap: 10px; padding: 16px; border-radius: var(--aap-radius-sm);
	border: 1px dashed var(--aap-border); background: var(--aap-surface-2); color: var(--aap-muted); font-size: 13px;
}

/* =========================================================================
   WooCommerce native markup inside the panel
   ========================================================================= */
.aap-content { min-width: 0; }
.aap-content > * + * { margin-top: 14px; }
.aap-content h2, .aap-content h3 { font-size: 15px; font-weight: 800; margin-bottom: 10px; }

.aap-content > form,
.aap-content .woocommerce-order-details,
.aap-content .woocommerce-customer-details {
	background: var(--aap-surface); border: 1px solid var(--aap-border); border-radius: var(--aap-radius);
	padding: 20px; box-shadow: var(--aap-shadow);
}
.aap-content .woocommerce-customer-details .woocommerce-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.aap-content .woocommerce-customer-details .woocommerce-column { width: auto; float: none; }
.aap-content .woocommerce-customer-details address { font-style: normal; border: 1px solid var(--aap-border); border-radius: var(--aap-radius-sm); padding: 14px; line-height: 2; }

/* fields */
.aap-content label, .aap-field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--aap-text); }
.aap-content .required { color: var(--aap-danger); text-decoration: none; border: 0; }
.aap-content input[type="text"], .aap-content input[type="email"], .aap-content input[type="tel"],
.aap-content input[type="password"], .aap-content input[type="number"], .aap-content input[type="url"],
.aap-content input[type="date"], .aap-content input[type="search"],
.aap-content select, .aap-content textarea,
.aap-field input {
	width: 100%; min-height: 44px; padding: 9px 14px; border-radius: var(--aap-radius-sm);
	border: 1px solid var(--aap-border); background: var(--aap-surface-2); color: var(--aap-text);
	outline: none; transition: border-color .15s, box-shadow .15s, background .15s; line-height: 1.6; box-shadow: none;
}
.aap-content textarea { min-height: 110px; }
.aap-content input:hover, .aap-content select:hover, .aap-content textarea:hover { border-color: color-mix(in srgb, var(--aap-primary) 22%, var(--aap-border)); }
.aap-content input:focus, .aap-content select:focus, .aap-content textarea:focus, .aap-field input:focus {
	border-color: var(--aap-primary); box-shadow: 0 0 0 3px var(--aap-primary-soft); background: var(--aap-surface);
}
.aap-content select {
	appearance: none; -webkit-appearance: none; cursor: pointer; padding-inline-end: 38px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237b8798' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: left 12px center;
}
[dir="ltr"] .aap-content select { background-position: right 12px center; }

/* file input (profile picture field from the theme) */
.aap-content input[type="file"] {
	width: 100%; padding: 8px; border: 1px dashed var(--aap-border); border-radius: var(--aap-radius-sm);
	background: var(--aap-surface-2); color: var(--aap-muted); font-size: 12.5px; cursor: pointer;
}
.aap-content input[type="file"]::file-selector-button {
	margin-inline-end: 10px; padding: 6px 14px; border: 0; border-radius: 8px; cursor: pointer;
	background: var(--aap-primary-soft); color: var(--aap-primary); font-family: inherit; font-weight: 700;
}
.aap-content input[type="file"]:hover { border-color: var(--aap-primary-line); }
.aap-content input[type="checkbox"], .aap-content input[type="radio"] { accent-color: var(--aap-primary); width: 16px; height: 16px; }

/* form rows → grid */
.aap-content .form-row { margin: 0 0 14px; padding: 0; float: none; width: 100%; }
.aap-content .woocommerce-address-fields__field-wrapper,
.aap-content .woocommerce-EditAccountForm {
	display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px;
}
.aap-content .woocommerce-address-fields__field-wrapper > *,
.aap-content .woocommerce-EditAccountForm > * { grid-column: 1 / -1; }
.aap-content .woocommerce-address-fields__field-wrapper > .form-row-first,
.aap-content .woocommerce-address-fields__field-wrapper > .form-row-last,
.aap-content .woocommerce-EditAccountForm > .form-row-first,
.aap-content .woocommerce-EditAccountForm > .form-row-last { grid-column: auto; width: auto; }
.aap-content .woocommerce-EditAccountForm > .clear, .aap-content .woocommerce-address-fields__field-wrapper > .clear { display: none; }
.aap-content .form-row-first, .aap-content .form-row-last { float: none; }
.aap-content fieldset { border: 1px solid var(--aap-border); border-radius: var(--aap-radius); padding: 16px 18px 4px; margin: 6px 0 18px; min-width: 0; }
.aap-content fieldset legend { padding: 0 8px; font-weight: 800; font-size: 14px; }
.aap-content em, .aap-content .description { color: var(--aap-muted); font-size: 12px; font-style: normal; }
.aap-content .password-input { position: relative; display: block; }
.aap-content .show-password-input { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--aap-muted); cursor: pointer; min-height: 0; padding: 4px; box-shadow: none; }
.aap-content .show-password-input:hover { filter: none; color: var(--aap-primary); }

/* select2 / selectWoo (state & country dropdowns) */
.aap-body .select2-hidden-accessible {
	border: 0 !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; height: 1px !important;
	overflow: hidden !important; padding: 0 !important; position: absolute !important; width: 1px !important; white-space: nowrap !important;
}
.aap-body .select2-container { display: inline-block; position: relative; vertical-align: middle; box-sizing: border-box; margin: 0; font-family: var(--aap-font); }
.aap-content .select2-container { width: 100% !important; }
.aap-body > .select2-container { position: absolute; }
.aap-body .select2-container .select2-selection--single {
	display: flex; align-items: center; height: 44px; cursor: pointer; user-select: none;
	border: 1px solid var(--aap-border); border-radius: var(--aap-radius-sm); background: var(--aap-surface-2); outline: none; transition: .15s;
}
.aap-body .select2-container .select2-selection--single:hover { border-color: color-mix(in srgb, var(--aap-primary) 22%, var(--aap-border)); }
.aap-body .select2-container .select2-selection--single .select2-selection__rendered {
	display: block; flex: 1; color: var(--aap-text); line-height: 42px; padding: 0 14px; padding-inline-end: 38px;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start;
}
.aap-body .select2-container .select2-selection__placeholder { color: var(--aap-muted); }
.aap-body .select2-container .select2-selection__clear { display: none; }
.aap-body .select2-container .select2-selection--single .select2-selection__arrow {
	position: absolute; top: 0; bottom: 0; right: 12px; left: auto; width: 16px; height: auto;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237b8798' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / 16px no-repeat;
	transition: transform .15s;
}
[dir="rtl"] .aap-body .select2-container .select2-selection--single .select2-selection__arrow,
.aap-body[dir="rtl"] .select2-container .select2-selection--single .select2-selection__arrow { left: 12px; right: auto; }
.aap-body .select2-container .select2-selection--single .select2-selection__arrow b { display: none; }
.aap-body .select2-container--open .select2-selection--single { border-color: var(--aap-primary); box-shadow: 0 0 0 3px var(--aap-primary-soft); background: var(--aap-surface); }
.aap-body .select2-container--open .select2-selection__arrow { transform: rotate(180deg); }
.aap-body .select2-container--focus .select2-selection--single { border-color: var(--aap-primary); }
.aap-body .select2-dropdown {
	display: block; position: absolute; left: -100000px; z-index: 100051; width: 100%;
	background: var(--aap-surface); border: 1px solid var(--aap-border); border-radius: var(--aap-radius-sm);
	box-shadow: var(--aap-shadow-lg); overflow: hidden; color: var(--aap-text); font-family: var(--aap-font);
}
.aap-body .select2-container--open .select2-dropdown { left: 0; }
.aap-body .select2-container--open .select2-dropdown--below { margin-top: 6px; }
.aap-body .select2-container--open .select2-dropdown--above { margin-top: -6px; }
.aap-body .select2-search--dropdown { display: block; padding: 8px; border-bottom: 1px solid var(--aap-border); }
.aap-body .select2-search--dropdown.select2-search--hide { display: none; }
.aap-body .select2-search--dropdown .select2-search__field {
	width: 100%; min-height: 38px; padding: 6px 12px; border: 1px solid var(--aap-border); border-radius: 8px;
	background: var(--aap-surface-2); color: var(--aap-text); outline: none; font-family: inherit;
}
.aap-body .select2-search--dropdown .select2-search__field:focus { border-color: var(--aap-primary); background: var(--aap-surface); }
.aap-body .select2-results { display: block; }
.aap-body .select2-results__options { list-style: none; margin: 0; padding: 6px; max-height: 260px; overflow-y: auto; }
.aap-body .select2-results__option { padding: 8px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; user-select: none; text-align: start; }
.aap-body .select2-results__option[aria-selected="true"], .aap-body .select2-results__option[data-selected="true"] { background: var(--aap-surface-2); font-weight: 700; }
.aap-body .select2-results__option--highlighted,
.aap-body .select2-results__option--highlighted[aria-selected],
.aap-body .select2-results__option--highlighted[data-selected] { background: var(--aap-primary-soft) !important; color: var(--aap-primary); }
.aap-body .select2-results__message { color: var(--aap-muted); cursor: default; }

/* tables generated by WooCommerce */
.aap-content .shop_table, .aap-content table.woocommerce-table {
	width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--aap-border); border-radius: var(--aap-radius-sm);
	overflow: hidden; background: var(--aap-surface); margin: 0;
}
.aap-content .shop_table th, .aap-content .shop_table td { padding: 12px 16px; border: 0; border-bottom: 1px solid var(--aap-border); text-align: start; background: transparent; }
.aap-content .shop_table thead th { background: var(--aap-surface-2); color: var(--aap-muted); font-size: 12px; font-weight: 600; }
.aap-content .shop_table tfoot th { color: var(--aap-muted); font-weight: 600; }
.aap-content .shop_table tfoot tr:last-child th, .aap-content .shop_table tfoot tr:last-child td { font-weight: 800; color: var(--aap-text); font-size: 15px; }
.aap-content .shop_table tr:last-child td, .aap-content .shop_table tr:last-child th { border-bottom: 0; }
.aap-content .wc-item-meta { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12px; color: var(--aap-muted); }
.aap-content .wc-item-meta p { display: inline; margin: 0; }

/* notices */
.aap-body .woocommerce-message, .aap-body .woocommerce-info, .aap-body .woocommerce-error {
	list-style: none; margin: 0 0 14px; padding: 12px 16px; border-radius: var(--aap-radius-sm);
	border: 1px solid var(--aap-border); border-inline-start: 4px solid var(--aap-info); background: var(--aap-surface);
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--aap-text); font-size: 13px;
}
.aap-body .woocommerce-message { border-inline-start-color: var(--aap-success); }
.aap-body .woocommerce-error { border-inline-start-color: var(--aap-danger); flex-direction: column; align-items: flex-start; }
.aap-body .woocommerce-info { border-inline-start-color: var(--aap-warning); }
.aap-body .woocommerce-message::before, .aap-body .woocommerce-info::before, .aap-body .woocommerce-error::before { display: none; }
.aap-body .woocommerce-message .button, .aap-body .woocommerce-info .button { margin-inline-start: auto; order: 2; }
.aap-body .woocommerce-notices-wrapper:empty { display: none; }
.aap-body .woocommerce-notices-wrapper { margin-bottom: 14px; }

.aap-content mark { background: var(--aap-primary-soft); color: var(--aap-primary); padding: 1px 8px; border-radius: 6px; font-weight: 700; }

/* theme / plugin tabs rendered inside a card */
.aap-ext { overflow: hidden; }
.aap-ext > :first-child { margin-top: 0; }
.aap-ext > :last-child { margin-bottom: 0; }

/* ---------- auth ---------- */
.aap-auth {
	min-height: 100vh; display: flex; flex-direction: column; padding: 20px;
	background: radial-gradient(80% 60% at 50% 0%, var(--aap-primary-soft), transparent 70%), var(--aap-bg);
}
.aap-auth__top { display: flex; align-items: center; justify-content: space-between; max-width: 960px; width: 100%; margin: 0 auto; }
.aap-auth__body { flex: 1; display: grid; place-items: center; padding: 24px 0; }
.aap-auth__back { align-self: center; color: var(--aap-muted); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.aap-auth__back:hover { color: var(--aap-primary); }
.aap-authcard {
	width: 100%; max-width: 420px; background: var(--aap-surface); border: 1px solid var(--aap-border);
	border-radius: 18px; padding: 26px; box-shadow: var(--aap-shadow-lg);
}
.aap-authcard__title { font-size: 18px; font-weight: 800; margin-bottom: 16px; }
.aap-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 20px; background: var(--aap-surface-2); border: 1px solid var(--aap-border); border-radius: 12px; }
.aap-tabs__btn { border: 0; background: transparent; padding: 8px; border-radius: 9px; font-weight: 700; color: var(--aap-muted); cursor: pointer; }
.aap-tabs__btn.is-active { background: var(--aap-primary); color: var(--aap-primary-ink); }
.aap-pane { display: none; }
.aap-pane.is-active { display: block; }
.aap-field { margin: 0 0 14px; }
.aap-authrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; font-size: 13px; padding: 0; border: 0; background: none; }
.aap-check { display: inline-flex !important; align-items: center; gap: 8px; margin: 0 !important; font-weight: 500 !important; cursor: pointer; }
.aap-check input { width: 16px; height: 16px; accent-color: var(--aap-primary); }
.aap-note { color: var(--aap-muted); font-size: 12.5px; }
.aap-authcard form { background: none; border: 0; padding: 0; box-shadow: none; }

/* ---------- embedded mode (inside the theme layout) ---------- */
.aap-app--embedded { display: flex; min-height: 0; gap: 24px; align-items: flex-start; font-family: var(--aap-font); color: var(--aap-text); }
.aap-app--embedded .aap-embed-nav { width: 240px; flex: none; background: var(--aap-surface); border: 1px solid var(--aap-border); border-radius: var(--aap-radius); padding: 12px; }
.aap-app--embedded .aap-embed-main { flex: 1; min-width: 0; }
.aap-embed-title { font-size: 20px; font-weight: 800; margin: 0 0 14px; }
.aap-app--embedded .aap-nav__link.is-active::before { display: none; }

/* =========================================================================
   v2 modules
   ========================================================================= */

/* nav badge & bell */
.aap-nav__badge {
	margin-inline-start: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
	display: inline-grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800; line-height: 1;
	background: var(--aap-danger); color: #fff;
}
.aap-iconbtn { position: relative; }
.aap-bell__count {
	position: absolute; top: -6px; inset-inline-end: -6px; min-width: 18px; height: 18px; padding: 0 4px;
	border-radius: 999px; background: var(--aap-danger); color: #fff; font-style: normal; font-size: 10.5px; font-weight: 800;
	display: grid; place-items: center; line-height: 1; box-shadow: 0 0 0 2px var(--aap-surface);
}

/* shared bits */
.aap-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.aap-linkbtn { background: none !important; border: 0 !important; padding: 0 !important; margin: 0; min-height: 0 !important; color: var(--aap-primary) !important; font-weight: 700; cursor: pointer; font-size: inherit; box-shadow: none !important; }
.aap-linkbtn:hover { text-decoration: underline; }
.aap-listhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--aap-border); }
.aap-listempty { color: var(--aap-muted); padding: 28px 18px; text-align: center; margin: 0; }
.aap-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--aap-surface-2); border: 1px solid var(--aap-border); }
.aap-seg a { padding: 4px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--aap-muted); }
.aap-seg a.is-active { background: var(--aap-primary); color: #fff; }
.aap-seg a:not(.is-active):hover { color: var(--aap-text); }
.aap-rows--flush { padding: 10px; }
.aap-row.is-highlight { border-color: color-mix(in srgb, var(--aap-success) 40%, transparent); background: color-mix(in srgb, var(--aap-success) 6%, var(--aap-surface)); }
.aap-btn.is-busy, .aap-btn:disabled { opacity: .65; cursor: progress; }
.aap-btn.is-busy::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-inline-end-color: transparent; animation: aap-spin .7s linear infinite; }
@keyframes aap-spin { to { transform: rotate(360deg); } }
.aap-stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* auth (mobile + code) */
.aap-authcard__head { text-align: center; margin-bottom: 18px; }
.aap-authcard__icon { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 16px; display: grid; place-items: center; background: var(--aap-primary-soft); color: var(--aap-primary); }
.aap-authcard__head .aap-authcard__title { margin-bottom: 4px; }
.aap-authcard__sub { color: var(--aap-muted); font-size: 12.5px; margin: 0; }
.aap-otp__step { display: none; }
.aap-otp__step.is-active { display: block; animation: aap-in .2s ease; }
@keyframes aap-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.aap-otp__info { font-size: 13px; color: var(--aap-text-2); background: var(--aap-surface-2); border: 1px solid var(--aap-border); border-radius: var(--aap-radius-sm); padding: 10px 12px; margin: 0 0 14px; }
.aap-otp__code { text-align: center; font-size: 24px !important; letter-spacing: .45em; font-weight: 800; font-variant-numeric: tabular-nums; padding-inline: 10px !important; }
.aap-otp__resend { text-align: center; color: var(--aap-muted); font-size: 12.5px; margin: 12px 0 0; min-height: 22px; }
.aap-formmsg { margin: 0 0 14px; padding: 10px 12px; border-radius: var(--aap-radius-sm); font-size: 13px; border: 1px solid color-mix(in srgb, var(--aap-danger) 30%, transparent); background: color-mix(in srgb, var(--aap-danger) 8%, var(--aap-surface)); color: #b91c1c; }
.aap-formmsg.is-ok { border-color: color-mix(in srgb, var(--aap-success) 30%, transparent); background: color-mix(in srgb, var(--aap-success) 8%, var(--aap-surface)); color: #047857; }
[data-aap-theme="dark"] .aap-formmsg { color: #fca5a5; }
[data-aap-theme="dark"] .aap-formmsg.is-ok { color: #6ee7b7; }
.aap-authcard input[type=tel], .aap-authcard input[type=text], .aap-authcard input[type=password], .aap-authcard input[type=email] {
	width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--aap-radius-sm); border: 1px solid var(--aap-border);
	background: var(--aap-surface-2); color: var(--aap-text); outline: none; font-size: 15px;
}
.aap-authcard input:focus { border-color: var(--aap-primary); box-shadow: 0 0 0 3px var(--aap-primary-soft); background: var(--aap-surface); }

/* notifications */
.aap-notes { list-style: none; margin: 0; padding: 6px; }
.aap-note { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: var(--aap-radius-sm); transition: background .15s; }
a.aap-note:hover { background: var(--aap-surface-2); }
.aap-note.is-new { background: color-mix(in srgb, var(--aap-primary) 5%, transparent); }
.aap-notes li + li .aap-note { border-top: 1px solid var(--aap-border); border-radius: 0; }
.aap-note__icon { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--aap-primary-soft); color: var(--aap-primary); }
.aap-note__icon--order { background: color-mix(in srgb, var(--aap-success) 13%, transparent); color: var(--aap-success); }
.aap-note__icon--ticket { background: color-mix(in srgb, var(--aap-info) 12%, transparent); color: var(--aap-info); }
.aap-note__icon--referral { background: color-mix(in srgb, var(--aap-warning) 15%, transparent); color: #d97706; }
.aap-note__body { flex: 1; min-width: 0; display: grid; gap: 2px; line-height: 1.7; }
.aap-note__top { display: flex; align-items: center; gap: 8px; }
.aap-note__top strong { font-size: 13.5px; color: var(--aap-text); }
.aap-note { color: var(--aap-text); }
.aap-note__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--aap-primary); flex: none; }
.aap-note__text { color: var(--aap-text-2); font-size: 13px; }
.aap-note small { color: var(--aap-muted); font-size: 11.5px; }
.aap-note__go { color: var(--aap-muted); align-self: center; }

/* tickets */
.aap-ticket-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.aap-ticket-head__main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.aap-ticket-head__main h3 { font-size: 15px; font-weight: 800; }
.aap-ticket-head__main p { margin: 0; color: var(--aap-muted); font-size: 12px; }
.aap-ticket-head__side { display: flex; align-items: center; gap: 10px; }
.aap-ticket-head__side form { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.aap-chat { display: grid; gap: 12px; margin-bottom: 14px; background: var(--aap-surface-2); }
.aap-bubble { max-width: min(78%, 620px); padding: 12px 14px; border-radius: 14px; border: 1px solid var(--aap-border); background: var(--aap-surface); }
.aap-bubble--me { justify-self: start; border-start-start-radius: 4px; }
.aap-bubble--staff { justify-self: end; border-start-end-radius: 4px; background: color-mix(in srgb, var(--aap-primary) 7%, var(--aap-surface)); border-color: var(--aap-primary-line); }
.aap-bubble__meta { display: flex; justify-content: space-between; gap: 12px; font-size: 11.5px; color: var(--aap-muted); margin-bottom: 4px; }
.aap-bubble__meta strong { color: var(--aap-text); font-size: 12.5px; }
.aap-bubble__text { font-size: 13.5px; line-height: 1.9; overflow-wrap: anywhere; }
.aap-bubble__file { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--aap-primary); }
.aap-replybox textarea, .aap-ticketform textarea { resize: vertical; }
.aap-replybox__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.aap-note-inline { font-size: 12.5px; color: var(--aap-muted); background: var(--aap-surface-2); border-radius: 8px; padding: 8px 12px; }
.aap-file-input { display: flex !important; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 !important; font-weight: 500 !important; cursor: pointer; }
.aap-file-input input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.aap-file-input__btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; border: 1px dashed var(--aap-primary-line); background: var(--aap-primary-soft); color: var(--aap-primary); font-size: 12.5px; font-weight: 700; }
.aap-file-input__name { font-size: 12.5px; color: var(--aap-text-2); }
.aap-file-input small { width: 100%; color: var(--aap-muted); font-size: 11px; }
.aap-file-input:focus-within .aap-file-input__btn { outline: 2px solid var(--aap-primary); outline-offset: 2px; }

/* referral */
.aap-ref-hero { display: grid; gap: 16px; margin-bottom: 14px; background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--aap-warning) 10%, transparent) 0%, transparent 55%), var(--aap-surface); }
.aap-ref-hero__text { display: flex; gap: 12px; align-items: flex-start; }
.aap-ref-hero__text .aap-card__icon { background: color-mix(in srgb, var(--aap-warning) 15%, transparent); color: #d97706; }
.aap-ref-hero h3 { font-size: 16px; font-weight: 800; margin-bottom: 2px; }
.aap-ref-hero p { margin: 0; color: var(--aap-muted); font-size: 13px; }
.aap-ref-link { display: grid; gap: 6px; margin: 0; }
.aap-ref-link__label { font-size: 12px; color: var(--aap-muted); font-weight: 600; }
.aap-ref-link__box { display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid var(--aap-border); border-radius: var(--aap-radius-sm); background: var(--aap-surface-2); }
.aap-ref-link__box input { flex: 1; min-width: 0; border: 0 !important; background: none !important; box-shadow: none !important; padding: 4px 8px !important; min-height: 0 !important; font-size: 13px; color: var(--aap-text); outline: none; }
.aap-ref-share { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.aap-ref-share > span { margin-inline-end: auto; font-size: 12.5px; color: var(--aap-muted); }
.aap-ref-share code { font-weight: 800; color: var(--aap-text); background: var(--aap-surface-2); border: 1px solid var(--aap-border); padding: 1px 8px; border-radius: 6px; }
.aap-btn.is-copied { background: var(--aap-success) !important; color: #fff !important; border-color: transparent !important; }
.aap-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 16px; }
.aap-steps > div { display: grid; gap: 2px; padding: 14px; border-radius: var(--aap-radius-sm); background: var(--aap-surface-2); border: 1px solid var(--aap-border); }
.aap-steps b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--aap-primary); color: #fff; font-size: 13px; margin-bottom: 6px; }
.aap-steps strong { font-size: 13px; }
.aap-steps span { font-size: 12px; color: var(--aap-muted); }
.aap-table code { font-weight: 700; background: var(--aap-surface-2); border: 1px solid var(--aap-border); padding: 1px 8px; border-radius: 6px; }

@media (max-width: 760px) {
	.aap-row2, .aap-steps, .aap-stats--3 { grid-template-columns: 1fr; }
	.aap-bubble { max-width: 92%; }
	.aap-replybox__foot .aap-btn { width: 100%; }
}

/* ---------- guard against theme styles ----------
   On theme tabs (wishlist, courses, notifications) the theme stylesheet stays
   loaded and restyles generic elements like <button>. Lock the panel controls. */
.aap-body button.aap-iconbtn {
	width: 36px !important; height: 36px !important; min-width: 0 !important; min-height: 0 !important;
	padding: 0 !important; margin: 0 !important; display: inline-flex !important; align-items: center; justify-content: center;
	border: 1px solid var(--aap-border) !important; border-radius: var(--aap-radius-sm) !important;
	background: var(--aap-surface) !important; color: var(--aap-muted) !important;
	box-shadow: none !important; outline: 0; line-height: 1 !important; font-size: inherit !important; text-transform: none !important; transform: none;
}
.aap-body button.aap-iconbtn:hover { color: var(--aap-primary) !important; border-color: var(--aap-primary-line) !important; background: var(--aap-primary-soft) !important; }
.aap-body button.aap-iconbtn.aap-burger { display: none !important; }
.aap-body button.aap-iconbtn .aap-i { width: 18px; height: 18px; }
.aap-body .aap-sidebar a, .aap-body .aap-topbar a, .aap-body .aap-pagehead a { text-decoration: none !important; }
.aap-body .aap-nav__link { color: var(--aap-text-2) !important; }
.aap-body .aap-nav__link:hover { color: var(--aap-text) !important; }
.aap-body .aap-nav__link.is-active { color: var(--aap-primary) !important; }
.aap-body .aap-nav__link--logout:hover { color: var(--aap-danger) !important; }
.aap-body .aap-nav__list, .aap-body .aap-nav__list li { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.aap-body .aap-nav__list li::before, .aap-body .aap-nav__list li::marker { content: none !important; }
.aap-body .aap-sidebar, .aap-body .aap-topbar { line-height: 1.8 !important; font-size: 14px; font-family: var(--aap-font); }
.aap-body .aap-nav__link {
	display: flex !important; align-items: center; gap: 10px; margin: 0 !important; padding: 9px 12px !important;
	min-height: 0 !important; height: auto !important; line-height: 1.6 !important; font-size: 13.5px !important;
	border: 0 !important; box-shadow: none !important; background-color: transparent;
}
.aap-body .aap-nav__link:hover { background-color: var(--aap-surface-2); }
.aap-body .aap-nav__link.is-active { background-color: var(--aap-primary-soft); }
.aap-body .aap-nav__link span { margin: 0 !important; padding: 0 !important; line-height: inherit !important; }
.aap-body .aap-nav__list { display: grid !important; gap: 2px !important; }
.aap-body .aap-nav__title { margin: 0 !important; padding: 0 12px 6px !important; line-height: 1.6 !important; font-size: 11px !important; }
.aap-body .aap-nav__group { margin: 0 !important; }
.aap-body .aap-nav__group + .aap-nav__group { margin-top: 12px !important; padding-top: 12px !important; }
.aap-body .aap-sidebar .aap-nav { padding: 12px 10px !important; margin: 0 !important; }
.aap-body .aap-sidebar__user { padding: 16px !important; margin: 0 !important; }
.aap-body .aap-sidebar__foot { padding: 8px 10px 10px !important; margin: 0 !important; }
.aap-body .aap-pagehead h1, .aap-body .aap-card h3, .aap-body .aap-empty h3 { font-family: var(--aap-font); color: var(--aap-text); }
@media (max-width: 1023px) {
	.aap-body button.aap-iconbtn.aap-burger { display: inline-flex !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
	.aap-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.aap-products > :nth-child(4) { display: none; }
}
@media (max-width: 1100px) {
	.aap-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.aap-w--wide, .aap-w--narrow, .aap-w--half { grid-column: span 6; }
}
@media (max-width: 1023px) {
	.aap-layout { grid-template-columns: minmax(0, 1fr); padding: 16px; }
	.aap-sidebar {
		position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(300px, 86vw); max-height: none; z-index: 60;
		border-radius: 0; border-block: 0; border-inline-start: 0; transform: translateX(105%);
		transition: transform .22s ease; box-shadow: var(--aap-shadow-lg);
	}
	[dir="ltr"] .aap-sidebar { transform: translateX(-105%); }
	.aap-sidebar.is-open { transform: none !important; }
	.aap-scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 55; }
	.aap-iconbtn.aap-burger { display: inline-flex; }
	.aap-hide-md { display: none !important; }
	.aap-app--embedded { flex-direction: column; }
	.aap-app--embedded .aap-embed-nav { width: 100%; }
}
@media (max-width: 760px) {
	.aap-layout { padding: 14px 12px; }
	.aap-pagehead__actions { width: 100%; }
	.aap-pagehead__actions .aap-btn { flex: 1; }
	.aap-topbar__inner { padding: 0 12px; }
	.aap-hide-sm { display: none !important; }
	.aap-hero { padding: 16px; }
	.aap-hero__profile { width: 100%; }
	.aap-addresses, .aap-content .woocommerce-customer-details .woocommerce-columns { grid-template-columns: 1fr; }
	.aap-content .woocommerce-address-fields__field-wrapper, .aap-content .woocommerce-EditAccountForm { grid-template-columns: 1fr; }
	.aap-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.aap-products > :nth-child(4) { display: flex; }
	.aap-row__end b { display: none; }
	.aap-features { grid-template-columns: 1fr; }
	.aap-ordersum__item { flex: 1 1 45%; border-inline-end: 0; }
	.aap-ordersum > .aap-btn { width: 100%; margin: 6px 0; }

	/* tables become cards */
	.aap-table--stack thead { display: none; }
	.aap-table--stack, .aap-table--stack tbody, .aap-table--stack tr, .aap-table--stack td { display: block; width: 100%; }
	.aap-table--stack tr { padding: 10px 14px; border-bottom: 1px solid var(--aap-border); }
	.aap-table--stack tr:last-child { border-bottom: 0; }
	.aap-table--stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0 !important; border: 0; }
	.aap-table--stack td[data-label]::before { content: attr(data-label); color: var(--aap-muted); font-size: 12px; flex: none; }
	.aap-table--stack .aap-table__act { justify-content: flex-end; padding-top: 10px !important; }
	.aap-table--stack tbody tr:hover td { background: transparent; }
}
@media (max-width: 420px) {
	.aap-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
	.aap-stat { padding: 12px; }
	.aap-stat__value { font-size: 22px; }
	.aap-stat__foot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.aap-body * { transition: none !important; }
}
