/*
 * App-shell chrome: the persistent sidebar + topbar that wrap every plugin
 * page once App_Shell takes over the template (see class-app-shell.php).
 * Relies on the same design tokens as tokens.css (loaded first) — this file
 * only adds shell-specific layout, it doesn't redefine any --ar-* variable.
 */

html { background: var(--ar-color-bg, #f5f6f8); }

body.arvan-reseller-app {
	margin: 0;
	min-height: 100vh;
}

.ar-shell {
	display: flex;
	min-height: 100vh;
	background: var(--ar-color-bg);
}

/* Sidebar */
.ar-sidebar {
	width: 264px;
	flex: 0 0 264px;
	background: var(--ar-color-surface);
	border-inline-end: 1px solid var(--ar-color-border);
	display: flex;
	flex-direction: column;
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
	z-index: 30;
}


.ar-sidebar-logo {
	display: flex;
	align-items: center;
	height: 64px;
	padding: 0 20px;
	flex: 0 0 auto;
	border-block-end: 1px solid var(--ar-color-border);
	color: #333333;
	text-decoration: none;
	transition: opacity .15s ease;
}
.arvan-reseller-app .ar-sidebar-logo,
.arvan-reseller-app .ar-sidebar-logo:link,
.arvan-reseller-app .ar-sidebar-logo:visited,
.arvan-reseller-app .ar-sidebar-logo:hover,
.arvan-reseller-app .ar-sidebar-logo:focus,
.arvan-reseller-app .ar-sidebar-logo:active { color: #333333 !important; }
.ar-sidebar-logo:hover { opacity: .75; }
.ar-sidebar-logo .ar-logo-svg { width: 132px; height: auto; display: block; }
.ar-sidebar-logo-img { max-height: 24px; max-width: 100%; width: auto; display: block; }
.ar-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

.ar-sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px 16px; }
.ar-sidebar-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 14px;
	border-radius: var(--ar-radius-sm);
	color: #333333;
	text-decoration: none;
	font-weight: var(--ar-weight-emphasis);
	font-size: 14px;
	transition: background-color .15s ease, color .15s ease;
}
/* The sidebar sits inside whatever theme the store runs, and themes style
   their own anchors freely — so the one dark ink is forced here rather than
   left to lose a specificity race on someone else's site. */
.arvan-reseller-app .ar-sidebar-link,
.arvan-reseller-app .ar-sidebar-link:link,
.arvan-reseller-app .ar-sidebar-link:visited,
.arvan-reseller-app .ar-sidebar-link:hover,
.arvan-reseller-app .ar-sidebar-link:focus,
.arvan-reseller-app .ar-sidebar-link:active,
.arvan-reseller-app .ar-sidebar-link.is-active,
.arvan-reseller-app .ar-sidebar-link.is-active:visited,
.arvan-reseller-app .ar-sidebar-link.is-active:hover { color: #333333 !important; }
.ar-sidebar-link:hover { background: var(--ar-color-surface-tertiary); }
.arvan-reseller-app .ar-sidebar-link.is-active { background: var(--ar-color-brand-tint); }
/* Line icons follow the label; the multi-color product marks keep their fills. */
.ar-sidebar-link-icon { display: flex; color: #333333; flex: 0 0 auto; }
.ar-sidebar-link-icon .ar-icon-cloud-server { width: 20px; height: 20px; }
.ar-sidebar-link-label { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ar-sidebar-backdrop { display: none; }

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

.ar-topbar {
	position: sticky;
	top: 0;
	z-index: 20;
	background: var(--ar-color-surface);
	border-bottom: 1px solid var(--ar-color-border);
	padding: 14px 28px;
	display: flex;
	align-items: center;
	gap: 16px;
}
.ar-topbar-title { font-size: 18px; font-weight: 800; margin: 0; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.ar-topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ar-sidebar-toggle-btn { display: none; }
.ar-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 32px;
	padding-inline: 12px;
	border: 1px solid var(--ar-color-border);
	border-radius: var(--ar-radius-sm);
	background: var(--ar-color-surface);
	color: #333333;
	font-size: 13px;
	font-weight: var(--ar-weight-emphasis);
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .15s ease, border-color .15s ease;
}
.arvan-reseller-app a.ar-chip,
.arvan-reseller-app a.ar-chip:visited,
.arvan-reseller-app a.ar-chip:hover,
.arvan-reseller-app a.ar-chip:active { color: #333333; }
a.ar-chip:hover { background: var(--ar-color-surface-tertiary); border-color: var(--ar-color-border-strong, var(--ar-color-border)); }
.ar-chip-icon { display: flex; align-items: center; flex: 0 0 auto; }
.ar-chip-badge { margin-inline-start: 4px; }
.ar-chip-icon-only { padding-inline: 10px; }

.ar-content-alert { margin: 20px 28px 0; }
.ar-content { padding: 28px; max-width: 1200px; width: 100%; margin-inline: auto; }


/* Dashboard widgets — ArSection/c-widgetBox. A widget is a titled surface
   whose body holds tertiary cards; the header carries the title and any
   widget-level action, and never a border of its own. */
.ar-widget {
	margin-block: 0 20px;
	background: var(--ar-color-surface);
	border: 1px solid var(--ar-color-st-hairline);
	border-radius: var(--ar-radius-md);
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.ar-widget-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; }
.ar-widget-body .ar-btn { margin-top: auto; }

/* ArCard --tertiary: the flat, borderless tile a widget stacks in its body. */
.ar-card { border-radius: var(--ar-radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ar-card--tertiary { background: var(--ar-color-surface-tertiary); }
.ar-card-label { font-size: 13px; color: var(--ar-color-fg-subtle); }
.ar-card-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ar-card-note { font-size: 12px; color: var(--ar-color-fg-disabled); }

/* The wallet segment stacks its cards, then pins the top-up action last. */
.ar-wallet-segment { display: flex; flex-direction: column; gap: 12px; }
.ar-wallet-button { width: 100%; }

/* The widget already carries its own bottom gap, so the section that follows
   it on the dashboard does not add a second one on top. */
.ar-widget + .ar-section { margin-block-start: 0; }

/* HostPrice: a tabular figure followed by its unit, never wrapping apart. */
.ar-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ar-price-value { font-size: 18px; line-height: 26px; font-weight: var(--ar-weight-emphasis); color: var(--ar-color-fg-strong); font-variant-numeric: tabular-nums; }
.ar-price-value.is-negative { color: var(--ar-color-danger-500); }
.ar-price-currency { font-size: 12px; color: var(--ar-color-fg-subtle); }

/* ArState: illustration, copy, then a single call to action. */
.ar-state {
	background: var(--ar-color-surface);
	border: 1px solid var(--ar-color-st-hairline);
	border-radius: var(--ar-radius-md);
	padding: 24px 20px 32px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	text-align: center;
}
.ar-state-art { width: 168px; max-width: 100%; height: auto; display: block; }
.ar-state-content { display: flex; flex-direction: column; gap: 6px; max-width: 380px; }
.ar-state-title { font-size: 16px; font-weight: var(--ar-weight-emphasis); color: var(--ar-color-fg-strong); margin: 0; }
.ar-state-desc { font-size: 13px; color: var(--ar-color-fg-subtle); margin: 0; }

/* Notifications / wallet dropdown menus — these get portaled to <body> on
   open (see public.js), so they're styled by their own class directly
   instead of a descendant selector (which would stop matching once moved). */
.ar-notifications-menu { min-width: 300px; max-width: 340px; max-height: 360px; overflow-y: auto; padding: 0; }
.ar-notification-item { padding: 12px 14px; border-bottom: 1px solid var(--ar-color-border); }
.ar-notification-item:last-child { border-bottom: none; }
.ar-notification-item-title { font-weight: 700; font-size: 13px; }
.ar-notification-item-body { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; }
.ar-notification-item-date { font-size: 11px; margin-top: 2px; }
.ar-notification-empty { padding: 18px; text-align: center; font-size: 13px; }

.ar-wallet-menu { min-width: 220px; }
.ar-wallet-menu-title { font-size: 12px; color: var(--ar-color-text-muted); padding: 4px 8px 8px; }
.ar-chip.is-negative { color: var(--ar-color-danger-500); border-color: var(--ar-color-danger-100); background: var(--ar-color-danger-100); }

/* Minimal (sidebar-less) shell — dashboard's own login/register + KYC states */
.ar-shell-minimal { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--ar-color-bg); }
.ar-shell-minimal-inner { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 20px; }
.ar-shell-minimal:has(.ar-auth) { padding: 0; align-items: stretch; }
.ar-shell-minimal-inner:has(.ar-auth) { max-width: none; gap: 0; }

.ar-auth { display: flex; min-height: 100vh; background: var(--ar-color-surface); }
.ar-auth-main { flex: 0 0 58%; display: flex; flex-direction: column; min-width: 0; }
.ar-auth-header { padding: 32px 40px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ar-auth-logo { font-size: 16px; font-weight: var(--ar-weight-emphasis); color: var(--ar-color-fg-strong); }
.ar-auth-body { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 24px 40px; }
.ar-auth-form { width: 100%; max-width: 384px; }
.ar-auth-title { font-size: 24px; line-height: 32px; font-weight: var(--ar-weight-emphasis); color: var(--ar-color-fg-strong); margin: 0 0 8px; }
.ar-auth-subtitle { color: var(--ar-color-fg-subtle); margin: 0 0 32px; }
.ar-auth-footer { padding: 32px 40px; color: var(--ar-color-fg-subtle); }
.ar-auth-side { flex: 0 0 42%; display: flex; align-items: center; padding: 64px 48px; background: linear-gradient(135deg, var(--ar-color-brand-700), var(--ar-color-brand-500)); color: var(--ar-color-fg-inverse); }
.ar-auth-side-title { font-size: 28px; line-height: 40px; font-weight: var(--ar-weight-emphasis); margin: 0 0 16px; }
.ar-auth-side-text { margin: 0; line-height: 2; opacity: .9; }

@media (max-width: 900px) {
	.ar-auth-side { display: none; }
	.ar-auth-main { flex: 1 1 100%; }
	.ar-auth-header, .ar-auth-footer { padding: 24px; }
	.ar-auth-body { padding: 16px 24px; }
}

/* Admin-bar offset (WP core's own breakpoint for the toolbar is 782px) */
body.admin-bar .ar-sidebar { top: 32px; height: calc(100vh - 32px); }
body.admin-bar .ar-topbar { top: 32px; }
@media (max-width: 782px) {
	body.admin-bar .ar-sidebar { top: 46px; height: calc(100vh - 46px); }
	body.admin-bar .ar-topbar { top: 46px; }
}

@media (max-width: 900px) {
	.ar-sidebar-toggle-btn { display: inline-flex; }

	.ar-sidebar {
		position: fixed;
		inset-inline-start: 0;
		top: 0;
		height: 100vh;
		transform: translateX(100%);
		transition: transform .25s ease;
		box-shadow: var(--ar-shadow-lg);
	}
	.ar-shell.ar-sidebar-open .ar-sidebar { transform: translateX(0); }

	.ar-sidebar-backdrop {
		display: none;
		position: fixed;
		inset: 0;
		background: rgba(10, 10, 14, .45);
		z-index: 29;
	}
	.ar-shell.ar-sidebar-open .ar-sidebar-backdrop { display: block; }

	.ar-topbar { padding: 12px 16px; }
	.ar-content { padding: 16px; }
	.ar-content-alert { margin: 16px 16px 0; }
	.ar-topbar-title { font-size: 16px; }
	.ar-chip-label-desktop { display: none; }
	.ar-topbar-buy-label { display: none; }
}

@media (max-width: 480px) {
	.ar-topbar-buy { padding-inline: 10px; }
}
