/* ATL Marketplace Order Manager — scoped styles. Everything lives under .mom-scope. */

.mom-scope {
	--mom-ink: #17152b;
	--mom-ink-2: #3d3a55;
	--mom-muted: #6b6880;
	--mom-line: #e6e4ef;
	--mom-line-2: #f0eff6;
	--mom-canvas: #f7f6fb;
	--mom-paper: #ffffff;
	--mom-violet: #5b3df5;
	--mom-violet-ink: #4128d6;
	--mom-violet-wash: #efebff;
	--mom-teal: #14b8a6;
	--mom-teal-ink: #0f8a7c;
	--mom-amber: #d97706;
	--mom-rose: #e11d48;
	--mom-radius: 10px;
	--mom-radius-sm: 6px;
	--mom-display: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
	--mom-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--mom-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-family: var(--mom-body);
	font-size: 14px;
	line-height: 1.5;
	color: var(--mom-ink);
	-webkit-font-smoothing: antialiased;
}
.mom-scope *, .mom-scope *::before, .mom-scope *::after { box-sizing: border-box; }
.mom-scope h2, .mom-scope h3 { font-family: var(--mom-display); color: var(--mom-ink); margin: 0; letter-spacing: -0.01em; }
.mom-scope p { margin: 0; }
.mom-scope button { font-family: inherit; }
.mom-scope :focus-visible { outline: 2px solid var(--mom-violet); outline-offset: 2px; }
.mom-scope [hidden] { display: none !important; }
.mom-scope .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Contexts */
body.mom-admin-screen, .mom-admin-screen #wpcontent { background: #f7f6fb; }
.mom-wrap { margin: 16px 20px 40px 0; }
.mom-ctx-front { background: var(--mom-canvas); border-radius: var(--mom-radius); padding: 20px; }
.is-layout-constrained > .mom-root.mom-ctx-front, .entry-content > .mom-root.mom-ctx-front { max-width: min(1320px, 100%); margin-left: auto !important; margin-right: auto !important; }
.mom-boot { padding: 40px; color: #6b6880; }

/* Portal shell */
.mom-shell { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 24px; }
.mom-shell > * { min-width: 0; }
.mom-scope { max-width: 100%; }
.mom-nav { position: sticky; top: 16px; align-self: start; }
.mom-brand { font-family: var(--mom-display); font-weight: 700; font-size: 17px; padding: 4px 12px 16px; }
.mom-nav ul { list-style: none; margin: 0; padding: 0; }
.mom-nav a { display: block; padding: 8px 12px; border-radius: var(--mom-radius-sm); color: var(--mom-ink-2); text-decoration: none; font-weight: 500; }
.mom-nav a:hover { background: var(--mom-paper); color: var(--mom-ink); }
.mom-nav a.is-active { background: var(--mom-ink); color: #fff; }
.mom-nav-foot { margin-top: 20px; padding: 12px; border-top: 1px solid var(--mom-line); font-size: 13px; color: var(--mom-muted); display: flex; flex-direction: column; gap: 4px; }
.mom-nav-foot a { padding: 0; color: var(--mom-violet); }
.mom-main { min-width: 0; }
.mom-topbar { display: flex; justify-content: flex-end; margin-bottom: -38px; position: relative; z-index: 5; pointer-events: none; }
.mom-topbar > * { pointer-events: auto; }
.mom-view:focus { outline: none; }

/* Page head */
.mom-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 48px 18px 0; flex-wrap: wrap; }
.mom-title { font-size: 26px; font-weight: 600; line-height: 1.15; }
.mom-sub { color: var(--mom-muted); margin-top: 4px; max-width: 70ch; }
.mom-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Buttons */
.mom-scope .mom-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	height: 36px; padding: 0 14px; border-radius: var(--mom-radius-sm);
	border: 1px solid var(--mom-line); background: var(--mom-paper); color: var(--mom-ink);
	font-size: 13.5px; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
	transition: background-color .12s, border-color .12s, color .12s;
}
.mom-scope .mom-btn:hover { border-color: #cfcbe0; background: #fbfaff; color: var(--mom-ink); }
.mom-scope .mom-btn:disabled { opacity: .5; cursor: not-allowed; }
.mom-scope .mom-btn-primary { background: var(--mom-violet); border-color: var(--mom-violet); color: #fff; }
.mom-scope .mom-btn-primary:hover { background: var(--mom-violet-ink); border-color: var(--mom-violet-ink); color: #fff; }
.mom-scope .mom-btn-danger { background: var(--mom-rose); border-color: var(--mom-rose); color: #fff; }
.mom-scope .mom-btn-danger:hover { background: #be123c; border-color: #be123c; color: #fff; }
.mom-scope .mom-btn-ghost { background: transparent; border-color: transparent; }
.mom-scope .mom-btn-ghost:hover { background: var(--mom-line-2); border-color: transparent; }
.mom-scope .mom-btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.mom-scope .mom-btn.is-busy { position: relative; color: transparent !important; }
.mom-scope .mom-btn.is-busy::after { content: ''; position: absolute; width: 14px; height: 14px; border: 2px solid currentColor; border-color: #9a93c9 transparent #9a93c9 transparent; border-radius: 50%; animation: mom-spin .7s linear infinite; }
.mom-scope .mom-danger-text { color: var(--mom-rose) !important; }
.mom-scope .mom-link { background: none; border: 0; padding: 0; color: var(--mom-violet); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; }
.mom-scope .mom-icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--mom-line); background: var(--mom-paper); color: var(--mom-ink-2); cursor: pointer; font-size: 20px; line-height: 1; }
.mom-scope .mom-icon-btn:hover { color: var(--mom-ink); border-color: #cfcbe0; }
@keyframes mom-spin { to { transform: rotate(360deg); } }

/* Inputs */
.mom-scope input[type=text], .mom-scope input[type=search], .mom-scope input[type=email], .mom-scope input[type=tel],
.mom-scope input[type=number], .mom-scope input[type=date], .mom-scope input[type=password], .mom-scope select, .mom-scope textarea {
	height: 36px; padding: 0 10px; border: 1px solid var(--mom-line); border-radius: var(--mom-radius-sm);
	background: var(--mom-paper); color: var(--mom-ink); font: inherit; font-size: 13.5px; max-width: 100%; box-shadow: none; margin: 0; min-height: 0; line-height: normal;
}
.mom-scope select { padding-right: 28px; }
.mom-scope textarea { height: auto; padding: 8px 10px; resize: vertical; width: 100%; }
.mom-scope input[type=color] { height: 36px; width: 64px; padding: 2px; border: 1px solid var(--mom-line); border-radius: var(--mom-radius-sm); background: #fff; }
.mom-scope input:focus, .mom-scope select:focus, .mom-scope textarea:focus { border-color: var(--mom-violet); box-shadow: 0 0 0 3px var(--mom-violet-wash); outline: none; }

/* Toolbar & filters */
.mom-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.mom-search { flex: 1 1 260px; min-width: 200px; }
.mom-range { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mom-range-custom { display: inline-flex; gap: 6px; align-items: center; color: var(--mom-muted); }
.mom-userpick { display: inline-flex; gap: 4px; }
.mom-userpick-q { width: 130px; }
.mom-filters { background: var(--mom-paper); border: 1px solid var(--mom-line); border-radius: var(--mom-radius); padding: 14px 14px 12px; margin-bottom: 14px; }
.mom-filters .mom-toolbar { margin-bottom: 10px; }
.mom-filter-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; padding: 12px 0; border-top: 1px dashed var(--mom-line); margin-bottom: 10px; }
.mom-filter-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mom-chip { display: inline-flex; padding: 3px 10px; border-radius: 999px; background: var(--mom-violet-wash); color: var(--mom-violet-ink); font-size: 12px; font-weight: 500; }

/* Panels & grids */
.mom-panel { background: var(--mom-paper); border: 1px solid var(--mom-line); border-radius: var(--mom-radius); padding: 18px; min-width: 0; }
.mom-panel.is-full { margin-bottom: 16px; }
.mom-panel-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.mom-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.mom-grid-uneven { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
[data-body].is-stale, [data-table].is-stale { opacity: .55; transition: opacity .15s; pointer-events: none; }

/* KPI cards */
.mom-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.mom-kpis-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.mom-kpi { background: var(--mom-paper); border: 1px solid var(--mom-line); border-radius: var(--mom-radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mom-kpi-label { color: var(--mom-muted); font-size: 12.5px; font-weight: 500; }
.mom-kpi-value { font-family: var(--mom-display); font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mom-kpi-foot { font-size: 12px; color: var(--mom-muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mom-kpi-net { background: var(--mom-ink); border-color: var(--mom-ink); }
.mom-kpi-net .mom-kpi-label, .mom-kpi-net .mom-kpi-foot { color: #b9b5d3; }
.mom-kpi-net .mom-kpi-value { color: #fff; }
.mom-delta { font-weight: 600; font-size: 11.5px; padding: 1px 6px; border-radius: 999px; background: var(--mom-line-2); color: var(--mom-ink-2); }
.mom-delta.is-up { background: #dcf7f2; color: var(--mom-teal-ink); }
.mom-delta.is-down { background: #ffe4ea; color: #be123c; }
.mom-kpi-net .mom-delta.is-up { background: rgba(20, 184, 166, .22); color: #5eead4; }
.mom-kpi-net .mom-delta.is-down { background: rgba(225, 29, 72, .25); color: #fda4af; }

/* Order flow — the pipeline from ordered to money */
.mom-flow { background: var(--mom-paper); border: 1px solid var(--mom-line); border-radius: var(--mom-radius); padding: 18px 18px 14px; margin-bottom: 16px; }
.mom-flow > ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.1fr); gap: 0; }
.mom-flow-stage, .mom-flow-money { position: relative; padding: 0 18px; }
.mom-flow-stage:first-child { padding-left: 0; }
.mom-flow-stage + .mom-flow-stage::before, .mom-flow-money::before {
	content: ''; position: absolute; left: -7px; top: 1px; width: 12px; height: 12px;
	border-top: 2px solid #c9c4e6; border-right: 2px solid #c9c4e6; transform: rotate(45deg);
}
.mom-flow-money { border-left: 1px solid var(--mom-line); padding-left: 22px; }
.mom-flow-money::before { display: none; }
.mom-flow-bar { height: 14px; background: var(--mom-line-2); border-radius: 3px; overflow: hidden; }
.mom-flow-bar span { display: block; height: 100%; border-radius: 3px; }
.mom-flow-orders .mom-flow-bar span { background: var(--mom-ink); }
.mom-flow-dispatched .mom-flow-bar span { background: var(--mom-violet); }
.mom-flow-delivered .mom-flow-bar span { background: var(--mom-teal); }
.mom-flow-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 8px; }
.mom-flow-meta span { color: var(--mom-muted); font-size: 12.5px; }
.mom-flow-meta b { font-family: var(--mom-display); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mom-flow-money .mom-flow-meta { margin-top: 0; flex-direction: column; align-items: flex-start; gap: 0; }
.mom-flow-money .mom-flow-meta b { font-size: 26px; }
.mom-flow-leaks { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--mom-ink-2); }
.mom-flow-leaks li { display: flex; align-items: center; gap: 6px; }
.mom-flow-leaks li b { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.mom-flow-leaks i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.mom-leak-pending i { background: #ca8a04; }
.mom-leak-cancelled i { background: #9ca3af; }
.mom-leak-rto i { background: var(--mom-rose); }
.mom-leak-returned i { background: var(--mom-amber); }
.mom-leak-exchange i { background: #0891b2; }
.is-neg { color: var(--mom-rose) !important; }

/* Tables */
.mom-table-wrap { overflow-x: auto; border: 1px solid var(--mom-line); border-radius: var(--mom-radius); background: var(--mom-paper); }
.mom-panel .mom-table-wrap { border: 0; border-radius: 0; margin: 0 -18px; }
.mom-scope .mom-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mom-table th { text-align: left; font-weight: 600; color: var(--mom-muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--mom-line); background: #fcfbfe; white-space: nowrap; }
.mom-table th button { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.mom-table th.is-sorted { color: var(--mom-ink); }
.mom-table td { padding: 10px 12px; border-bottom: 1px solid var(--mom-line-2); vertical-align: middle; }
.mom-table tbody tr:hover td { background: #fbfaff; }
.mom-table tbody tr.is-selected td { background: var(--mom-violet-wash); }
.mom-table tr:last-child td { border-bottom: 0; }
.mom-table tfoot th { color: var(--mom-ink); background: #fcfbfe; border-top: 1px solid var(--mom-line); border-bottom: 0; }
.mom-table tfoot td { font-weight: 600; border-top: 1px solid var(--mom-line); background: #fcfbfe; }
.mom-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mom-table-compact td, .mom-table-compact th { padding: 8px 12px; }
.mom-table tr.is-muted td { opacity: .6; }
.mom-table tr.is-invalid td { background: #fff6f7; }
.mom-table-orders td, .mom-table-report td, .mom-table-compact td { white-space: nowrap; }
.mom-col-check { width: 36px; }
.mom-col-actions { width: 1%; }
.mom-row-actions { display: flex; gap: 2px; justify-content: flex-end; white-space: nowrap; align-items: center; }
.mom-scope .mom-table td.mom-row-actions { display: table-cell; text-align: right; }
.mom-scope .mom-table td.mom-row-actions > * { vertical-align: middle; }
.mom-ellipsis { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mom-nowrap { white-space: nowrap; }
.mom-mono { font-family: var(--mom-mono); font-size: 12.5px; }
.mom-muted { color: var(--mom-muted); }
.mom-table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 2px 0; }
.mom-sums { display: flex; gap: 16px; color: var(--mom-muted); font-size: 13px; flex-wrap: wrap; }
.mom-sums b { color: var(--mom-ink); font-variant-numeric: tabular-nums; }
.mom-pager { display: flex; align-items: center; gap: 12px; color: var(--mom-muted); font-size: 13px; flex-wrap: wrap; margin-top: 12px; }
.mom-table-foot .mom-pager { margin-top: 0; }
.mom-pager-btns { display: flex; gap: 4px; align-items: center; }
.mom-pager-cur { padding: 0 6px; }

/* Bulk bar */
.mom-bulk { position: sticky; top: 40px; z-index: 4; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--mom-ink); color: #fff; padding: 8px 12px; border-radius: var(--mom-radius); margin-bottom: 12px; }
.mom-bulk span { font-weight: 600; margin-right: 4px; }
.mom-bulk select { height: 30px; }
.mom-scope .mom-bulk .mom-btn-ghost { color: #d6d3ea; }
.mom-scope .mom-bulk .mom-btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }

/* Badges */
.mom-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--mom-line-2); color: var(--mom-ink-2); white-space: nowrap; text-transform: capitalize; }
.mom-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.mom-st-new { background: #f1f5f9; color: #475569; }
.mom-st-confirmed { background: #e0f2fe; color: #0369a1; }
.mom-st-processing { background: #e0e7ff; color: #4338ca; }
.mom-st-packed { background: #f3e8ff; color: #7e22ce; }
.mom-st-dispatched { background: var(--mom-violet-wash); color: var(--mom-violet-ink); }
.mom-st-delivered { background: #dcf7f2; color: var(--mom-teal-ink); }
.mom-st-cancelled { background: #f3f4f6; color: #6b7280; }
.mom-st-returned { background: #fef3c7; color: #b45309; }
.mom-st-rto { background: #ffe4ea; color: #be123c; }
.mom-st-exchange { background: #cffafe; color: #0e7490; }
.mom-st-pending { background: #fef9c3; color: #a16207; }
.mom-imp-completed { background: #dcf7f2; color: var(--mom-teal-ink); }
.mom-imp-running, .mom-imp-mapped, .mom-imp-uploaded { background: var(--mom-violet-wash); color: var(--mom-violet-ink); }
.mom-imp-cancelled { background: #f3f4f6; color: #6b7280; }
.mom-mkt { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 500; }
.mom-mkt i { width: 8px; height: 8px; border-radius: 2px; flex: none; }

/* Forms */
.mom-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px 16px; }
.mom-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.mom-field.is-wide, .mom-form-grid > .is-wide { grid-column: 1 / -1; }
.mom-field > label { font-size: 12.5px; font-weight: 600; color: var(--mom-ink-2); }
.mom-field > label em { color: var(--mom-rose); font-style: normal; }
.mom-field input, .mom-field select { width: 100%; }
.mom-help { color: var(--mom-muted); font-size: 12px; line-height: 1.45; }
.mom-check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 13.5px; padding: 4px 0; }
.mom-check input { margin: 2px 0 0; }
.mom-checks { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.mom-fieldset { border: 1px solid var(--mom-line); border-radius: var(--mom-radius); padding: 16px 18px 18px; margin: 0 0 14px; background: var(--mom-paper); min-width: 0; }
.mom-fieldset legend { font-family: var(--mom-display); font-weight: 600; font-size: 15px; padding: 0 6px; margin-left: -6px; }
.mom-settings .mom-fieldset { background: #fcfbfe; margin: 0; }
.mom-form-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.mom-order-form { max-width: 1100px; }
.mom-order-form .mom-form-actions { position: sticky; bottom: 0; background: linear-gradient(to top, var(--mom-canvas) 70%, transparent); padding: 14px 0 8px; margin-top: 0; z-index: 3; }
.mom-admin-screen .mom-order-form .mom-form-actions { background: linear-gradient(to top, #f7f6fb 70%, transparent); }
.mom-owner { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.mom-net-preview { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; background: var(--mom-ink); color: #d6d3ea; border-radius: var(--mom-radius); padding: 12px 18px; margin: -6px 0 14px; font-size: 13px; }
.mom-net-preview b { color: #fff; font-variant-numeric: tabular-nums; }
.mom-net-preview .mom-net-total { margin-left: auto; font-size: 15px; }
.mom-net-preview .mom-net-total b { font-family: var(--mom-display); font-size: 20px; }
.mom-net-preview .mom-net-total.is-neg b { color: #fda4af; }
.mom-net-preview small { flex-basis: 100%; color: #a19dbd; }

/* Tabs */
.mom-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--mom-line); margin-bottom: 16px; overflow-x: auto; }
.mom-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; margin-bottom: -1px; font: inherit; font-weight: 500; color: var(--mom-muted); cursor: pointer; white-space: nowrap; }
.mom-tabs button:hover { color: var(--mom-ink); }
.mom-tabs button[aria-selected=true] { color: var(--mom-ink); border-bottom-color: var(--mom-violet); }

/* Menus */
.mom-menu { position: relative; display: inline-block; }
.mom-menu-list { position: absolute; right: 0; top: calc(100% + 4px); min-width: 210px; background: var(--mom-paper); border: 1px solid var(--mom-line); border-radius: var(--mom-radius); box-shadow: 0 12px 32px rgba(23, 21, 43, .12); padding: 4px; z-index: 20; }
.mom-menu-list button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: var(--mom-radius-sm); font: inherit; color: var(--mom-ink); cursor: pointer; }
.mom-menu-list button:hover { background: var(--mom-line-2); }

/* Notifications */
.mom-notif { position: relative; }
.mom-notif-count { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--mom-rose); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }
.mom-notif-panel { position: absolute; right: 0; top: calc(100% + 6px); width: 340px; max-height: 420px; overflow: auto; background: var(--mom-paper); border: 1px solid var(--mom-line); border-radius: var(--mom-radius); box-shadow: 0 16px 40px rgba(23, 21, 43, .14); z-index: 30; }
.mom-notif-panel header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--mom-line); position: sticky; top: 0; background: var(--mom-paper); }
.mom-notif-panel ul { list-style: none; margin: 0; padding: 0; }
.mom-notif-panel li { padding: 10px 14px 10px 16px; border-bottom: 1px solid var(--mom-line-2); position: relative; }
.mom-notif-panel li.is-unread::before { content: ''; position: absolute; left: 6px; top: 16px; width: 6px; height: 6px; border-radius: 50%; background: var(--mom-violet); }
.mom-notif-panel li p { font-size: 13px; }
.mom-notif-panel li small { color: var(--mom-muted); font-size: 11.5px; }
.mom-notif-panel > p { padding: 16px 14px; }
.mom-n-error p { color: #be123c; }

/* Modal */
.mom-modal-open { overflow: hidden; }
.mom-modal-backdrop { position: fixed; inset: 0; background: rgba(23, 21, 43, .45); z-index: 100000; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.mom-modal { background: var(--mom-paper); border-radius: 12px; width: 100%; max-width: 560px; box-shadow: 0 24px 64px rgba(23, 21, 43, .3); display: flex; flex-direction: column; max-height: 88vh; animation: mom-pop .16s ease-out; }
.mom-modal.is-wide { max-width: 1000px; }
.mom-modal > header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--mom-line); }
.mom-modal > header h2 { font-size: 18px; }
.mom-modal > header .mom-icon-btn { border: 0; }
.mom-modal-body { padding: 20px; overflow-y: auto; }
.mom-modal-body > p { margin-bottom: 14px; }
.mom-modal > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--mom-line); }
.mom-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
@keyframes mom-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Order detail */
.mom-detail-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--mom-line); margin-bottom: 16px; }
.mom-detail-net { margin-left: auto; color: var(--mom-muted); }
.mom-detail-net b { font-family: var(--mom-display); font-size: 20px; color: var(--mom-ink); margin-left: 4px; }
.mom-detail-net.is-neg b { color: var(--mom-rose); }
.mom-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; }
.mom-detail-sec { margin-bottom: 18px; }
.mom-detail-sec h3, .mom-detail-grid aside h3 { font-size: 13.5px; margin-bottom: 8px; }
.mom-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px; margin: 0; }
.mom-dl dt { font-size: 12px; color: var(--mom-muted); }
.mom-dl dd { margin: 0; font-size: 13.5px; word-break: break-word; }
.mom-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.mom-timeline li { display: flex; gap: 10px; padding-bottom: 14px; position: relative; }
.mom-timeline li:not(:last-child)::after { content: ''; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--mom-line); }
.mom-tl-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 3px; flex: none; background: var(--mom-violet); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--mom-line); }
.mom-tl-delivered .mom-tl-dot { background: var(--mom-teal); }
.mom-tl-rto .mom-tl-dot { background: var(--mom-rose); }
.mom-tl-returned .mom-tl-dot { background: var(--mom-amber); }
.mom-tl-cancelled .mom-tl-dot { background: #9ca3af; }
.mom-timeline b { display: block; font-size: 13px; }
.mom-timeline small { color: var(--mom-muted); font-size: 12px; }

/* Stats lists */
.mom-stat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 0; }
.mom-stat-list dt { font-size: 12px; color: var(--mom-muted); }
.mom-stat-list dd { margin: 0; font-family: var(--mom-display); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mom-stat-list .is-warn dd { color: var(--mom-rose); }
.mom-stat-inline { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--mom-line); }
.mom-stat-inline dd { font-size: 16px; }

/* Import */
.mom-steps { list-style: none; margin: 0 0 16px; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; counter-reset: s; }
.mom-steps li { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; color: var(--mom-muted); font-weight: 500; font-size: 13px; }
.mom-steps li span { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--mom-line-2); font-size: 12px; font-weight: 600; }
.mom-steps li.is-current { background: var(--mom-paper); color: var(--mom-ink); box-shadow: inset 0 0 0 1px var(--mom-line); }
.mom-steps li.is-current span { background: var(--mom-violet); color: #fff; }
.mom-steps li.is-done span { background: var(--mom-teal); color: #fff; }
.mom-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 34px 20px; border: 2px dashed #d4d0e8; border-radius: var(--mom-radius); text-align: center; cursor: pointer; margin-bottom: 18px; background: #fcfbfe; }
.mom-drop.is-over, .mom-drop:hover { border-color: var(--mom-violet); background: var(--mom-violet-wash); }
.mom-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mom-drop strong { font-family: var(--mom-display); font-size: 16px; }
.mom-drop span { color: var(--mom-muted); font-size: 13px; }
.mom-drop em { font-style: normal; font-family: var(--mom-mono); font-size: 12.5px; color: var(--mom-violet-ink); }
.mom-map-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.mom-map-head .mom-toolbar { margin: 0; }
.mom-map-table select { width: 100%; min-width: 200px; }
.mom-validate { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.mom-validate > div { border: 1px solid var(--mom-line); border-radius: var(--mom-radius); padding: 12px 14px; font-size: 13px; color: var(--mom-ink-2); }
.mom-validate b { display: block; font-family: var(--mom-display); font-size: 22px; color: var(--mom-ink); }
.mom-validate .is-ok { border-color: #99e6da; background: #f0fdfa; }
.mom-validate .is-warn { border-color: #fecdd3; background: #fff6f7; }
.mom-err { color: #be123c; font-size: 12px; }
.mom-ok { color: var(--mom-teal-ink); font-weight: 700; }
.mom-progress { height: 10px; background: var(--mom-line-2); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.mom-progress span { display: block; height: 100%; width: 0; background: var(--mom-violet); transition: width .3s; }
.mom-progress-wrap { padding: 20px 0; }
.mom-done h3 { font-size: 20px; margin-bottom: 14px; }

/* Charts */
.mom-chart { position: relative; }
.mom-chart svg { display: block; overflow: visible; }
.mom-chart .mom-grid { stroke: var(--mom-line-2); stroke-width: 1; }
.mom-chart .mom-axis { fill: var(--mom-muted); font-size: 11px; font-family: var(--mom-body); }
.mom-chart .mom-bar-val { fill: var(--mom-ink-2); font-size: 11px; font-weight: 600; font-family: var(--mom-body); }
.mom-chart .mom-guide { stroke: #c9c4e6; stroke-dasharray: 3 3; }
.mom-chart .mom-slice { stroke: #fff; stroke-width: 2; cursor: pointer; }
.mom-chart .mom-slice:hover { opacity: .85; }
.mom-donut-total { font-family: var(--mom-display); font-size: 26px; font-weight: 600; fill: var(--mom-ink); }
.mom-donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.mom-donut-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 160px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.mom-donut-legend li { display: flex; align-items: center; gap: 8px; }
.mom-donut-legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.mom-donut-legend i, .mom-legend i, .mom-chart-tip i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex: none; }
.mom-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--mom-ink-2); margin-top: 6px; }
.mom-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mom-chart-tip { position: absolute; display: none; pointer-events: none; background: var(--mom-ink); color: #fff; border-radius: var(--mom-radius-sm); padding: 7px 10px; font-size: 12px; z-index: 10; white-space: nowrap; box-shadow: 0 8px 20px rgba(23, 21, 43, .25); }
.mom-chart-tip strong { display: block; margin-bottom: 2px; }
.mom-chart-tip span { display: flex; align-items: center; gap: 6px; color: #d6d3ea; }
.mom-chart-empty { height: 200px; display: flex; align-items: center; justify-content: center; color: var(--mom-muted); background: repeating-linear-gradient(-45deg, transparent 0 10px, #faf9fd 10px 20px); border-radius: var(--mom-radius-sm); }

/* Empty, loading, notices, toasts */
.mom-empty { text-align: center; padding: 48px 20px; background: var(--mom-paper); border: 1px dashed var(--mom-line); border-radius: var(--mom-radius); }
.mom-panel .mom-empty { border: 0; padding: 24px 12px; }
.mom-empty h3 { font-size: 16px; margin-bottom: 6px; }
.mom-empty p { color: var(--mom-muted); margin-bottom: 14px; max-width: 52ch; margin-left: auto; margin-right: auto; }
.mom-loading { display: flex; align-items: center; gap: 10px; color: var(--mom-muted); padding: 28px 4px; }
.mom-loading span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--mom-line); border-top-color: var(--mom-violet); animation: mom-spin .7s linear infinite; }
.mom-notice { padding: 14px 16px; border-radius: 8px; background: #f7f6fb; border: 1px solid #e6e4ef; font-family: 'Inter', system-ui, sans-serif; }
.mom-notice-error { background: #fff6f7; border-color: #fecdd3; color: #9f1239; }
.mom-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100001; display: flex; flex-direction: column; gap: 8px; font-family: 'Inter', system-ui, sans-serif; }
.mom-toast { background: #17152b; color: #fff; padding: 11px 16px; border-radius: 8px; font-size: 13.5px; box-shadow: 0 10px 28px rgba(23, 21, 43, .3); max-width: 380px; border-left: 3px solid #14b8a6; animation: mom-pop .16s ease-out; transition: opacity .3s, transform .3s; }
.mom-toast-error { border-left-color: #e11d48; }
.mom-toast.is-out { opacity: 0; transform: translateY(6px); }

/* Login box */
.mom-login { max-width: 400px; margin: 24px auto; padding: 28px; background: #fff; border: 1px solid #e6e4ef; border-radius: 12px; font-family: 'Inter', system-ui, sans-serif; }
.mom-login h2 { font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 22px; margin: 0 0 16px; }
.mom-login input[type=text], .mom-login input[type=password] { width: 100%; height: 40px; padding: 0 10px; border: 1px solid #e6e4ef; border-radius: 6px; }
.mom-login input[type=submit] { background: #5b3df5; color: #fff; border: 0; border-radius: 6px; height: 40px; padding: 0 18px; font-weight: 600; cursor: pointer; }
.mom-login-alt { margin: 8px 0 0; font-size: 13.5px; }

/* Responsive */
@media (max-width: 1200px) {
	.mom-kpis-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.mom-flow > ol { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 18px; }
	.mom-flow-money { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--mom-line); padding: 14px 0 0; }
}
@media (max-width: 960px) {
	.mom-shell { grid-template-columns: minmax(0, 1fr); gap: 12px; }
	.mom-nav { position: static; }
	.mom-nav ul { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 6px; }
	.mom-nav a { white-space: nowrap; }
	.mom-brand, .mom-nav-foot { display: none; }
	.mom-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mom-grid-2, .mom-grid-uneven { grid-template-columns: 1fr; }
	.mom-detail-grid { grid-template-columns: 1fr; }
	.mom-validate { grid-template-columns: 1fr; }
}
@media (max-width: 782px) {
	.mom-wrap { margin-right: 10px; }
	.mom-ctx-front { padding: 12px; }
	.mom-title { font-size: 22px; }
	.mom-kpi-value { font-size: 21px; }
	.mom-flow > ol { grid-template-columns: 1fr; }
	.mom-flow-stage { padding: 0 !important; }
	.mom-flow-stage + .mom-flow-stage::before { display: none; }
	.mom-toolbar > *, .mom-range, .mom-userpick { flex: 1 1 100%; }
	.mom-range select, .mom-toolbar > select, .mom-toolbar > input { width: 100%; }
	.mom-userpick select, .mom-userpick input { flex: 1; width: auto; }
	.mom-kpis-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mom-notif-panel { width: min(340px, calc(100vw - 32px)); }
	.mom-net-preview .mom-net-total { margin-left: 0; }

	/* Orders table becomes stacked cards */
	.mom-scope .mom-table-orders thead { display: none !important; }
	.mom-scope .mom-table-orders, .mom-scope .mom-table-orders tbody, .mom-scope .mom-table-orders tr { display: block; width: 100%; }
	.mom-scope .mom-table-orders tr { position: relative; padding: 10px 12px 10px 40px; border-bottom: 1px solid var(--mom-line); }
	.mom-scope .mom-table-orders td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; width: 100%; white-space: normal; }
	.mom-scope .mom-table-orders td::before { content: attr(data-label); color: var(--mom-muted); font-family: var(--mom-body); font-size: 12px; text-align: left; flex: none; }
	.mom-scope .mom-table-orders td.mom-col-check { position: absolute; left: 12px; top: 12px; width: auto; padding: 0; }
	.mom-scope .mom-table-orders td.mom-col-check::before, .mom-scope .mom-table-orders td.mom-col-actions::before { content: none; }
	.mom-scope .mom-table-orders td.mom-col-actions { justify-content: flex-end; padding-top: 6px; }
	.mom-scope .mom-table-orders .mom-ellipsis { max-width: none; }
	.mom-head { margin-right: 44px; }
}
@media (prefers-reduced-motion: reduce) {
	.mom-scope *, .mom-modal, .mom-toast { animation: none !important; transition: none !important; }
}
