/* ==========================================================================
   Mangwao v1.2.41 — Dashboard redesign (admin + Seller Center).
   Left vertical sidebar + sticky topbar shell, KPI strip, period revenue
   chart, category donut, status badges, low-stock alerts. Brand: Poppins,
   purple #875ff5, light background #f8f7fa, white cards.
   This file ONLY styles the dashboards. It never touches shop, PDP,
   cart, checkout, header, footer or the product cards.
   No !important anywhere — .mg-dash-* selectors are specific enough.
   ========================================================================== */

/* --- Shell ---------------------------------------------------------------- */
.mg-dash {
	display: flex;
	align-items: flex-start;
	background: #f8f7fa;
	font-family: Poppins, Arial, sans-serif;
	color: #1e1e1e;
}
.mg-dash-check {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}
.mg-dash-side {
	width: 260px;
	flex-shrink: 0;
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
	background: #fff;
	border-right: 1px solid #e8e6f0;
	z-index: 10;
}
body.admin-bar .mg-dash-side {
	top: 32px;
	height: calc(100vh - 32px);
}
.mg-dash-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px;
	border-bottom: 1px solid #f0eef7;
}
.mg-dash-mark {
	width: 36px;
	height: 36px;
	line-height: 36px;
	text-align: center;
	border-radius: 9px;
	background: #875ff5;
	color: #fff;
	font-weight: 800;
	font-size: 19px;
	flex-shrink: 0;
}
.mg-dash-brandtxt {
	font-weight: 700;
	font-size: 16px;
	line-height: 1.2;
}
.mg-dash-brandtxt small {
	display: block;
	font-weight: 500;
	font-size: 12px;
	color: #64748b;
}
.mg-dash-nav {
	padding: 12px 10px 20px;
}
.mg-dash-group {
	margin-bottom: 14px;
}
.mg-dash-glabel {
	display: block;
	padding: 0 10px 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: #9aa0b0;
}
.mg-dash-link {
	display: block;
	padding: 9px 12px;
	border-radius: 8px;
	color: #3d3d3d;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
}
.mg-dash-link:hover {
	background: #f3f0ff;
	text-decoration: none;
}
.mg-dash-link.on {
	background: #875ff5;
	color: #fff;
	font-weight: 600;
}
.mg-dash-main {
	flex: 1;
	min-width: 0;
}
.mg-dash-topbar {
	position: sticky;
	top: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 12px 20px;
	background: #fff;
	border-bottom: 1px solid #e8e6f0;
}
body.admin-bar .mg-dash-topbar {
	top: 32px;
}
.mg-dash-toptitle {
	font-weight: 700;
	font-size: 17px;
}
.mg-dash-topactions {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 14px;
	font-size: 13.5px;
}
.mg-dash-topactions a {
	color: #875ff5;
	font-weight: 600;
	text-decoration: none;
}
.mg-dash-topactions span {
	color: #64748b;
}
.mg-dash-content {
	padding: 20px;
}
.mg-dash-burger,
.mg-dash-close,
.mg-dash-scrim {
	display: none;
}
.mg-dash-burger,
.mg-dash-close {
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
	color: #3d3d3d;
}

/* --- Home: breadcrumb, title, KPI strip ----------------------------------- */
.mg-dash-crumb {
	font-size: 13px;
	color: #64748b;
	margin-bottom: 4px;
}
.mg-dash-h2 {
	font-size: 22px;
	margin: 0 0 16px;
}
.mg-dash-kpis {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 16px;
	margin-bottom: 16px;
}
.mg-dash-kpi {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(30, 30, 30, 0.08);
	padding: 16px;
}
.mg-dash-klabel {
	font-size: 13px;
	color: #64748b;
	margin-bottom: 6px;
}
.mg-dash-kvalue {
	font-size: 26px;
	font-weight: 700;
	line-height: 1.2;
	word-break: break-word;
}
.mg-dash-trend {
	display: inline-block;
	margin-top: 6px;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
}
.mg-dash-trend.up {
	background: #e8f5e9;
	color: #16a34a;
}
.mg-dash-trend.down {
	background: #fdecea;
	color: #dc2626;
}
.mg-dash-knote {
	font-size: 12.5px;
	color: #64748b;
	margin-top: 6px;
}

/* --- Cards, rows, tables --------------------------------------------------- */
.mg-dash-card {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(30, 30, 30, 0.08);
	padding: 18px;
	margin-bottom: 16px;
}
.mg-dash-chead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}
.mg-dash-chead h3 {
	font-size: 16px;
	margin: 0;
}
.mg-dash-chead a {
	font-size: 13px;
	color: #875ff5;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.mg-dash-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-bottom: 16px;
}
.mg-dash-row .mg-dash-card {
	margin-bottom: 0;
}
.mg-dash-scroll {
	overflow-x: auto;
}
.mg-dash-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13.5px;
}
.mg-dash-table th {
	text-align: left;
	color: #64748b;
	font-weight: 600;
	padding: 8px 10px;
	border-bottom: 1px solid #eee;
	white-space: nowrap;
}
.mg-dash-table td {
	padding: 8px 10px;
	border-bottom: 1px solid #f1f1f1;
}
.mg-dash-table a {
	color: #875ff5;
	text-decoration: none;
}
.mg-dash-empty {
	color: #64748b;
	padding: 12px 0 4px;
}

/* --- Period toggle + bars -------------------------------------------------- */
.mg-dash-periods {
	display: flex;
	gap: 6px;
}
.mg-dash-periods a {
	padding: 5px 12px;
	border-radius: 999px;
	background: #f3f0ff;
	color: #3d2a7a;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}
.mg-dash-periods a.on {
	background: #875ff5;
	color: #fff;
}
.mg-dash-chart-total {
	font-size: 13.5px;
	color: #64748b;
	margin: 0 0 10px;
}
.mg-dash-chart-total b {
	color: #1e1e1e;
}
.mg-dash-bars {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	min-height: 120px;
}
.mg-dash-bars.dense {
	gap: 3px;
}
.mg-dash-bar {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	gap: 4px;
	min-width: 0;
}
.mg-dash-bar b {
	font-size: 10px;
	font-weight: 600;
	white-space: nowrap;
}
.mg-dash-bar i {
	display: block;
	width: 100%;
	max-width: 34px;
	background: #875ff5;
	border-radius: 4px 4px 0 0;
}
.mg-dash-bar span {
	font-size: 10.5px;
	color: #64748b;
	white-space: nowrap;
}
.mg-dash-bars.dense .mg-dash-bar span {
	display: none;
}
.mg-dash-bars.dense .mg-dash-bar:nth-child(5n) span {
	display: block;
}

/* --- Donut + legend -------------------------------------------------------- */
.mg-dash-donutwrap {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
}
.mg-dash-donut {
	position: relative;
	width: 140px;
	height: 140px;
	border-radius: 50%;
	flex-shrink: 0;
}
.mg-dash-donut::after {
	content: "";
	position: absolute;
	inset: 30px;
	background: #fff;
	border-radius: 50%;
}
.mg-dash-legend {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 13.5px;
}
.mg-dash-legend li {
	margin-bottom: 6px;
}
.mg-dash-legend i {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	margin-right: 8px;
}

/* --- Status badges + order-screen notes ------------------------------------ */
.mg-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	background: #f1f1f1;
	color: #3d3d3d;
	white-space: nowrap;
}
.mg-badge-ok {
	background: #e8f5e9;
	color: #16a34a;
}
.mg-badge-warn {
	background: #fff3e0;
	color: #b45309;
}
.mg-badge-hold {
	background: #e3f2fd;
	color: #2563eb;
}
.mg-badge-bad {
	background: #fdecea;
	color: #dc2626;
}
.mg-dash-sent {
	color: #16a34a;
	font-weight: 700;
	font-size: 12.5px;
	white-space: nowrap;
}
.mg-dash-warn {
	color: #dc2626;
	font-size: 12px;
	white-space: nowrap;
}

/* --- Section views inside the shell (tables, headings) --------------------- */
.mg-dash-content h2 {
	font-size: 20px;
	margin: 0 0 14px;
}
.mg-dash-content h3 {
	font-size: 16px;
	margin: 18px 0 10px;
}
.mg-dash-content .mg-admin-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13.5px;
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(30, 30, 30, 0.08);
}
.mg-dash-content .mg-admin-table th {
	text-align: left;
	color: #64748b;
	font-weight: 600;
	padding: 9px 12px;
	border-bottom: 1px solid #eee;
}
.mg-dash-content .mg-admin-table td {
	padding: 9px 12px;
	border-bottom: 1px solid #f1f1f1;
}
.mg-dash-content .mg-admin-table a {
	color: #875ff5;
	text-decoration: none;
}

/* --- Mobile drawer (≤820px) ------------------------------------------------ */
@media (max-width: 820px) {
	.mg-dash-side {
		position: fixed;
		left: 0;
		top: 0;
		bottom: 0;
		height: 100vh;
		width: 280px;
		max-width: 85vw;
		transform: translateX(-105%);
		transition: transform 0.25s ease;
		z-index: 100000;
		box-shadow: 2px 0 16px rgba(30, 30, 30, 0.2);
	}
	body.admin-bar .mg-dash-side {
		top: 0;
		height: 100vh;
	}
	.mg-dash-check:checked ~ .mg-dash-side {
		transform: none;
	}
	.mg-dash-scrim {
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.4);
		z-index: 99999;
		cursor: pointer;
	}
	.mg-dash-check:checked ~ .mg-dash-scrim {
		display: block;
	}
	.mg-dash-burger,
	.mg-dash-close {
		display: inline-flex;
		align-items: center;
	}
	.mg-dash-close {
		margin-left: auto;
	}
	.mg-dash-content {
		padding: 16px 12px;
	}
	.mg-dash-row {
		grid-template-columns: 1fr;
	}
	.mg-dash-topactions span {
		display: none;
	}
	.mg-dash-toptitle {
		font-size: 15px;
	}
}
@media (max-width: 900px) and (min-width: 821px) {
	.mg-dash-row {
		grid-template-columns: 1fr;
	}
}
