/* MercadoPro ERP application interface. */

:root {
	--mp-primary: #176b4d;
	--mp-primary-strong: #0d543a;
	--mp-primary-soft: #e6f3ed;
	--mp-primary-rgb: 23, 107, 77;
	--mp-accent: #f5a524;
	--mp-surface: #ffffff;
	--mp-surface-raised: #ffffff;
	--mp-canvas: #f5f7fa;
	--mp-ink: #172033;
	--mp-muted: #66758c;
	--mp-muted-light: #94a3b8;
	--mp-border: #e2e8f0;
	--mp-border-strong: #d5dee9;
	--mp-success: #159765;
	--mp-success-soft: #e5f6ee;
	--mp-info: #2976d2;
	--mp-info-soft: #e7f0fc;
	--mp-warning: #c77b08;
	--mp-warning-soft: #fff3d9;
	--mp-danger: #d14444;
	--mp-danger-soft: #fdeaea;
	--mp-sidebar: #10291f;
	--mp-sidebar-text: #cedbd5;
	--mp-sidebar-muted: #8da79c;
	--mp-shadow: 0 12px 28px rgba(15, 23, 42, 0.075);
	--mp-shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.14);
	--mp-radius: 14px;
	--mp-radius-sm: 10px;
}

body.mercadopro-app {
	min-width: 320px;
	background: var(--mp-canvas);
	color: var(--mp-ink);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

body[data-mp-theme="dark"],
body.mercadopro-dark {
	--mp-surface: #172234;
	--mp-surface-raised: #1d2b3e;
	--mp-canvas: #0e1725;
	--mp-ink: #edf3f8;
	--mp-muted: #a9b8c9;
	--mp-muted-light: #8799ad;
	--mp-border: #2b3a4e;
	--mp-border-strong: #3a4b62;
	--mp-primary-soft: #183e31;
	--mp-success-soft: #143d2e;
	--mp-info-soft: #1c3658;
	--mp-warning-soft: #453415;
	--mp-danger-soft: #4b2529;
	--mp-sidebar: #0a1913;
	--mp-sidebar-text: #d9e6e0;
	--mp-sidebar-muted: #91aa9f;
	--mp-shadow: 0 12px 28px rgba(0, 0, 0, 0.19);
	--mp-shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.28);
}

.mp-icon-sprite {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

.mp-icon {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.mp-app-shell {
	display: grid;
	grid-template-columns: 264px minmax(0, 1fr);
	min-height: 100vh;
	background: var(--mp-canvas);
	transition: grid-template-columns 180ms ease;
}

.mp-sidebar {
	position: sticky;
	top: 0;
	display: flex;
	flex-direction: column;
	width: 264px;
	height: 100vh;
	overflow-x: hidden;
	overflow-y: auto;
	background: var(--mp-sidebar);
	color: var(--mp-sidebar-text);
	transition: width 180ms ease, transform 180ms ease;
	z-index: 50;
}

.mp-sidebar::-webkit-scrollbar {
	width: 6px;
}

.mp-sidebar::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.18);
	border-radius: 5px;
}

.mp-sidebar__brand {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 74px;
	padding: 0 18px 0 20px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.mp-brand {
	display: inline-flex;
	align-items: center;
	min-width: 0;
	gap: 10px;
	color: #fff;
	font-size: 18px;
	font-weight: 800;
	letter-spacing: -0.035em;
	text-decoration: none;
}

.mp-brand:hover {
	color: #fff;
}

.mp-brand__mark {
	display: grid;
	grid-template-columns: repeat(3, 5px);
	align-items: end;
	gap: 2px;
	width: 25px;
	height: 25px;
	padding: 5px;
	border-radius: 8px;
	background: var(--mp-primary);
}

.mp-brand__mark span {
	display: block;
	border-radius: 3px;
	background: #fff;
}

.mp-brand__mark span:nth-child(1) { height: 7px; opacity: .72; }
.mp-brand__mark span:nth-child(2) { height: 12px; }
.mp-brand__mark span:nth-child(3) { height: 16px; opacity: .88; }

.mp-brand__text {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mp-brand__logo {
	width: auto;
	max-width: 132px;
	height: 30px;
	object-fit: contain;
	object-position: left center;
}

.mp-sidebar__collapse,
.mp-icon-button {
	display: inline-grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--mp-muted);
	transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.mp-sidebar__collapse {
	color: var(--mp-sidebar-muted);
}

.mp-icon-button:hover,
.mp-icon-button:focus-visible,
.mp-sidebar__collapse:hover,
.mp-sidebar__collapse:focus-visible {
	background: rgba(var(--mp-primary-rgb), 0.09);
	color: var(--mp-primary);
	outline: none;
}

.mp-sidebar__nav {
	padding: 16px 12px 18px;
}

.mp-nav-group {
	margin: 22px 10px 7px;
	overflow: hidden;
	color: var(--mp-sidebar-muted);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .095em;
	line-height: 1.4;
	text-transform: uppercase;
	white-space: nowrap;
}

.mp-sidebar__nav > .mp-nav-link:first-child + .mp-nav-group,
.mp-sidebar__nav > .mp-nav-link:first-child {
	margin-top: 0;
}

.mp-nav-link {
	display: flex;
	align-items: center;
	min-height: 44px;
	gap: 12px;
	margin: 2px 0;
	padding: 10px 11px;
	border-radius: 9px;
	color: var(--mp-sidebar-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.25;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 150ms ease, color 150ms ease;
}

.mp-nav-link .mp-icon {
	width: 19px;
	height: 19px;
	color: var(--mp-sidebar-muted);
}

.mp-nav-link:hover,
.mp-nav-link:focus-visible {
	background: rgba(255, 255, 255, 0.07);
	color: #fff;
	outline: none;
}

.mp-nav-link.is-active {
	background: rgba(35, 157, 107, 0.24);
	color: #fff;
	box-shadow: inset 3px 0 0 #61d39a;
}

.mp-nav-link.is-active .mp-icon {
	color: #76dfa8;
}

.mp-sidebar__footer {
	margin-top: auto;
	padding: 12px;
	border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.mp-app-main {
	min-width: 0;
}

.mp-topbar {
	position: sticky;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 74px;
	gap: 18px;
	padding: 12px 32px;
	border-bottom: 1px solid var(--mp-border);
	background: color-mix(in srgb, var(--mp-surface) 95%, transparent);
	backdrop-filter: blur(13px);
	z-index: 30;
}

.mp-topbar__start,
.mp-topbar__end,
.mp-user-menu,
.mp-popover__head,
.mp-notification,
.mp-page-head__actions,
.mp-breadcrumb,
.mp-panel__head,
.mp-chart-summary,
.mp-metric-card__top,
.mp-metric-card__foot,
.mp-product-name,
.mp-alert-item,
.mp-system-notice {
	display: flex;
	align-items: center;
}

.mp-topbar__start {
	min-width: 0;
	gap: 12px;
}

.mp-topbar__end {
	flex: 0 0 auto;
	gap: 8px;
}

.mp-mobile-menu {
	display: none;
}

.mp-global-search {
	display: flex;
	align-items: center;
	width: min(420px, 36vw);
	height: 42px;
	gap: 9px;
	padding: 0 11px;
	border: 1px solid var(--mp-border);
	border-radius: 10px;
	background: var(--mp-canvas);
	color: var(--mp-muted);
	transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.mp-global-search:focus-within {
	border-color: rgba(var(--mp-primary-rgb), .6);
	background: var(--mp-surface);
	box-shadow: 0 0 0 3px rgba(var(--mp-primary-rgb), .1);
}

.mp-global-search .mp-icon {
	width: 18px;
	height: 18px;
}

.mp-global-search input {
	min-width: 0;
	flex: 1;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--mp-ink);
	font-size: 13px;
}

.mp-global-search input::placeholder {
	color: var(--mp-muted-light);
}

.mp-global-search kbd {
	display: inline-flex;
	align-items: center;
	height: 21px;
	padding: 0 5px;
	border: 1px solid var(--mp-border);
	border-bottom-width: 2px;
	border-radius: 5px;
	color: var(--mp-muted);
	font-family: inherit;
	font-size: 10px;
	white-space: nowrap;
}

.mp-theme-icon--moon {
	display: none;
}

body[data-mp-theme="dark"] .mp-theme-icon--sun,
body.mercadopro-dark .mp-theme-icon--sun {
	display: none;
}

body[data-mp-theme="dark"] .mp-theme-icon--moon,
body.mercadopro-dark .mp-theme-icon--moon {
	display: block;
}

.mp-popover-wrap {
	position: relative;
}

.mp-notification-button {
	position: relative;
}

.mp-count {
	position: absolute;
	top: 3px;
	right: 3px;
	display: grid;
	place-items: center;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border: 2px solid var(--mp-surface);
	border-radius: 999px;
	background: var(--mp-danger);
	color: #fff;
	font-size: 9px;
	font-weight: 800;
}

.mp-user-menu {
	gap: 10px;
	min-height: 44px;
	padding: 3px 5px 3px 4px;
	border: 0;
	border-radius: 11px;
	background: transparent;
	color: var(--mp-ink);
	text-align: left;
	transition: background-color 150ms ease;
}

.mp-user-menu:hover,
.mp-user-menu:focus-visible {
	background: rgba(var(--mp-primary-rgb), .08);
	outline: none;
}

.mp-user-menu > .mp-icon {
	width: 16px;
	height: 16px;
	color: var(--mp-muted);
	transform: rotate(90deg);
}

.mp-avatar {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--mp-primary), #28926b);
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .02em;
}

.mp-user-menu__text {
	display: grid;
	max-width: 126px;
	line-height: 1.2;
}

.mp-user-menu__text strong,
.mp-user-menu__text small {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mp-user-menu__text strong {
	font-size: 12px;
}

.mp-user-menu__text small {
	margin-top: 3px;
	color: var(--mp-muted);
	font-size: 10px;
	text-transform: capitalize;
}

.mp-popover {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	width: 320px;
	padding: 8px;
	border: 1px solid var(--mp-border);
	border-radius: 12px;
	background: var(--mp-surface-raised);
	box-shadow: var(--mp-shadow-lg);
	color: var(--mp-ink);
	z-index: 80;
}

.mp-popover[hidden] {
	display: none;
}

.mp-popover__head {
	justify-content: space-between;
	padding: 8px 8px 10px;
	border-bottom: 1px solid var(--mp-border);
	font-size: 13px;
}

.mp-popover__head a {
	color: var(--mp-primary);
	font-size: 11px;
	font-weight: 700;
	text-decoration: none;
}

.mp-notification {
	align-items: flex-start;
	gap: 9px;
	padding: 11px 8px;
	border-radius: 8px;
	color: var(--mp-ink);
	text-decoration: none;
}

.mp-notification:hover {
	background: var(--mp-canvas);
	color: var(--mp-ink);
}

.mp-notification strong,
.mp-notification small {
	display: block;
}

.mp-notification strong {
	font-size: 12px;
}

.mp-notification small {
	margin-top: 2px;
	color: var(--mp-muted);
	font-size: 11px;
}

.mp-notification__dot {
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	margin-top: 4px;
	border-radius: 50%;
	background: var(--mp-info);
}

.mp-notification__dot--warning { background: var(--mp-warning); }
.mp-notification__dot--danger { background: var(--mp-danger); }

.mp-profile-popover {
	width: 180px;
	padding: 5px;
}

.mp-profile-popover a {
	display: block;
	padding: 9px;
	border-radius: 7px;
	color: var(--mp-ink);
	font-size: 13px;
	text-decoration: none;
}

.mp-profile-popover a:hover {
	background: var(--mp-canvas);
	color: var(--mp-primary);
}

.mp-app-content {
	max-width: 1680px;
	margin: 0 auto;
	padding: 30px 32px 46px;
}

.mp-dashboard {
	outline: 0;
}

.mp-page-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 25px;
}

.mp-breadcrumb {
	gap: 4px;
	margin-bottom: 6px;
	color: var(--mp-muted);
	font-size: 11px;
	font-weight: 600;
}

.mp-breadcrumb .mp-icon {
	width: 14px;
	height: 14px;
	transform: rotate(0deg);
}

.mp-breadcrumb strong {
	color: var(--mp-primary);
	font-weight: 700;
}

.mp-page-head h1 {
	margin: 0;
	color: var(--mp-ink);
	font-size: clamp(23px, 2.2vw, 29px);
	font-weight: 750;
	letter-spacing: -.045em;
	line-height: 1.15;
}

.mp-page-head p {
	margin: 7px 0 0;
	color: var(--mp-muted);
	font-size: 13px;
}

.mp-page-head__actions {
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 9px;
}

.mp-page-head__actions select,
.mp-unit-select,
.mp-date-select {
	max-width: 180px;
}

.mp-unit-select,
.mp-date-select {
	position: relative;
}

.mp-unit-select::after,
.mp-date-select::after {
	position: absolute;
	top: 50%;
	right: 11px;
	width: 7px;
	height: 7px;
	border-right: 1.5px solid var(--mp-muted);
	border-bottom: 1.5px solid var(--mp-muted);
	content: "";
	pointer-events: none;
	transform: translateY(-68%) rotate(45deg);
}

.mp-page-head select {
	width: 100%;
	height: 42px;
	padding: 0 31px 0 12px;
	border: 1px solid var(--mp-border);
	border-radius: 10px;
	appearance: none;
	background: var(--mp-surface);
	color: var(--mp-ink);
	font-size: 12px;
	font-weight: 650;
	outline: none;
}

.mp-page-head select:focus {
	border-color: var(--mp-primary);
	box-shadow: 0 0 0 3px rgba(var(--mp-primary-rgb), .1);
}

.mp-button .mp-icon {
	width: 18px;
	height: 18px;
}

.mp-system-notice {
	align-items: flex-start;
	gap: 10px;
	margin: -4px 0 22px;
	padding: 11px 13px;
	border: 1px solid #eedaa8;
	border-radius: 10px;
	background: var(--mp-warning-soft);
	color: #7a5410;
	font-size: 12px;
}

.mp-system-notice .mp-icon {
	width: 18px;
	height: 18px;
	color: var(--mp-warning);
}

.mp-system-notice div {
	display: grid;
	gap: 1px;
}

.mp-system-notice strong {
	font-size: 12px;
}

body[data-mp-theme="dark"] .mp-system-notice,
body.mercadopro-dark .mp-system-notice {
	border-color: #755519;
	color: #f3d38d;
}

.mp-metric-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 15px;
	margin-bottom: 18px;
}

.mp-metric-card,
.mp-panel {
	border: 1px solid var(--mp-border);
	border-radius: var(--mp-radius);
	background: var(--mp-surface);
	box-shadow: var(--mp-shadow);
}

.mp-metric-card {
	min-height: 142px;
	padding: 17px;
	transition: transform 160ms ease, box-shadow 160ms ease;
}

.mp-metric-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 15px 30px rgba(15, 23, 42, .1);
}

.mp-metric-card__top {
	justify-content: space-between;
	gap: 8px;
	color: var(--mp-muted);
	font-size: 12px;
	font-weight: 650;
}

.mp-metric-card__icon {
	display: grid;
	place-items: center;
	width: 33px;
	height: 33px;
	border-radius: 9px;
	background: var(--mp-primary-soft);
	color: var(--mp-primary);
}

.mp-metric-card__icon .mp-icon {
	width: 17px;
	height: 17px;
}

.mp-metric-card--success .mp-metric-card__icon { background: var(--mp-success-soft); color: var(--mp-success); }
.mp-metric-card--info .mp-metric-card__icon { background: var(--mp-info-soft); color: var(--mp-info); }
.mp-metric-card--warning .mp-metric-card__icon { background: var(--mp-warning-soft); color: var(--mp-warning); }
.mp-metric-card--danger .mp-metric-card__icon { background: var(--mp-danger-soft); color: var(--mp-danger); }

.mp-metric-card__value {
	display: block;
	margin: 14px 0 10px;
	color: var(--mp-ink);
	font-size: 25px;
	font-weight: 780;
	letter-spacing: -.045em;
	line-height: 1;
}

.mp-metric-card__foot {
	gap: 6px;
	color: var(--mp-muted);
	font-size: 10px;
	line-height: 1.25;
}

.mp-metric-card__context {
	display: block;
	color: var(--mp-muted);
}

.mp-change {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	font-size: 11px;
	font-weight: 800;
	white-space: nowrap;
}

.mp-change .mp-icon {
	width: 13px;
	height: 13px;
}

.mp-change--up { color: var(--mp-success); }
.mp-change--down { color: var(--mp-danger); }
.mp-metric-card--warning .mp-change--down { color: var(--mp-warning); }

.mp-dashboard-grid {
	display: grid;
	gap: 18px;
	margin-top: 18px;
}

.mp-dashboard-grid--primary {
	grid-template-columns: minmax(0, 1.5fr) minmax(330px, .9fr);
}

.mp-dashboard-grid--secondary {
	grid-template-columns: minmax(0, 1.42fr) minmax(320px, .98fr);
}

.mp-dashboard-grid--single {
	grid-template-columns: minmax(0, 1fr);
}

.mp-panel {
	min-width: 0;
	padding: 20px;
}

.mp-panel__head {
	justify-content: space-between;
	gap: 15px;
	margin-bottom: 18px;
}

.mp-panel__eyebrow {
	margin: 0 0 2px;
	color: var(--mp-muted);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .09em;
	text-transform: uppercase;
}

.mp-panel h2 {
	margin: 0;
	color: var(--mp-ink);
	font-size: 16px;
	font-weight: 750;
	letter-spacing: -.025em;
	line-height: 1.2;
}

.mp-text-link {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	color: var(--mp-primary);
	font-size: 11px;
	font-weight: 750;
	text-decoration: none;
	white-space: nowrap;
}

.mp-text-link .mp-icon,
.mp-alert-item > a .mp-icon {
	width: 14px;
	height: 14px;
	transform: rotate(0deg);
}

.mp-chart-summary {
	gap: 7px;
	margin-bottom: 15px;
}

.mp-chart-summary > strong {
	font-size: 22px;
	letter-spacing: -.04em;
}

.mp-chart-summary small {
	color: var(--mp-muted);
	font-size: 10px;
}

.mp-chart-summary__detail {
	color: var(--mp-muted);
	font-size: 11px;
	font-weight: 700;
}

.mp-chart {
	position: relative;
	height: 180px;
	margin: 5px 0 0;
	overflow: hidden;
	border-bottom: 1px solid var(--mp-border);
	background-image: linear-gradient(to bottom, transparent 24%, var(--mp-border) 25%, transparent 26%, transparent 49%, var(--mp-border) 50%, transparent 51%, transparent 74%, var(--mp-border) 75%, transparent 76%);
}

.mp-chart canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
}

.mp-chart__fallback {
	position: absolute;
	inset: 12px 4px 1px;
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	align-items: end;
	gap: clamp(4px, 1vw, 12px);
	opacity: .48;
}

.mp-chart[data-mp-ready="true"] .mp-chart__fallback {
	display: none;
}

.mp-chart__fallback span {
	display: block;
	height: var(--mp-height);
	border-radius: 6px 6px 1px 1px;
	background: linear-gradient(180deg, rgba(var(--mp-primary-rgb), .82), rgba(var(--mp-primary-rgb), .2));
}

.mp-chart-labels {
	display: flex;
	justify-content: space-between;
	margin-top: 9px;
	padding: 0 2px;
	color: var(--mp-muted-light);
	font-size: 10px;
}

.mp-task-list,
.mp-alert-list {
	padding: 0;
	margin: 0;
	list-style: none;
}

.mp-task-item {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	padding: 12px 0;
	border-top: 1px solid var(--mp-border);
}

.mp-task-item:first-child {
	border-top: 0;
	padding-top: 1px;
}

.mp-task-item > div {
	min-width: 0;
}

.mp-task-item strong,
.mp-task-item span:not(.mp-badge) {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mp-task-item strong {
	color: var(--mp-ink);
	font-size: 12px;
	font-weight: 700;
}

.mp-task-item div > span {
	margin-top: 3px;
	color: var(--mp-muted);
	font-size: 10px;
}

.mp-task-check {
	display: grid;
	place-items: center;
	width: 21px;
	height: 21px;
	padding: 0;
	border: 1.5px solid var(--mp-border-strong);
	border-radius: 6px;
	background: transparent;
	color: transparent;
	transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.mp-task-check:hover,
.mp-task-check.is-complete {
	border-color: var(--mp-success);
	background: var(--mp-success);
	color: #fff;
}

.mp-task-check .mp-icon {
	width: 14px;
	height: 14px;
	stroke-width: 2.5;
}

.mp-task-state {
	display: grid;
	place-items: center;
	width: 21px;
	height: 21px;
	border: 1px solid var(--mp-border);
	border-radius: 6px;
	background: var(--mp-canvas);
	color: var(--mp-muted);
}

.mp-task-state .mp-icon {
	width: 13px;
	height: 13px;
}

.mp-badge {
	display: inline-flex;
	align-items: center;
	min-height: 20px;
	padding: 3px 7px;
	border-radius: 999px;
	background: var(--mp-info-soft);
	color: var(--mp-info);
	font-size: 9px;
	font-weight: 800;
	line-height: 1;
	white-space: nowrap;
}

.mp-badge--high { background: var(--mp-danger-soft); color: var(--mp-danger); }
.mp-badge--medium { background: var(--mp-warning-soft); color: var(--mp-warning); }
.mp-badge--low { background: var(--mp-info-soft); color: var(--mp-info); }
.mp-badge--completed,
.mp-badge--approved,
.mp-badge--paid { background: var(--mp-success-soft); color: var(--mp-success); }
.mp-badge--cancelled,
.mp-badge--returned { background: var(--mp-danger-soft); color: var(--mp-danger); }
.mp-badge--requested,
.mp-badge--partial { background: var(--mp-warning-soft); color: var(--mp-warning); }

.mp-table-wrap {
	overflow-x: auto;
}

.mp-inline-export-form {
	margin: 0;
}

.mp-table {
	width: 100%;
	min-width: 480px;
	border-collapse: collapse;
	text-align: left;
}

.mp-table th {
	padding: 0 8px 10px;
	border-bottom: 1px solid var(--mp-border);
	color: var(--mp-muted);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .055em;
	text-transform: uppercase;
}

.mp-table th:first-child,
.mp-table td:first-child { padding-left: 0; }
.mp-table th:last-child,
.mp-table td:last-child { padding-right: 0; text-align: right; }

.mp-table td {
	padding: 11px 8px;
	border-bottom: 1px solid var(--mp-border);
	color: var(--mp-muted);
	font-size: 11px;
}

.mp-table tbody tr:last-child td {
	border-bottom: 0;
}

.mp-table td > strong {
	color: var(--mp-ink);
	font-size: 11px;
}

.mp-table__actions-heading,
.mp-table__actions {
	min-width: 112px;
	white-space: nowrap;
}

.mp-table__actions form {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}

.mp-table__actions .mp-record-action + .mp-record-action {
	margin-left: 6px;
}

.mp-table__actions select {
	min-height: 29px;
	max-width: 112px;
	padding: 4px 6px;
	border: 1px solid var(--mp-border-strong);
	border-radius: 7px;
	background: var(--mp-surface-raised);
	color: var(--mp-ink);
	font: inherit;
	font-size: 10px;
}

.mp-table__actions button {
	min-height: 29px;
	padding: 5px 8px;
	border: 1px solid var(--mp-border-strong);
	border-radius: 7px;
	background: var(--mp-surface-raised);
	color: var(--mp-primary);
	font: inherit;
	font-size: 10px;
	font-weight: 750;
	cursor: pointer;
}

.mp-table__actions button:hover,
.mp-table__actions button:focus-visible {
	border-color: var(--mp-primary);
	background: var(--mp-primary-soft);
	outline: none;
}

.mp-panel-empty {
	display: grid;
	gap: 5px;
	min-height: 132px;
	align-content: center;
	padding: 22px;
	border: 1px dashed var(--mp-border-strong);
	border-radius: var(--mp-radius-sm);
	background: color-mix(in srgb, var(--mp-canvas) 62%, transparent);
	color: var(--mp-muted);
	font-size: 12px;
	line-height: 1.45;
}

.mp-panel-empty strong {
	color: var(--mp-ink);
	font-size: 13px;
}

.mp-panel-empty--records {
	min-height: 190px;
	text-align: center;
	justify-items: center;
}

/* Native operational forms. These controls only appear when the server-side
 * allow-list has confirmed the operation and capability. */
.mp-native-action {
	margin-top: 18px;
	padding: 0;
	overflow: hidden;
}

.mp-native-action > summary {
	display: flex;
	align-items: center;
	min-height: 74px;
	margin: 0;
	padding: 18px 20px;
	cursor: pointer;
	list-style: none;
}

.mp-native-action > summary::-webkit-details-marker {
	display: none;
}

.mp-native-action > summary::after {
	width: 8px;
	height: 8px;
	margin-left: auto;
	border-right: 1.5px solid var(--mp-muted);
	border-bottom: 1.5px solid var(--mp-muted);
	content: "";
	transform: rotate(45deg) translateY(-3px);
	transition: transform 160ms ease;
}

.mp-native-action[open] > summary {
	border-bottom: 1px solid var(--mp-border);
}

.mp-native-action[open] > summary::after {
	transform: rotate(225deg) translate(-2px, -2px);
}

.mp-native-action > p,
.mp-native-action > form {
	margin-right: 20px;
	margin-left: 20px;
}

.mp-native-action > p {
	margin-top: 18px;
	margin-bottom: 0;
	color: var(--mp-muted);
	font-size: 12px;
}

.mp-native-action > form {
	margin-top: 16px;
	margin-bottom: 20px;
}

.mp-native-action__fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.mp-native-field {
	display: grid;
	gap: 6px;
	min-width: 0;
}

.mp-native-field--cart {
	grid-column: 1 / -1;
}

.mp-native-field label {
	color: var(--mp-ink);
	font-size: 12px;
	font-weight: 720;
}

.mp-native-field input,
.mp-native-field select,
.mp-native-field textarea {
	width: 100%;
	min-width: 0;
	padding: 9px 10px;
	border: 1px solid var(--mp-border-strong);
	border-radius: 8px;
	outline: none;
	background: var(--mp-surface-raised);
	color: var(--mp-ink);
	font-size: 13px;
	line-height: 1.35;
}

.mp-native-field textarea {
	min-height: 84px;
	resize: vertical;
}

.mp-native-field input:focus,
.mp-native-field select:focus,
.mp-native-field textarea:focus {
	border-color: var(--mp-primary);
	box-shadow: 0 0 0 3px rgba(var(--mp-primary-rgb), .1);
}

.mp-native-field small {
	color: var(--mp-muted);
	font-size: 10px;
	line-height: 1.4;
}

.mp-button--secondary {
	border-color: var(--mp-border-strong);
	background: var(--mp-surface-raised);
	color: var(--mp-primary);
}

.mp-button--secondary:hover,
.mp-button--secondary:focus-visible {
	border-color: var(--mp-primary);
	background: var(--mp-primary-soft);
	color: var(--mp-primary);
	box-shadow: none;
}

.mp-cart-builder {
	display: grid;
	gap: 10px;
	padding: 13px;
	border: 1px solid var(--mp-border);
	border-radius: 10px;
	background: var(--mp-canvas);
}

.mp-cart-builder__controls {
	display: grid;
	grid-template-columns: minmax(150px, 1.7fr) minmax(92px, .55fr) minmax(118px, .7fr) minmax(130px, 1fr) auto;
	align-items: end;
	gap: 8px;
}

.mp-cart-builder__controls label {
	display: block;
}

.mp-cart-builder__controls input,
.mp-cart-builder__controls select {
	width: 100%;
	min-height: 38px;
	padding: 8px 9px;
	border: 1px solid var(--mp-border-strong);
	border-radius: 7px;
	background: var(--mp-surface-raised);
	color: var(--mp-ink);
	font-size: 12px;
}

.mp-cart-builder__controls .mp-button {
	min-height: 38px;
	padding: 8px 11px;
	font-size: 11px;
}

.mp-cart-builder__status {
	min-height: 1.2em;
	margin: 0;
	color: var(--mp-muted);
	font-size: 11px;
}

.mp-product-name {
	gap: 9px;
}

.mp-product-name > span:last-child {
	display: grid;
	gap: 1px;
}

.mp-product-name strong {
	color: var(--mp-ink);
	font-size: 11px;
	font-weight: 700;
}

.mp-product-name small {
	color: var(--mp-muted-light);
	font-size: 9px;
}

.mp-product-thumb {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: var(--mp-primary-soft);
	color: var(--mp-primary);
}

.mp-product-thumb .mp-icon {
	width: 15px;
	height: 15px;
}

.mp-alert-list {
	display: grid;
	gap: 2px;
}

.mp-alert-item {
	align-items: flex-start;
	gap: 10px;
	padding: 11px 0;
	border-top: 1px solid var(--mp-border);
}

.mp-alert-item:first-child {
	border-top: 0;
	padding-top: 1px;
}

.mp-alert-item__icon {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 31px;
	height: 31px;
	border-radius: 9px;
	background: var(--mp-info-soft);
	color: var(--mp-info);
}

.mp-alert-item__icon .mp-icon {
	width: 16px;
	height: 16px;
}

.mp-alert-item__icon--warning { background: var(--mp-warning-soft); color: var(--mp-warning); }
.mp-alert-item__icon--danger { background: var(--mp-danger-soft); color: var(--mp-danger); }
.mp-alert-item__icon--success { background: var(--mp-success-soft); color: var(--mp-success); }

.mp-alert-item > div {
	min-width: 0;
	flex: 1;
}

.mp-alert-item strong {
	display: block;
	color: var(--mp-ink);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.35;
}

.mp-alert-item p {
	margin: 3px 0 0;
	color: var(--mp-muted);
	font-size: 10px;
	line-height: 1.4;
}

.mp-alert-item > a {
	display: grid;
	place-items: center;
	width: 24px;
	height: 25px;
	border-radius: 6px;
	color: var(--mp-muted);
}

.mp-alert-item > a:hover {
	background: var(--mp-canvas);
	color: var(--mp-primary);
}

.mp-toast-region {
	position: fixed;
	right: 22px;
	bottom: 22px;
	display: grid;
	width: min(360px, calc(100vw - 32px));
	gap: 8px;
	z-index: 100;
	pointer-events: none;
}

.mp-toast {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid var(--mp-border);
	border-radius: 11px;
	background: var(--mp-surface-raised);
	box-shadow: var(--mp-shadow-lg);
	color: var(--mp-ink);
	font-size: 12px;
	animation: mp-toast-in 200ms ease-out;
	pointer-events: auto;
}

.mp-toast--success .mp-icon { color: var(--mp-success); }
.mp-toast--info .mp-icon { color: var(--mp-info); }

@keyframes mp-toast-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

.mp-empty-state {
	max-width: 560px;
	margin: 76px auto;
	padding: 40px;
	border: 1px solid var(--mp-border);
	border-radius: var(--mp-radius);
	background: var(--mp-surface);
	box-shadow: var(--mp-shadow);
	text-align: center;
}

.mp-empty-state__code {
	display: block;
	margin-bottom: 8px;
	color: var(--mp-primary);
	font-size: 54px;
	font-weight: 800;
	letter-spacing: -.08em;
	line-height: 1;
}

/* Public content compatibility. */
.mp-public-header,
.mp-public-footer {
	background: var(--mp-surface);
}

.mp-public-header {
	border-bottom: 1px solid var(--mp-border);
}

.mp-public-header__inner,
.mp-public-footer__inner,
.mp-public-content__inner {
	width: min(1180px, calc(100% - 40px));
	margin: 0 auto;
}

.mp-public-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	min-height: 72px;
}

.mp-public-brand a {
	color: var(--mp-ink);
	font-size: 19px;
	font-weight: 800;
	letter-spacing: -.04em;
	text-decoration: none;
}

.mp-public-brand .custom-logo-link {
	display: block;
}

.mp-public-brand .custom-logo {
	max-width: 180px;
	max-height: 42px;
	width: auto;
}

.mp-public-nav .menu {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 0;
	margin: 0;
	list-style: none;
}

.mp-public-nav a {
	color: var(--mp-muted);
	font-size: 13px;
	font-weight: 650;
	text-decoration: none;
}

.mp-public-nav a:hover { color: var(--mp-primary); }

.mp-public-content {
	min-height: calc(100vh - 144px);
	padding: 48px 0;
}

.mp-article,
.mp-empty-state--page {
	padding: clamp(24px, 4vw, 48px);
	border: 1px solid var(--mp-border);
	border-radius: var(--mp-radius);
	background: var(--mp-surface);
	box-shadow: var(--mp-shadow);
}

.mp-article__title {
	margin: 0 0 22px;
	font-size: clamp(28px, 4vw, 42px);
	letter-spacing: -.05em;
}

.mp-article__content > *:first-child { margin-top: 0; }
.mp-article__content > *:last-child { margin-bottom: 0; }

.mp-public-footer {
	border-top: 1px solid var(--mp-border);
}

.mp-public-footer__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 72px;
	color: var(--mp-muted);
	font-size: 12px;
}

.mp-public-footer p { margin: 0; }

/* WooCommerce keeps its own business logic while inheriting MercadoPro visuals. */
.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-error {
	border-top-color: var(--mp-primary);
	background: var(--mp-surface);
	color: var(--mp-ink);
}

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
	border-radius: 10px;
	background: var(--mp-primary);
	color: #fff;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover {
	background: var(--mp-primary-strong);
	color: #fff;
}

/* Recolhido em telas amplas. */
.mp-app-shell.is-sidebar-collapsed {
	grid-template-columns: 76px minmax(0, 1fr);
}

.mp-app-shell.is-sidebar-collapsed .mp-sidebar {
	width: 76px;
}

.mp-app-shell.is-sidebar-collapsed .mp-brand__text,
.mp-app-shell.is-sidebar-collapsed .mp-nav-link span,
.mp-app-shell.is-sidebar-collapsed .mp-nav-group,
.mp-app-shell.is-sidebar-collapsed .mp-sidebar__collapse {
	display: none;
}

.mp-app-shell.is-sidebar-collapsed .mp-brand__logo {
	max-width: 38px;
}

.mp-app-shell.is-sidebar-collapsed .mp-sidebar__brand {
	justify-content: center;
	padding: 0;
}

.mp-app-shell.is-sidebar-collapsed .mp-nav-link {
	justify-content: center;
	padding: 10px;
}

.mp-app-shell.is-sidebar-collapsed .mp-sidebar__nav {
	padding-right: 10px;
	padding-left: 10px;
}

@media (max-width: 1200px) {
	.mp-topbar { padding-right: 24px; padding-left: 24px; }
	.mp-app-content { padding-right: 24px; padding-left: 24px; }
	.mp-metric-grid { gap: 12px; }
	.mp-metric-card { padding: 15px; }
	.mp-dashboard-grid--primary { grid-template-columns: minmax(0, 1.25fr) minmax(300px, .9fr); }
}

@media (max-width: 1020px) {
	.mp-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mp-dashboard-grid--primary,
	.mp-dashboard-grid--secondary { grid-template-columns: 1fr; }
	.mp-priority-panel { order: 2; }
}

@media (max-width: 820px) {
	.mp-app-shell,
	.mp-app-shell.is-sidebar-collapsed { display: block; }
	.mp-sidebar,
	.mp-app-shell.is-sidebar-collapsed .mp-sidebar {
		position: fixed;
		left: 0;
		width: min(280px, calc(100vw - 48px));
		transform: translateX(-105%);
		box-shadow: var(--mp-shadow-lg);
	}
	.mp-app-shell.is-mobile-menu-open .mp-sidebar { transform: translateX(0); }
	.mp-app-shell.is-mobile-menu-open::after {
		position: fixed;
		inset: 0;
		background: rgba(5, 12, 20, .48);
		content: "";
		z-index: 45;
	}
	.mp-sidebar__collapse { display: none; }
	.mp-mobile-menu { display: inline-grid; }
	.mp-global-search { width: min(410px, 47vw); }
	.mp-user-menu__text { display: none; }
	.mp-user-menu > .mp-icon { display: none; }
	.mp-user-menu { padding: 2px; }
	.mp-topbar { padding: 11px 18px; }
	.mp-app-content { padding: 24px 18px 38px; }
	.mp-page-head { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
	.mp-page-head__actions { justify-content: flex-start; }
	.mp-cart-builder__controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mp-cart-builder__controls .mp-button { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
	.mp-topbar__end { gap: 3px; }
	.mp-global-search { width: auto; min-width: 0; padding: 0; border-color: transparent; background: transparent; }
	.mp-global-search input,
	.mp-global-search kbd { display: none; }
	.mp-global-search .mp-icon { width: 20px; height: 20px; }
	.mp-global-search:focus-within { border-color: transparent; background: transparent; box-shadow: none; }
	.mp-icon-button { width: 36px; height: 36px; }
	.mp-count { top: 1px; right: 1px; }
	.mp-page-head__actions { width: 100%; }
	.mp-page-head__actions .mp-unit-select,
	.mp-page-head__actions .mp-date-select { flex: 1 1 120px; }
	.mp-page-head__actions .mp-button { flex: 1 0 100%; }
	.mp-metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
	.mp-metric-card { min-height: 132px; padding: 13px; }
	.mp-metric-card__value { margin: 13px 0 8px; font-size: 21px; }
	.mp-metric-card__foot { display: block; }
	.mp-metric-card__foot > span:last-child { display: block; margin-top: 2px; }
	.mp-panel { padding: 16px; }
	.mp-chart { height: 154px; }
	.mp-panel__head { margin-bottom: 15px; }
	.mp-panel h2 { font-size: 15px; }
	.mp-native-action > summary { min-height: 66px; padding: 15px 16px; }
	.mp-native-action > p,
	.mp-native-action > form { margin-right: 16px; margin-left: 16px; }
	.mp-native-action__fields { grid-template-columns: 1fr; }
	.mp-cart-builder__controls { grid-template-columns: 1fr; }
	.mp-cart-builder__controls .mp-button { grid-column: auto; }
	.mp-popover { position: fixed; top: 60px; right: 12px; left: 12px; width: auto; }
	.mp-notifications { max-height: calc(100vh - 78px); overflow-y: auto; }
	.mp-public-header__inner { min-height: 64px; }
	.mp-public-nav { display: none; }
	.mp-public-footer__inner { align-items: flex-start; flex-direction: column; justify-content: center; padding: 14px 0; }
}

@media (max-width: 390px) {
	.mp-page-head h1 { font-size: 23px; }
	.mp-metric-card__top { font-size: 10px; }
	.mp-metric-card__icon { width: 29px; height: 29px; }
	.mp-metric-card__value { font-size: 19px; }
	.mp-system-notice { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: .01ms !important;
	}
}
