/* ==========================================================================
   Dominiax Dashboard — Front-end Styles
   Scoped entirely under .dominiax-dashboard to avoid theme collisions.
   ========================================================================== */

.dominiax-dashboard {
	--dmx-accent: #ff7a1a;
	--dmx-accent-soft: rgba(255, 122, 26, 0.16);
	--dmx-radius: 16px;
	--dmx-radius-sm: 10px;
	--dmx-gap: 20px;
	--dmx-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	/* Dark theme tokens (default) */
	--dmx-bg: #0b0b0f;
	--dmx-sidebar-bg: #0e0e13;
	--dmx-card-bg: #14141a;
	--dmx-card-bg-alt: #181820;
	--dmx-border: rgba(255, 255, 255, 0.07);
	--dmx-border-strong: rgba(255, 255, 255, 0.12);
	--dmx-text: #f3f3f5;
	--dmx-text-dim: #9a9aa5;
	--dmx-text-faint: #6c6c78;
	--dmx-track-bg: rgba(255, 255, 255, 0.08);
	--dmx-green: #22c55e;
	--dmx-red: #f43f5e;
	--dmx-blue: #3b82f6;
	--dmx-amber: #f59e0b;
	--dmx-violet: #8b5cf6;
	--dmx-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);

	font-family: var(--dmx-font);
	color: var(--dmx-text);
	background: var(--dmx-bg);
	box-sizing: border-box;
	-webkit-font-smoothing: antialiased;
	line-height: 1.45;
}

.dominiax-dashboard.dmx-theme-light {
	--dmx-bg: #f4f5f7;
	--dmx-sidebar-bg: #ffffff;
	--dmx-card-bg: #ffffff;
	--dmx-card-bg-alt: #f8f9fb;
	--dmx-border: rgba(15, 15, 20, 0.07);
	--dmx-border-strong: rgba(15, 15, 20, 0.12);
	--dmx-text: #14141a;
	--dmx-text-dim: #5b5b66;
	--dmx-text-faint: #8b8b96;
	--dmx-track-bg: rgba(15, 15, 20, 0.08);
	--dmx-shadow: 0 4px 18px rgba(20, 20, 30, 0.08);
}

.dominiax-dashboard *,
.dominiax-dashboard *::before,
.dominiax-dashboard *::after {
	box-sizing: border-box;
}

.dominiax-dashboard a {
	text-decoration: none;
	color: inherit;
}

.dominiax-dashboard ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dominiax-dashboard h1,
.dominiax-dashboard h2,
.dominiax-dashboard h3 {
	margin: 0;
	font-weight: 600;
}

.dominiax-dashboard p {
	margin: 0;
}

.dominiax-dashboard button {
	font-family: inherit;
	cursor: pointer;
}

/* ==========================================================================
   Layout shell
   ========================================================================== */

.dmx-shell {
	display: flex;
	min-height: 640px;
	border-radius: var(--dmx-radius);
	overflow: hidden;
	background: var(--dmx-bg);
	border: 1px solid var(--dmx-border);
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.dmx-sidebar {
	width: 248px;
	flex-shrink: 0;
	background: var(--dmx-sidebar-bg);
	border-right: 1px solid var(--dmx-border);
	display: flex;
}

.dmx-sidebar-inner {
	display: flex;
	flex-direction: column;
	width: 100%;
	padding: 22px 16px;
}

.dmx-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 4px 8px 24px;
}

.dmx-brand-mark {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--dmx-accent-soft);
	color: var(--dmx-accent);
	font-size: 16px;
	flex-shrink: 0;
}

.dmx-brand-logo {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	max-height: 38px;
}

.dmx-brand-logo img {
	display: block;
	max-height: 38px;
	max-width: 140px;
	height: auto;
	width: auto;
	object-fit: contain;
}

.dmx-brand-text {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}

.dmx-brand-name {
	font-weight: 700;
	font-size: 15px;
	letter-spacing: 0.3px;
}

.dmx-brand-subtitle {
	font-size: 10px;
	letter-spacing: 1.6px;
	color: var(--dmx-text-faint);
}

.dmx-nav {
	flex: 1;
	overflow-y: auto;
}

.dmx-nav ul {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.dmx-nav a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 14px;
	border-radius: var(--dmx-radius-sm);
	color: var(--dmx-text-dim);
	font-size: 14px;
	font-weight: 500;
	transition: background 0.15s ease, color 0.15s ease;
}

.dmx-nav a i {
	width: 18px;
	text-align: center;
	font-size: 15px;
	flex-shrink: 0;
}

.dmx-nav li:not(.is-active) a:hover {
	background: var(--dmx-card-bg-alt);
	color: var(--dmx-text);
}

.dmx-nav li.is-active a {
	background: var(--dmx-accent-soft);
	color: var(--dmx-accent);
	font-weight: 600;
	box-shadow: inset 0 0 0 1px rgba(255, 122, 26, 0.25);
}

/* ---- Added in 2.1.0: War Room access gating ---- */

.dmx-nav li.dmx-nav-locked a {
	opacity: 0.55;
	cursor: not-allowed;
}

.dmx-nav li.dmx-nav-locked a:hover {
	background: transparent;
	color: var(--dmx-text-dim);
}

.dmx-nav-lock-icon {
	margin-left: auto;
	font-size: 11px !important;
	width: auto !important;
	flex-shrink: 0;
	opacity: 0.8;
}

.dmx-sidebar-footer {
	border-top: 1px solid var(--dmx-border);
	padding-top: 14px;
	margin-top: 10px;
}

.dmx-user {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 8px;
	border-radius: var(--dmx-radius-sm);
	cursor: pointer;
}

.dmx-user:hover {
	background: var(--dmx-card-bg-alt);
}

.dmx-user-avatar {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #ffffff;
	color: #14141a;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 13px;
	flex-shrink: 0;
}

.dmx-user-name {
	flex: 1;
	font-size: 13.5px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.dmx-user-caret {
	font-size: 11px;
	color: var(--dmx-text-faint);
}

/* ==========================================================================
   Main column
   ========================================================================== */

.dmx-main {
	flex: 1;
	min-width: 0;
	padding: 22px 24px 28px;
	display: flex;
	flex-direction: column;
	gap: var(--dmx-gap);
	background: var(--dmx-bg);
}

.dmx-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 14px;
}

.dmx-topbar-left {
	display: flex;
	align-items: center;
	gap: 22px;
	flex-wrap: wrap;
}

.dmx-page-title {
	font-size: 21px;
	font-weight: 700;
}

.dmx-tabs {
	display: flex;
	gap: 4px;
	background: var(--dmx-card-bg-alt);
	border-radius: 999px;
	padding: 4px;
}

.dmx-tab {
	font-size: 13px;
	font-weight: 600;
	color: var(--dmx-text-dim);
	padding: 7px 16px;
	border-radius: 999px;
	transition: all 0.15s ease;
}

.dmx-tab.is-active {
	background: transparent;
	color: var(--dmx-accent);
	border: 1px solid var(--dmx-accent);
}

.dmx-tab:not(.is-active):hover {
	color: var(--dmx-text);
}

.dmx-topbar-right {
	display: flex;
	align-items: center;
	gap: 12px;
}

.dmx-theme-toggle {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	border: 1px solid var(--dmx-border-strong);
	background: var(--dmx-card-bg);
	color: var(--dmx-text-dim);
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

.dmx-theme-toggle i {
	position: absolute;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.dmx-icon-light { opacity: 0; transform: scale(0.6) rotate(-45deg); }
.dmx-icon-dark  { opacity: 1; transform: scale(1) rotate(0deg); }

.dmx-theme-light .dmx-icon-light { opacity: 1; transform: scale(1) rotate(0deg); }
.dmx-theme-light .dmx-icon-dark  { opacity: 0; transform: scale(0.6) rotate(45deg); }

.dmx-time-period {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--dmx-text-dim);
	background: var(--dmx-card-bg);
	border: 1px solid var(--dmx-border-strong);
	border-radius: 10px;
	padding: 9px 14px;
	white-space: nowrap;
}

.dmx-time-period strong {
	color: var(--dmx-text);
}

.dmx-time-period-label {
	display: none;
}

@media (min-width: 880px) {
	.dmx-time-period-label {
		display: inline;
	}
}

/* ==========================================================================
   Cards (shared)
   ========================================================================== */

.dmx-card {
	background: var(--dmx-card-bg);
	border: 1px solid var(--dmx-border);
	border-radius: var(--dmx-radius);
	padding: 20px;
	box-shadow: var(--dmx-shadow);
}

.dmx-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 18px;
}

.dmx-card-header h2 {
	font-size: 15.5px;
}

.dmx-card-icon-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 16px;
}

.dmx-card-icon-row h3 {
	font-size: 14.5px;
	margin-bottom: 4px;
}

/* ==========================================================================
   Stat icon chips
   ========================================================================== */

.dmx-stat-icon {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 17px;
	flex-shrink: 0;
}

.dmx-stat-icon-sm {
	width: 34px;
	height: 34px;
	border-radius: 9px;
	font-size: 14px;
}

.dmx-bg-violet { background: rgba(139, 92, 246, 0.16); color: var(--dmx-violet); }
.dmx-bg-green  { background: rgba(34, 197, 94, 0.16);  color: var(--dmx-green); }
.dmx-bg-amber  { background: rgba(245, 158, 11, 0.16); color: var(--dmx-amber); }
.dmx-bg-blue   { background: rgba(59, 130, 246, 0.16); color: var(--dmx-blue); }
.dmx-bg-red    { background: rgba(244, 63, 94, 0.16);  color: var(--dmx-red); }
.dmx-bg-purple { background: rgba(139, 92, 246, 0.16); color: var(--dmx-violet); }

/* ==========================================================================
   Stat cards grid (4 across)
   ========================================================================== */

.dmx-stats-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--dmx-gap);
}

.dmx-stat-card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px 20px;
}

.dmx-stat-body {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.dmx-stat-label {
	font-size: 12.5px;
	color: var(--dmx-text-dim);
	white-space: nowrap;
}

.dmx-stat-value {
	font-size: 19px;
	font-weight: 700;
	margin-top: 2px;
	white-space: nowrap;
}

.dmx-stat-suffix {
	font-size: 12px;
	color: var(--dmx-text-faint);
	margin-top: 1px;
}

/* ==========================================================================
   Content grid: main column + right panel
   ========================================================================== */

.dmx-content-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: var(--dmx-gap);
	align-items: start;
}

.dmx-content-main {
	display: flex;
	flex-direction: column;
	gap: var(--dmx-gap);
	min-width: 0;
}

.dmx-content-side {
	display: flex;
	flex-direction: column;
	gap: var(--dmx-gap);
	min-width: 0;
}

/* ==========================================================================
   Chart card
   ========================================================================== */

.dmx-chart-legend {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--dmx-text-dim);
}

.dmx-legend-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	display: inline-block;
	margin-right: 2px;
}

.dmx-legend-dot:not(:first-child) {
	margin-left: 14px;
}

.dmx-dot-accent { background: var(--dmx-accent); }
.dmx-dot-muted  { background: var(--dmx-text-faint); }

.dmx-chart-wrap {
	position: relative;
	width: 100%;
	height: 260px;
}

.dmx-chart-canvas {
	width: 100% !important;
	height: 100% !important;
	display: block;
}

/* ==========================================================================
   Two-column row: progress + earned
   ========================================================================== */

.dmx-two-col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--dmx-gap);
}

.dmx-progress-copy {
	font-size: 13px;
	color: var(--dmx-text-dim);
}

.dmx-progress-copy strong,
.dmx-progress-copy b {
	color: var(--dmx-accent);
	font-weight: 700;
}

.dmx-progress-track {
	width: 100%;
	height: 8px;
	border-radius: 999px;
	background: var(--dmx-track-bg);
	overflow: hidden;
	margin-bottom: 10px;
}

.dmx-progress-fill {
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, #6d5bff, #8b5cf6);
}

.dmx-progress-meta {
	text-align: right;
	font-size: 13px;
	font-weight: 600;
	color: var(--dmx-text-dim);
	margin-bottom: 6px;
}

.dmx-progress-labels {
	display: flex;
	justify-content: space-between;
	font-size: 12.5px;
	color: var(--dmx-text-faint);
}

.dmx-earned-value {
	font-size: 34px;
	font-weight: 800;
	margin: 4px 0 14px;
}

.dmx-earned-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.dmx-earned-suffix {
	font-size: 13px;
	color: var(--dmx-text-dim);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.dmx-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	padding: 9px 16px;
	border-radius: 999px;
	white-space: nowrap;
	transition: all 0.15s ease;
	border: 1px solid transparent;
}

.dmx-btn i {
	font-size: 11px;
}

.dmx-btn-outline {
	background: transparent;
	border-color: var(--dmx-border-strong);
	color: var(--dmx-text);
}

.dmx-btn-outline:hover {
	border-color: var(--dmx-text-dim);
}

.dmx-btn-solid {
	background: var(--dmx-text);
	color: var(--dmx-bg);
}

.dmx-theme-dark .dmx-btn-solid {
	background: #ffffff;
	color: #0b0b0f;
}

.dmx-btn-solid:hover {
	opacity: 0.88;
}

.dmx-btn-outline-accent {
	background: transparent;
	border-color: var(--dmx-accent);
	color: var(--dmx-accent);
}

.dmx-btn-outline-accent:hover {
	background: var(--dmx-accent-soft);
}

/* ==========================================================================
   Announcement bar
   ========================================================================== */

.dmx-announcement-card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 20px;
}

.dmx-announcement-text {
	flex: 1;
	font-size: 14px;
	font-weight: 500;
	min-width: 0;
}

/* ==========================================================================
   Recent Rewards / Redemption Eligibility (added in 2.0.0)
   ========================================================================== */

.dmx-redemption-card .dmx-progress-track {
	margin-top: 14px;
}

/* ==========================================================================
   Right panel — At a Glance
   ========================================================================== */

.dmx-side-title {
	font-size: 15.5px;
	margin-bottom: 4px;
}

.dmx-side-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}

.dmx-link-small {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--dmx-blue);
}

.dmx-link-small:hover {
	text-decoration: underline;
}

.dmx-glance-list,
.dmx-achievements-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-top: 16px;
}

.dmx-glance-item,
.dmx-achievement-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.dmx-glance-body {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.dmx-glance-label {
	font-size: 12.5px;
	color: var(--dmx-text-dim);
}

.dmx-glance-value {
	font-size: 18px;
	font-weight: 700;
	margin-top: 1px;
}

.dmx-glance-delta {
	font-size: 11.5px;
	margin-top: 1px;
}

.dmx-trend-up {
	color: var(--dmx-green);
}

.dmx-trend-down {
	color: var(--dmx-red);
}

.dmx-achievement-item {
	align-items: center;
}

.dmx-achievement-label {
	flex: 1;
	font-size: 13.5px;
	font-weight: 500;
	min-width: 0;
}

.dmx-achievement-value {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--dmx-accent);
	white-space: nowrap;
}

/* ==========================================================================
   CTA card
   ========================================================================== */

.dmx-cta-card {
	position: relative;
	overflow: hidden;
	background: linear-gradient(165deg, rgba(255, 122, 26, 0.14), var(--dmx-card-bg) 60%);
	border-color: rgba(255, 122, 26, 0.35);
}

.dmx-cta-body h3 {
	font-size: 15px;
	margin-bottom: 8px;
}

.dmx-cta-body p {
	font-size: 12.5px;
	color: var(--dmx-text-dim);
	margin-bottom: 16px;
}

.dmx-cta-icon {
	position: absolute;
	right: 14px;
	bottom: 10px;
	font-size: 64px;
	color: rgba(255, 122, 26, 0.18);
	pointer-events: none;
}

/* ==========================================================================
   Responsive breakpoints
   ========================================================================== */

@media (max-width: 1180px) {
	.dmx-content-grid {
		grid-template-columns: 1fr;
	}
	.dmx-content-side {
		order: 2;
	}
}

@media (max-width: 980px) {
	.dmx-stats-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.dmx-two-col {
		grid-template-columns: 1fr;
	}
	.dmx-sidebar {
		width: 210px;
	}
}

@media (max-width: 760px) {
	.dmx-shell {
		flex-direction: column;
	}
	.dmx-sidebar {
		width: 100%;
		border-right: none;
		border-bottom: 1px solid var(--dmx-border);
	}
	.dmx-sidebar-inner {
		padding: 14px 14px 10px;
	}
	.dmx-nav {
		overflow-x: auto;
		overflow-y: visible;
	}
	.dmx-nav ul {
		flex-direction: row;
		gap: 6px;
		padding-bottom: 4px;
	}
	.dmx-nav a {
		padding: 9px 14px;
		white-space: nowrap;
	}
	.dmx-nav a span {
		display: none;
	}
	.dmx-sidebar-footer {
		display: none;
	}
	.dmx-main {
		padding: 16px 14px 22px;
	}
	.dmx-stats-grid {
		grid-template-columns: 1fr 1fr;
		gap: 12px;
	}
	.dmx-stat-card {
		padding: 14px;
	}
	.dmx-stat-value {
		font-size: 16px;
	}
	.dmx-card {
		padding: 16px;
	}
}

@media (max-width: 520px) {
	.dmx-stats-grid {
		grid-template-columns: 1fr;
	}
	.dmx-topbar {
		flex-direction: column;
		align-items: stretch;
	}
	.dmx-topbar-right {
		justify-content: space-between;
	}
	.dmx-tabs {
		width: 100%;
		overflow-x: auto;
	}
	.dmx-announcement-card {
		flex-wrap: wrap;
	}
	.dmx-announcement-text {
		width: 100%;
		order: -1;
	}
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.dominiax-dashboard * {
		transition: none !important;
		animation: none !important;
	}
}
