/**
 * Dynamix Portal — App shell layout  v0.3.15
 */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* Scoped reset — no global Divi/WordPress pollution */
body.dx-portal-page .dx-shell,
body.dx-portal-page .dx-shell *,
body.dx-portal-page .dx-shell *::before,
body.dx-portal-page .dx-shell *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.dx-portal {
	background:  var(--dx-bg);
	color:       var(--dx-text);
	font-family: var(--dx-font-body);
	font-size:   var(--dx-fs-base);
	line-height: 1.6;
	min-height:  100vh;
}

/* ── Theme override: Divi (and any other theme) isolation ──────────────────
   body.dx-portal-page is added by the plugin on all configured portal pages.
   The portal renders as a fixed full-screen overlay so Divi chrome is hidden.
─────────────────────────────────────────────────────────────────────────── */

body.dx-portal-page {
	overflow: hidden !important;
	background: var(--dx-bg) !important;
}

/* Hide Divi chrome */
body.dx-portal-page #main-header,
body.dx-portal-page .et-l--header,
body.dx-portal-page #main-footer,
body.dx-portal-page .et-l--footer,
body.dx-portal-page #et-secondary-nav,
body.dx-portal-page .et_pb_section:not(.dx-portal-section),
body.dx-portal-page .et_pb_row:not(.dx-portal-row) {
	display: none !important;
}

/* Portal shell / login become fixed fullscreen layer */
body.dx-portal-page .dx-shell,
body.dx-portal-page .dx-login-page,
body.dx-portal-page .dx-portal {
	position:   fixed !important;
	top:        0     !important;
	left:       0     !important;
	width:      100vw !important;
	height:     100vh !important;
	z-index:    99999 !important;
	overflow:   hidden !important;   /* shell itself does NOT scroll */
	background: var(--dx-bg) !important;
	color:      var(--dx-text) !important;
	font-family: var(--dx-font-body) !important;
	font-size:   var(--dx-fs-base) !important;
	line-height: 1.6 !important;
}

/* Login page is a special case — it must scroll if content overflows */
body.dx-portal-page .dx-login-page {
	overflow-y: auto !important;
	align-items: center !important;
}

/* ── Force typography inside the portal shell (beat Divi h1–h6 specificity) */

.dx-shell h1,
.dx-shell h2,
.dx-shell h3,
.dx-shell h4,
.dx-shell h5,
.dx-shell h6 {
	color:       var(--dx-text) !important;
	font-family: var(--dx-font-display) !important;
	line-height: 1.3 !important;
}

.dx-shell p,
.dx-shell span,
.dx-shell li,
.dx-shell td,
.dx-shell th,
.dx-shell label,
.dx-shell a {
	font-family: inherit !important;
}

.dx-shell a {
	color: inherit !important;
	text-decoration: none !important;
}

.dx-shell * {
	box-sizing: border-box !important;
}

/* ── Shell layout ─────────────────────────────────────────────────────────── */

.dx-shell {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	grid-template-rows: 60px minmax(0, 1fr);
	grid-template-areas:
		"sidebar topbar"
		"sidebar main";
	height: 100vh;
	overflow: hidden;
}

/* Authoritative layout under portal page — beats Divi/theme column rules */
body.dx-portal-page .dx-shell {
	display:               grid !important;
	grid-template-columns: 260px minmax(0, 1fr) !important;
	grid-template-rows:    60px minmax(0, 1fr) !important;
	grid-template-areas:   "sidebar topbar" "sidebar main" !important;
	position:              fixed !important;
	inset:                 0 !important;
	width:                 100vw !important;
	max-width:             100vw !important;
	min-width:             0 !important;
	height:                100vh !important;
	height:                100dvh !important;
	max-height:            100dvh !important;
	margin:                0 !important;
	padding:               0 !important;
	overflow:              hidden !important;
	background:            var(--dx-bg) !important;
	color:                 var(--dx-text) !important;
}

@media (max-width: 768px) {
	.dx-shell,
	body.dx-portal-page .dx-shell {
		grid-template-columns: minmax(0, 1fr) !important;
		grid-template-rows:    60px minmax(0, 1fr) !important;
		grid-template-areas:   "topbar" "main" !important;
	}
}

/* ── Topbar ───────────────────────────────────────────────────────────────── */

.dx-topbar {
	grid-area:       topbar !important;
	background:      var(--dx-surface) !important;
	border-bottom:   1px solid var(--dx-border) !important;
	display:         flex !important;
	align-items:     center !important;
	justify-content: space-between !important;
	padding:         0 var(--dx-space-6) !important;
	height:          60px !important;
	min-height:      60px !important;
	max-height:      60px !important;
	position:        relative !important;
	z-index:         var(--dx-z-sticky) !important;
	width:           auto !important;
	min-width:       0 !important;
	margin:          0 !important;
}

/* ── SVG safety: no SVG inside portal may become viewport-sized ───────────── */

.dx-shell svg {
	max-width:   100% !important;
	max-height:  100% !important;
	flex-shrink: 0;
}

.dx-shell svg:not([width]):not([height]) {
	width:  1em;
	height: 1em;
}

/* High-specificity nav icon lock — beats any Divi/theme svg { width:100% } rule */
body.dx-portal-page .dx-shell .dx-sidebar .dx-nav__link > svg.dx-nav__icon {
	display:    block !important;
	width:      18px !important;
	height:     18px !important;
	min-width:  18px !important;
	min-height: 18px !important;
	max-width:  18px !important;
	max-height: 18px !important;
	flex:       0 0 18px !important;
	aspect-ratio: 1 / 1 !important;
	overflow:   visible !important;
}

.dx-topbar__brand {
	font-family: var(--dx-font-display) !important;
	font-weight: 700 !important;
	font-size:   var(--dx-fs-lg) !important;
	color:       var(--dx-accent) !important;
	text-decoration: none !important;
}

.dx-topbar__actions {
	display:     flex !important;
	align-items: center !important;
	gap:         var(--dx-space-4) !important;
}

/* Notification badge */
.dx-badge {
	display:          inline-flex !important;
	align-items:      center !important;
	justify-content:  center !important;
	min-width:        20px !important;
	height:           20px !important;
	padding:          0 6px !important;
	background:       var(--dx-danger) !important;
	border-radius:    var(--dx-radius-full) !important;
	font-size:        var(--dx-fs-xs) !important;
	font-weight:      700 !important;
	color:            #fff !important;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */

.dx-sidebar {
	grid-area:      sidebar;
	background:     var(--dx-bg-2) !important;
	border-right:   1px solid var(--dx-border) !important;
	padding:        var(--dx-space-6) 0;
	display:        flex !important;
	flex-direction: column !important;
	overflow-y:     auto !important;
	height:         100% !important;
}

/* Desktop sidebar hardening — beat theme position/transform overrides */
@media (min-width: 769px) {
	body.dx-portal-page .dx-shell .dx-sidebar {
		grid-area:      sidebar !important;
		position:       relative !important;
		inset:          auto !important;
		transform:      none !important;
		width:          260px !important;
		min-width:      260px !important;
		max-width:      260px !important;
		height:         100% !important;
		display:        flex !important;
		flex-direction: column !important;
		overflow-x:     hidden !important;
		overflow-y:     auto !important;
		box-shadow:     none !important;
		margin:         0 !important;
	}
}

.dx-nav { list-style: none !important; }

.dx-nav__link {
	display:        flex !important;
	align-items:    center !important;
	gap:            var(--dx-space-3) !important;
	padding:        var(--dx-space-3) var(--dx-space-6) !important;
	color:          var(--dx-text-muted) !important;
	text-decoration: none !important;
	font-size:      var(--dx-fs-sm) !important;
	font-weight:    500 !important;
	border-left:    3px solid transparent !important;
	transition:     color 150ms, background 150ms, border-color 150ms;
}

.dx-nav__link:hover {
	color:      var(--dx-text) !important;
	background: rgba(255,255,255,.04) !important;
}

.dx-nav__link.is-active {
	color:        var(--dx-accent) !important;
	border-color: var(--dx-accent) !important;
	background:   rgba(34,211,238,.06) !important;
}

.dx-nav__icon {
	width:     18px !important;
	height:    18px !important;
	flex-shrink: 0;
	opacity:   0.7;
	fill:      currentColor;
	color:     inherit;
}
.dx-nav__link.is-active .dx-nav__icon { opacity: 1; }

.dx-nav__group-label {
	font-size:      var(--dx-fs-xs) !important;
	font-weight:    600 !important;
	color:          var(--dx-text-dim) !important;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding:        var(--dx-space-4) var(--dx-space-6) var(--dx-space-2);
	list-style:     none;
}

/* Mobile sidebar drawer */
@media (max-width: 768px) {
	.dx-sidebar {
		position:   fixed;
		inset:      0;
		width:      280px;
		z-index:    var(--dx-z-modal);
		transform:  translateX(-100%);
		transition: transform 220ms ease;
	}
	.dx-sidebar.is-open {
		transform: translateX(0);
		box-shadow: var(--dx-shadow-lg);
	}
}

/* ── Main content area ────────────────────────────────────────────────────── */

.dx-main {
	grid-area:  main;
	padding:    var(--dx-space-8) !important;
	overflow-y: auto !important;
	height:     100% !important;
	background: var(--dx-bg) !important;
	color:      var(--dx-text) !important;
	min-width:  0 !important;
	width:      auto !important;
	display:    block !important;
}

/* Main area authoritative hardening */
body.dx-portal-page .dx-shell .dx-main {
	grid-area:   main !important;
	display:     block !important;
	width:       auto !important;
	max-width:   none !important;
	min-width:   0 !important;
	height:      100% !important;
	min-height:  0 !important;
	overflow-x:  hidden !important;
	overflow-y:  auto !important;
	padding:     var(--dx-space-8) !important;
}

@media (min-width: 1280px) {
	body.dx-portal-page .dx-shell .dx-main {
		padding: var(--dx-space-9) var(--dx-space-8) var(--dx-space-10) !important;
	}
}

@media (max-width: 1023px) {
	body.dx-portal-page .dx-shell .dx-main {
		padding: var(--dx-space-6) !important;
	}
}

@media (max-width: 768px) {
	.dx-main,
	body.dx-portal-page .dx-shell .dx-main {
		padding: var(--dx-space-4) !important;
	}
}

/* ── View headings ────────────────────────────────────────────────────────── */

.dx-page-header { margin-bottom: var(--dx-space-6); }

.dx-page-title {
	font-family: var(--dx-font-display) !important;
	font-size:   var(--dx-fs-2xl) !important;
	font-weight: 700 !important;
	color:       var(--dx-text) !important;
}

.dx-page-subtitle {
	font-size:  var(--dx-fs-sm) !important;
	color:      var(--dx-text-muted) !important;
	margin-top: var(--dx-space-1);
}

/* ── Utility ──────────────────────────────────────────────────────────────── */

.dx-hide-mobile { display: block; }
.dx-show-mobile { display: none; }

@media (max-width: 768px) {
	.dx-hide-mobile { display: none; }
	.dx-show-mobile { display: block; }
}
