/* ==========================================================================
   DG Global — Store Manager
   ========================================================================== */
:root {
	--m-black: #0b0b0b;
	--m-ink: #161616;
	--m-side: #0d0d0c;
	--m-side-2: #171612;
	--m-gold: #d9a93a;
	--m-gold-hi: #f0c860;
	--m-gold-deep: #a87a1f;
	--m-gold-grad: linear-gradient(135deg, #f3d27a 0%, #d9a93a 48%, #b8862a 100%);
	--m-cream: #fbf3dc;
	--m-bg: #f6f4ef;
	--m-card: #ffffff;
	--m-line: #ebe6da;
	--m-line-2: #f2eee5;
	--m-text: #1b1b1b;
	--m-muted: #73706a;
	--m-green: #2e7d32;
	--m-green-bg: #e8f5e9;
	--m-amber: #9a6b00;
	--m-amber-bg: #fff4d6;
	--m-red: #c62828;
	--m-red-bg: #fdecea;
	--m-blue: #1565c0;
	--m-blue-bg: #e3f2fd;
	--m-wa: #25d366;
	--m-r: 14px;
	--m-r-sm: 10px;
	--m-shadow: 0 1px 2px rgba(20, 16, 6, .04), 0 6px 20px rgba(20, 16, 6, .05);
	--m-font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--m-display: "Cinzel", Georgia, serif;
	--m-side-w: 256px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.m-body { margin: 0; font-family: var(--m-font); font-size: 14px; line-height: 1.55; color: var(--m-text); background: var(--m-bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0 0 .8em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--m-gold); outline-offset: 2px; }
code { background: var(--m-cream); padding: 1px 6px; border-radius: 6px; font-size: 12px; }

/* ---------- Layout ---------- */
.m-app { min-height: 100vh; }
.m-side {
	position: fixed; inset: 0 auto 0 0; width: var(--m-side-w); z-index: 50;
	background: var(--m-side); color: #d8d2c4; display: flex; flex-direction: column;
	transform: translateX(-100%); transition: transform .3s cubic-bezier(.2, .7, .2, 1);
	background-image: radial-gradient(120% 40% at 0 0, rgba(217, 169, 58, .14), transparent 60%);
}
.m-side.is-open { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .4); }
.m-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .3s; }
.m-side.is-open + .m-scrim { opacity: 1; pointer-events: auto; }
.m-brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 16px; border-bottom: 1px solid #1f1d17; }
.m-brand__mark {
	width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center;
	background: var(--m-gold-grad); color: var(--m-black); font-family: var(--m-display); font-weight: 700; font-size: 15px; letter-spacing: .04em;
	box-shadow: 0 6px 18px rgba(217, 169, 58, .3);
}
.m-brand__mark--lg { width: 64px; height: 64px; font-size: 24px; border-radius: 18px; }
.m-brand__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.m-brand__text strong { color: #fff; font-family: var(--m-display); font-size: 13.5px; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-brand__text small { color: var(--m-gold); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; margin-top: 3px; }
.m-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; scrollbar-width: thin; scrollbar-color: #2b2923 transparent; }
.m-nav__group { padding: 4px 0; }
.m-nav__label { display: block; padding: 8px 10px 4px; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: #77705f; font-weight: 600; }
.m-nav__link { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; font-size: 13.5px; color: #cfc9bb; position: relative; transition: background .15s, color .15s; }
.m-nav__link i { width: 18px; text-align: center; color: #8d8573; font-size: 14px; transition: color .15s; }
.m-nav__link:hover { background: var(--m-side-2); color: #fff; }
.m-nav__link:hover i { color: var(--m-gold); }
.m-nav__link.is-active { background: linear-gradient(90deg, rgba(217, 169, 58, .18), rgba(217, 169, 58, .04)); color: #fff; font-weight: 500; }
.m-nav__link.is-active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--m-gold); }
.m-nav__link.is-active i { color: var(--m-gold-hi); }
.m-nav__badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--m-gold); color: var(--m-black); font-style: normal; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.m-side__foot { padding: 12px 18px 18px; border-top: 1px solid #1f1d17; display: grid; gap: 4px; }
.m-side__foot a { display: flex; gap: 10px; align-items: center; padding: 7px 4px; font-size: 13px; color: #a7a091; }
.m-side__foot a:hover { color: var(--m-gold-hi); }

.m-main { min-height: 100vh; display: flex; flex-direction: column; }
.m-top {
	position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
	padding: 10px 16px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--m-line);
}
.m-top__search { position: relative; flex: 1; max-width: 520px; }
.m-top__search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--m-muted); font-size: 13px; }
.m-top__search input { width: 100%; height: 40px; padding: 0 14px 0 38px; border-radius: 999px; border: 1px solid var(--m-line); background: var(--m-bg); font-size: 14px; }
.m-top__search input:focus { outline: none; border-color: var(--m-gold); background: #fff; box-shadow: 0 0 0 4px rgba(217, 169, 58, .14); }
.m-top__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.m-user { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid transparent; background: none; }
.m-user:hover { background: var(--m-bg); border-color: var(--m-line); }
.m-user__txt { display: none; flex-direction: column; text-align: left; line-height: 1.2; }
.m-user__txt small { color: var(--m-muted); font-size: 11.5px; }
.m-user > i { display: none; font-size: 10px; color: var(--m-muted); }
.m-content { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 18px 16px 60px; }

/* ---------- Dropdown ---------- */
.m-drop { position: relative; }
.m-drop__menu { position: absolute; top: calc(100% + 8px); left: 0; min-width: 200px; background: #fff; border: 1px solid var(--m-line); border-radius: 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, .12); padding: 6px; z-index: 60; }
.m-drop__menu--right { left: auto; right: 0; }
.m-drop__menu a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 8px; font-size: 13.5px; }
.m-drop__menu a i { width: 16px; color: var(--m-gold-deep); }
.m-drop__menu a:hover { background: var(--m-bg); }

/* ---------- Buttons ---------- */
.m-btn {
	--bg: var(--m-black); --fg: #fff; --bd: transparent;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 40px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--bd);
	background: var(--bg); color: var(--fg); font-weight: 600; font-size: 13.5px; line-height: 1.2; white-space: nowrap;
	transition: transform .15s, box-shadow .15s, background .15s, filter .15s;
}
.m-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, .1); }
.m-btn:active { transform: none; }
.m-btn--gold { --bg: var(--m-gold); --fg: var(--m-black); background-image: var(--m-gold-grad); }
.m-btn--dark { --bg: var(--m-black); }
.m-btn--ghost { --bg: #fff; --fg: var(--m-text); --bd: var(--m-line); }
.m-btn--ghost:hover { --bd: #d8cfb8; }
.m-btn--wa { --bg: var(--m-wa); --fg: #fff; }
.m-btn--danger { --bg: var(--m-red); --fg: #fff; }
.m-btn--danger-ghost { --bg: #fff; --fg: var(--m-red); --bd: #f2c8c4; }
.m-btn--sm { min-height: 32px; padding: 5px 12px; font-size: 12.5px; border-radius: 8px; }
.m-btn--lg { min-height: 48px; font-size: 15px; }
.m-btn--block { width: 100%; }
.m-btn.is-loading { opacity: .7; pointer-events: none; }
.m-iconbtn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 0; background: none; color: var(--m-muted); flex: none; }
.m-iconbtn:hover { background: var(--m-bg); color: var(--m-text); }
.m-link { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; color: var(--m-gold-deep); background: none; border: 0; padding: 0; }
.m-link i { font-size: 11px; }
.m-btnrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.m-btnrow form { margin: 0; }
.m-btnstack { display: grid; gap: 8px; }
.m-btnstack form { margin: 0; }
.m-inline-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 0; }
.m-inline-actions form { margin: 0; }

/* ---------- Page head ---------- */
.m-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.m-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.m-head p { margin: 4px 0 0; color: var(--m-muted); font-size: 13.5px; }
.m-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.m-head__actions .m-btn span { display: none; }

/* ---------- Cards & grids ---------- */
.m-card { background: var(--m-card); border: 1px solid var(--m-line); border-radius: var(--m-r); padding: 18px; box-shadow: var(--m-shadow); margin-bottom: 16px; min-width: 0; }
.m-card--flush { padding: 0; overflow: hidden; }
.m-card--danger { border-color: #f6d6d2; }
.m-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.m-card__head h2 { font-size: 15.5px; font-weight: 600; }
.m-card__head p { margin: 2px 0 0; font-size: 12.5px; }
.m-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.m-grid > .m-card, .m-stack > .m-card { margin-bottom: 0; }
.m-grid + .m-grid, .m-grid + .m-card, .m-kpis + .m-grid { margin-top: 16px; }
.m-stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.m-cols { display: grid; gap: 18px; }
.m-row { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
.m-narrow { max-width: 620px; }
.m-narrow-lg { max-width: 880px; }
.m-sticky { align-self: start; }
.m-scroll-x { overflow-x: auto; }

/* ---------- KPIs ---------- */
.m-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.m-kpi {
	display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--m-r); background: #fff; border: 1px solid var(--m-line);
	box-shadow: var(--m-shadow); transition: transform .15s, border-color .15s; min-width: 0;
}
a.m-kpi:hover { transform: translateY(-2px); border-color: #e2d3ab; }
.m-kpi__icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--m-bg); color: var(--m-ink); margin-bottom: 4px; font-size: 14px; }
.m-kpi__icon.is-amber { background: var(--m-amber-bg); color: var(--m-amber); }
.m-kpi__icon.is-green { background: var(--m-green-bg); color: var(--m-green); }
.m-kpi__icon.is-gold { background: var(--m-cream); color: var(--m-gold-deep); }
.m-kpi__label { font-size: 12.5px; color: var(--m-muted); }
.m-kpi__value { font-size: 22px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.m-kpi__sub { font-size: 12px; color: var(--m-muted); }
.m-kpi--hero { grid-column: 1 / -1; background: var(--m-black); color: #fff; border-color: #222; background-image: radial-gradient(90% 140% at 100% 0, rgba(217, 169, 58, .32), transparent 60%); }
.m-kpi--hero .m-kpi__label, .m-kpi--hero .m-kpi__sub { color: #bdb6a6; }
.m-kpi--hero .m-kpi__value { font-size: 28px; color: var(--m-gold-hi); font-family: var(--m-display); }

/* ---------- Chart ---------- */
.m-chart { margin: 0; }
.m-chart svg { width: 100%; height: 220px; display: block; overflow: visible; }
.m-chart__grid { stroke: #efeae0; stroke-width: 1; }
.m-chart__base { stroke: #d6cfbf; stroke-width: 1; }
.m-chart__ylab, .m-chart__xlab { fill: #8a857b; font-size: 11px; font-family: var(--m-font); }
.m-chart__bar { fill: var(--m-gold); transition: fill .15s; }
.m-chart__hit { fill: transparent; cursor: crosshair; outline: none; }
.m-chart__hit:hover, .m-chart__hit:focus { fill: rgba(217, 169, 58, .08); }
.m-chart__table { margin-top: 8px; font-size: 12.5px; }
.m-chart__table summary { cursor: pointer; color: var(--m-muted); }
.m-tip { position: fixed; z-index: 200; pointer-events: none; background: var(--m-black); color: #fff; padding: 7px 10px; border-radius: 8px; font-size: 12px; box-shadow: 0 8px 20px rgba(0, 0, 0, .2); transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; }
.m-tip strong { color: var(--m-gold-hi); display: block; font-size: 13px; }

/* ---------- Lists ---------- */
.m-list li + li { border-top: 1px solid var(--m-line-2); }
.m-list a { display: flex; align-items: center; gap: 12px; padding: 10px 2px; }
.m-list a:hover .m-list__main strong { color: var(--m-gold-deep); }
.m-list__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.m-list__main strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-list__main small { color: var(--m-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-list__amt { font-weight: 600; white-space: nowrap; }
.m-todo li a { display: flex; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--m-line-2); font-size: 13.5px; }
.m-todo li:last-child a { border-bottom: 0; }
.m-todo i { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--m-bg); color: var(--m-gold-deep); font-size: 13px; }
.m-todo em { margin-left: auto; font-style: normal; font-weight: 700; min-width: 26px; text-align: center; padding: 2px 8px; border-radius: 999px; background: var(--m-bg); }
.m-todo a:hover { color: var(--m-gold-deep); }
.m-setup { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--m-cream); display: grid; gap: 6px; font-size: 13px; }
.m-setup a { color: var(--m-gold-deep); font-weight: 600; }
.m-rank { display: grid; gap: 12px; }
.m-rank li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "n v" "b b"; gap: 4px 10px; font-size: 13px; }
.m-rank__name { grid-area: n; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-rank__name small { color: var(--m-muted); }
.m-rank__val { grid-area: v; font-weight: 600; }
.m-rank__bar { grid-area: b; height: 6px; border-radius: 999px; background: var(--m-line-2); overflow: hidden; }
.m-rank__bar span { display: block; height: 100%; border-radius: 999px; background: var(--m-gold); }
.m-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.m-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 999px; border: 1px solid var(--m-line); background: #fff; font-size: 13px; }
.m-chip em { font-style: normal; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--m-bg); }
.m-chip em.is-red { background: var(--m-red-bg); color: var(--m-red); }
.m-chip:hover { border-color: var(--m-gold); }

/* ---------- Pills & statuses ---------- */
.m-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--m-bg); color: var(--m-ink); white-space: nowrap; }
.m-pill i { font-size: 10px; }
.m-pill--xs { padding: 1px 8px; font-size: 10.5px; }
.m-pill.is-green { background: var(--m-green-bg); color: var(--m-green); }
.m-pill.is-amber { background: var(--m-amber-bg); color: var(--m-amber); }
.m-pill.is-red { background: var(--m-red-bg); color: var(--m-red); }
.m-pill.is-grey { background: #eee; color: #555; }
.m-pill.is-gold { background: var(--m-black); color: var(--m-gold-hi); }
.m-ost { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #eee; color: #444; white-space: nowrap; }
.m-ost--lg { padding: 6px 14px; font-size: 13px; }
.m-ost--pending, .m-rst--new { background: var(--m-amber-bg); color: var(--m-amber); }
.m-ost--confirmed, .m-ost--processing, .m-rst--quoted { background: var(--m-blue-bg); color: var(--m-blue); }
.m-ost--sourcing, .m-ost--in_transit { background: var(--m-cream); color: #8a6a1f; }
.m-ost--arrived { background: #ffe0b2; color: #b45309; }
.m-ost--ready, .m-ost--out_for_delivery { background: #e0f2f1; color: #00695c; }
.m-ost--completed, .m-rst--accepted { background: var(--m-green-bg); color: var(--m-green); }
.m-ost--cancelled, .m-rst--closed { background: #eee; color: #666; }

/* ---------- Tabs & filters ---------- */
.m-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; scrollbar-width: none; }
.m-tabs::-webkit-scrollbar { display: none; }
.m-tabs a { flex: none; display: inline-flex; gap: 6px; align-items: center; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--m-muted); border: 1px solid transparent; }
.m-tabs a em { font-style: normal; font-size: 11px; padding: 0 7px; border-radius: 999px; background: #ebe6da; color: var(--m-ink); }
.m-tabs a:hover { color: var(--m-text); background: #fff; border-color: var(--m-line); }
.m-tabs a.is-active { background: var(--m-black); color: #fff; }
.m-tabs a.is-active em { background: var(--m-gold); color: var(--m-black); }
.m-tabs a.is-active i { color: var(--m-gold); }
.m-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.m-filters--inset { padding: 12px; margin: 0; border-bottom: 1px solid var(--m-line); }
.m-filters__search { position: relative; flex: 1 1 240px; }
.m-filters__search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--m-muted); font-size: 12px; }
.m-filters__search input { padding-left: 34px !important; }
.m-filters input, .m-filters select { height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--m-line); background: #fff; font-size: 14px; width: 100%; }
.m-filters select, .m-filters input[type=date] { width: auto; flex: 0 1 auto; }

/* ---------- Tables ---------- */
.m-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.m-table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--m-muted); padding: 12px 14px; background: #fbfaf7; border-bottom: 1px solid var(--m-line); white-space: nowrap; }
.m-table td { padding: 12px 14px; border-bottom: 1px solid var(--m-line-2); vertical-align: middle; }
.m-table tbody tr:last-child td { border-bottom: 0; }
.m-table tbody tr:hover td { background: #fdfcf9; }
.m-table--compact td { padding: 6px 8px; }
.t-right { text-align: right !important; }
.t-center { text-align: center !important; }
.t-check { width: 36px; }
.t-check input { width: 17px; height: 17px; accent-color: var(--m-gold-deep); }
.t-actions { white-space: nowrap; text-align: right; }
.m-strong { font-weight: 600; }
.m-block { display: block; }
.m-muted { color: var(--m-muted); }
.m-warn { color: #b45309; font-weight: 600; }
.m-gold { color: var(--m-gold); }
a.m-strong:hover { color: var(--m-gold-deep); }
.m-prod, .m-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.m-prod strong, .m-person strong { font-weight: 600; }
.m-prod:hover strong, .m-person:hover strong { color: var(--m-gold-deep); }
.m-thumb { width: 46px; height: 46px; flex: none; border-radius: 10px; overflow: hidden; background: var(--m-bg); border: 1px solid var(--m-line-2); }
.m-thumb img { width: 100%; height: 100%; object-fit: cover; }
.m-thumb--sm { width: 36px; height: 36px; }
.m-avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--m-black); color: var(--m-gold-hi); font-family: var(--m-display); font-weight: 700; font-size: 14px; }
.m-bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; background: var(--m-cream); border-bottom: 1px solid #f0e3bd; }
.m-bulkbar select { height: 34px; border-radius: 8px; border: 1px solid #e6d7ad; padding: 0 10px; background: #fff; }
.m-bulkbar .js-bulk-count { font-weight: 600; font-size: 13px; }

/* Matrix */
.m-matrix th[scope=row] { text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--m-text); background: #fff; font-weight: 600; white-space: normal; min-width: 220px; }
.m-matrix th[scope=row] small { font-weight: 400; font-size: 12px; }
.m-matrix thead th { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--m-text); }
.m-matrix thead th a:hover { color: var(--m-gold-deep); }
.m-yes { color: var(--m-green); }
.m-no { color: #c9c3b6; }

/* ---------- Pagination ---------- */
.m-pager { display: flex; gap: 6px; justify-content: center; margin: 18px 0; }
.m-pager a, .m-pager span { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--m-line); background: #fff; font-weight: 600; font-size: 13px; }
.m-pager .is-current { background: var(--m-black); color: var(--m-gold-hi); border-color: var(--m-black); }

/* ---------- Forms ---------- */
.m-form .m-field, .m-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.m-field label { font-size: 12.5px; font-weight: 600; color: var(--m-ink); }
.m-field small { font-size: 12px; color: var(--m-muted); }
.m-field small a { color: var(--m-gold-deep); font-weight: 600; }
.m-field input, .m-field select, .m-field textarea, .m-input-group input {
	width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 10px; border: 1px solid #e2dccd; background: #fff; font-size: 15px;
	transition: border-color .15s, box-shadow .15s;
}
.m-field textarea { resize: vertical; line-height: 1.5; }
.m-field input:focus, .m-field select:focus, .m-field textarea:focus, .m-input-group input:focus { outline: none; border-color: var(--m-gold); box-shadow: 0 0 0 4px rgba(217, 169, 58, .14); }
.m-field input[type=color] { padding: 2px; width: 46px; min-height: 40px; }
.m-input-group { display: flex; gap: 6px; }
.m-input-group input { flex: 1; }
.m-check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; margin: 8px 0; cursor: pointer; }
.m-check input { width: 17px; height: 17px; accent-color: var(--m-gold-deep); flex: none; }
.m-check--sub { margin: 6px 0 6px 26px; font-size: 13px; }
.m-hint { font-size: 12px; color: var(--m-muted); margin: 8px 0 0; }
.m-fieldset { border: 1px solid var(--m-line); border-radius: 12px; padding: 14px 14px 0; margin: 6px 0 16px; }
.m-fieldset legend { font-weight: 600; font-size: 13px; padding: 0 6px; }
.m-switch { display: inline-flex !important; align-items: center; gap: 10px; cursor: pointer; font-size: 14px !important; font-weight: 500 !important; }
.m-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.m-switch span { width: 40px; height: 23px; border-radius: 999px; background: #d9d4c8; position: relative; transition: background .2s; flex: none; }
.m-switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.m-switch input:checked + span { background: var(--m-gold); }
.m-switch input:checked + span::after { transform: translateX(17px); }
.m-switch input:focus-visible + span { outline: 2px solid var(--m-gold-deep); outline-offset: 2px; }

.m-radiocards, .m-rolepick { display: grid; gap: 8px; margin-bottom: 14px; }
.m-radiocard input { position: absolute; opacity: 0; }
.m-radiocard > span { display: grid; grid-template-columns: 28px 1fr; gap: 0 10px; padding: 12px; border: 1.5px solid var(--m-line); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.m-radiocard i { grid-row: span 2; font-size: 16px; margin-top: 2px; }
.m-radiocard strong { font-size: 13.5px; }
.m-radiocard small { font-size: 12px; color: var(--m-muted); }
.m-rolepick .m-radiocard > span { grid-template-columns: 1fr; }
.m-radiocard input:checked + span { border-color: var(--m-gold); background: #fffbf0; box-shadow: 0 0 0 3px rgba(217, 169, 58, .14); }
.m-radiocard input:focus-visible + span { outline: 2px solid var(--m-gold-deep); }
.m-radiocard.is-in_stock i { color: var(--m-green); }
.m-radiocard.is-pre_order i { color: var(--m-gold-deep); }
.m-radiocard.is-out_of_stock i { color: #888; }

.m-permgrid { display: grid; gap: 10px; margin-bottom: 16px; }
.m-permcard input { position: absolute; opacity: 0; }
.m-permcard > span { display: grid; grid-template-columns: 34px 1fr; gap: 0 10px; padding: 12px; border: 1.5px solid var(--m-line); border-radius: 12px; cursor: pointer; }
.m-permcard i { grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--m-bg); color: var(--m-muted); }
.m-permcard strong { font-size: 13.5px; }
.m-permcard small { font-size: 12px; color: var(--m-muted); }
.m-permcard input:checked + span { border-color: var(--m-gold); background: #fffbf0; }
.m-permcard input:checked + span i { background: var(--m-gold-grad); color: var(--m-black); }
.m-permcard input:focus-visible + span { outline: 2px solid var(--m-gold-deep); }

.m-cattree { max-height: 360px; overflow-y: auto; border: 1px solid var(--m-line-2); border-radius: 10px; padding: 4px 10px; }
.m-cattree details { border-bottom: 1px solid var(--m-line-2); padding: 2px 0; }
.m-cattree details:last-child { border-bottom: 0; }
.m-cattree summary { list-style: none; cursor: pointer; }
.m-cattree summary::-webkit-details-marker { display: none; }
.m-cattree summary .m-check i { color: var(--m-gold-deep); width: 16px; }

/* Uploads */
.m-media { display: grid; gap: 14px; }
.m-upload { position: relative; border-radius: 12px; overflow: hidden; background: var(--m-bg); border: 1.5px dashed #ddd2b6; }
.m-upload--main { aspect-ratio: 1; max-width: 260px; }
.m-upload--wide { aspect-ratio: 16 / 9; max-width: 360px; }
.m-upload__preview { position: absolute; inset: 0; }
.m-upload__preview img { width: 100%; height: 100%; object-fit: cover; }
.m-upload__drop { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; color: var(--m-muted); font-size: 13px; font-weight: 500; transition: background .15s; }
.m-upload__drop i { font-size: 22px; color: var(--m-gold); }
.m-upload__drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.m-upload.has-image .m-upload__drop { opacity: 0; background: rgba(0, 0, 0, .45); color: #fff; }
.m-upload.has-image:hover .m-upload__drop { opacity: 1; }
.m-upload.is-busy::after { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, .7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='18' fill='none' stroke='%23D9A93A' stroke-width='4' stroke-dasharray='80 40'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center / 40px no-repeat; }
.m-upload__remove { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(11, 11, 11, .8); color: #fff; z-index: 2; }
.m-gallery__list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.m-gallery__list li { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; cursor: grab; background: var(--m-bg); }
.m-gallery__list li.is-drag { opacity: .4; }
.m-gallery__list img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.m-gallery__list button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(11, 11, 11, .8); color: #fff; font-size: 10px; }
.m-gallery__add { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; border: 1.5px dashed #ddd2b6; cursor: pointer; font-size: 13px; font-weight: 500; margin-right: 8px; }
.m-gallery__add i { color: var(--m-gold); }
.m-gallery__add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.m-colors { display: grid; gap: 8px; margin-bottom: 8px; }
.m-color { display: flex; gap: 8px; align-items: center; }
.m-color input[type=color] { width: 44px; height: 40px; padding: 2px; border-radius: 10px; border: 1px solid #e2dccd; background: #fff; flex: none; }
.m-color input[type=text] { flex: 1; min-height: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid #e2dccd; font-size: 14px; }

/* Editor */
.m-editor { border: 1px solid #e2dccd; border-radius: 12px; overflow: hidden; background: #fff; }
.m-editor:focus-within { border-color: var(--m-gold); box-shadow: 0 0 0 4px rgba(217, 169, 58, .14); }
.m-editor__bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--m-line); background: #fbfaf7; }
.m-editor__bar button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: #555; }
.m-editor__bar button:hover, .m-editor__bar button.is-on { background: #fff; color: var(--m-black); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.m-editor__area { padding: 14px 16px; outline: none; font-size: 15px; line-height: 1.7; }
.m-editor__src { width: 100%; border: 0; padding: 14px; font-family: ui-monospace, monospace; font-size: 13px; min-height: 220px; }
.m-prose h2 { font-size: 20px; margin: 1em 0 .4em; }
.m-prose h3 { font-size: 17px; margin: 1em 0 .4em; }
.m-prose ul { list-style: disc; padding-left: 22px; margin: 0 0 1em; }
.m-prose ol { list-style: decimal; padding-left: 22px; margin: 0 0 1em; }
.m-prose a { color: var(--m-gold-deep); text-decoration: underline; }

/* ---------- Order detail ---------- */
.m-ostatus-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.m-steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(84px, 1fr); gap: 0; overflow-x: auto; margin-bottom: 16px; padding: 14px 6px; background: #fff; border: 1px solid var(--m-line); border-radius: var(--m-r); }
.m-steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 0 4px; }
.m-steps li:not(:last-child)::after { content: ""; position: absolute; top: 16px; left: calc(50% + 20px); right: calc(-50% + 20px); height: 2px; background: var(--m-line); }
.m-steps li.is-done:not(:last-child)::after { background: var(--m-gold); }
.m-steps span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #f2efe8; color: #aaa; font-size: 13px; position: relative; z-index: 1; }
.m-steps small { font-size: 11.5px; color: #999; line-height: 1.3; }
.m-steps .is-done span { background: var(--m-gold-grad); color: var(--m-black); }
.m-steps .is-done small { color: var(--m-text); }
.m-steps .is-current span { background: var(--m-black); color: var(--m-gold-hi); box-shadow: 0 0 0 4px rgba(217, 169, 58, .25); }
.m-steps .is-current small { color: var(--m-black); font-weight: 700; }
.m-items li { display: grid; grid-template-columns: 46px 1fr auto; grid-template-areas: "img info sub" "img qty sub"; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--m-line-2); align-items: center; }
.m-items .m-thumb { grid-area: img; }
.m-items__info { grid-area: info; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.m-items__info small { color: var(--m-muted); font-size: 12px; }
.m-items__qty { grid-area: qty; font-size: 12.5px; color: var(--m-muted); }
.m-items__sub { grid-area: sub; font-weight: 700; }
.m-totals { display: grid; grid-template-columns: 1fr auto; gap: 7px 16px; margin: 14px 0 0; font-size: 13.5px; }
.m-totals dt { color: var(--m-muted); }
.m-totals dd { margin: 0; text-align: right; font-weight: 600; }
.m-totals .is-total { font-size: 16px; color: var(--m-black); font-weight: 700; border-top: 1px solid var(--m-line); padding-top: 9px; }
.m-totals .is-green { color: var(--m-green); }
.m-totals .is-warn { color: #b45309; font-weight: 700; }
.m-h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--m-muted); margin: 0 0 6px; }
.m-note { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--m-cream); font-size: 13px; }
.m-note i { color: var(--m-gold-deep); margin-right: 4px; }
.m-copyline { margin: 12px 0 0; font-size: 12.5px; color: var(--m-muted); }
.m-timeline { border-left: 2px solid #eadfbf; margin-left: 6px; padding-left: 18px; display: grid; gap: 14px; }
.m-timeline li { position: relative; }
.m-timeline li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--m-gold); border: 2px solid #fff; box-shadow: 0 0 0 1px #eadfbf; }
.m-timeline li.is-private::before { background: #bbb; }
.m-timeline time { display: block; font-size: 11.5px; color: var(--m-muted); }
.m-timeline strong { font-size: 13px; }
.m-timeline p { margin: 2px 0 0; color: #444; font-size: 13px; }
.m-pays { display: grid; gap: 8px; margin-bottom: 14px; }
.m-pays li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--m-green-bg); font-size: 13px; }
.m-pays strong { color: var(--m-green); }
.m-pays span { color: #44583f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-pays time { font-size: 11.5px; color: var(--m-muted); }

/* New order lines */
.m-lines { display: grid; gap: 10px; margin-bottom: 12px; }
.m-line { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; padding: 12px; border: 1px solid var(--m-line); border-radius: 12px; background: #fdfcf9; position: relative; }
.m-line .m-field { margin-bottom: 8px; }
.m-line__product { grid-column: 1 / -1; padding-right: 36px; }
.m-line__sub { align-self: center; font-weight: 700; text-align: right; grid-column: 2; }
.m-line .js-line-remove { position: absolute; top: 8px; right: 8px; }
.m-estimate { display: flex; justify-content: space-between; padding: 12px 14px; border-radius: 10px; background: var(--m-cream); margin-top: 14px; font-size: 14px; }

/* ---------- Cards grids (requests, coupons, team, pages) ---------- */
.m-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.m-reqcard { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--m-line); border-radius: var(--m-r); overflow: hidden; box-shadow: var(--m-shadow); transition: transform .15s; }
.m-reqcard:hover { transform: translateY(-2px); }
.m-reqcard__img { aspect-ratio: 4 / 3; background: var(--m-bg); display: grid; place-items: center; color: #c9c0aa; font-size: 34px; overflow: hidden; }
.m-reqcard__img img { width: 100%; height: 100%; object-fit: cover; }
.m-reqcard__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.m-reqcard__body small { color: var(--m-muted); font-size: 12px; }
.m-reqcard__body em { font-style: normal; font-weight: 700; color: var(--m-gold-deep); }
.m-request-img img { border-radius: 12px; width: 100%; }
.m-empty-img { aspect-ratio: 1; display: grid; place-items: center; gap: 6px; background: var(--m-bg); border-radius: 12px; color: var(--m-muted); text-align: center; align-content: center; }
.m-empty-img i { font-size: 34px; color: #cfc6b0; }
.m-dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: 13.5px; }
.m-dl dt { color: var(--m-muted); }
.m-dl dd { margin: 0; overflow-wrap: anywhere; }
.m-dl a { color: var(--m-gold-deep); }

.m-coupon { background: #fff; border: 1px solid var(--m-line); border-radius: var(--m-r); padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--m-shadow); position: relative; overflow: hidden; }
.m-coupon::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--m-gold-grad); }
.m-coupon.is-off { opacity: .6; }
.m-coupon.is-off::before { background: #ccc; }
.m-coupon__code button { border: 1.5px dashed var(--m-gold); background: var(--m-cream); padding: 6px 12px; border-radius: 8px; font-weight: 700; letter-spacing: .08em; font-size: 14px; }
.m-coupon__code i { color: var(--m-gold-deep); margin-left: 4px; font-size: 12px; }
.m-coupon__value { font-size: 24px; font-family: var(--m-display); }
.m-coupon__value small { font-family: var(--m-font); font-size: 13px; color: var(--m-muted); }
.m-coupon__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--m-muted); }

.m-member { background: #fff; border: 1px solid var(--m-line); border-radius: var(--m-r); padding: 18px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; box-shadow: var(--m-shadow); transition: transform .15s, border-color .15s; }
a.m-member:hover { transform: translateY(-2px); border-color: #e2d3ab; }
.m-member .m-avatar { width: 56px; height: 56px; font-size: 20px; margin-bottom: 6px; }
.m-member small { color: var(--m-muted); font-size: 12px; overflow-wrap: anywhere; }
.m-member .m-pill { margin: 6px 0 2px; }
.m-member p { font-size: 12px; margin: 4px 0 0; }
.m-member.is-owner { background: var(--m-black); color: #fff; border-color: #222; background-image: radial-gradient(120% 80% at 100% 0, rgba(217, 169, 58, .3), transparent 60%); }
.m-member.is-owner .m-avatar { background: var(--m-gold-grad); color: var(--m-black); }
.m-member.is-owner small, .m-member.is-owner p { color: #bdb6a6; }
.m-member.is-owner .m-pill { background: rgba(217, 169, 58, .18); color: var(--m-gold-hi); }
.m-member.is-off { opacity: .6; }
.m-member--add { border-style: dashed; justify-content: center; color: var(--m-muted); }
.m-member--add i { font-size: 26px; color: var(--m-gold); margin-bottom: 6px; }
.m-member--add strong { color: var(--m-text); }

.m-pagecard { background: #fff; border: 1px solid var(--m-line); border-radius: var(--m-r); padding: 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--m-shadow); }
.m-pagecard > i { font-size: 22px; color: var(--m-gold); margin-bottom: 4px; }
.m-pagecard .m-btnrow { margin-top: 8px; }

.m-cat { display: flex; align-items: center; gap: 12px; }
.m-cat__icon { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--m-black); color: var(--m-gold); overflow: hidden; }
.m-cat__icon img { width: 100%; height: 100%; object-fit: cover; }
.m-cat__indent { width: 38px; text-align: right; color: #ccc; flex: none; }
tr.is-sub td { font-size: 13px; }
tr.is-top td { background: #fdfcf9; }

/* Inbox & reviews */
.m-inbox { display: grid; gap: 8px; }
.m-msg { background: #fff; border: 1px solid var(--m-line); border-radius: 12px; box-shadow: var(--m-shadow); }
.m-msg summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.m-msg summary::-webkit-details-marker { display: none; }
.m-msg__head { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.m-msg__head span { color: var(--m-muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-msg time { font-size: 12px; color: var(--m-muted); white-space: nowrap; }
.m-msg.is-unread { border-left: 4px solid var(--m-gold); }
.m-msg.is-unread .m-msg__head strong::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--m-gold); margin-left: 6px; vertical-align: middle; }
.m-msg__body { padding: 0 16px 16px 62px; }
.m-reviews { display: grid; gap: 10px; }
.m-review { background: #fff; border: 1px solid var(--m-line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--m-shadow); }
.m-review.is-pending { border-left: 4px solid var(--m-gold); }
.m-review header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.m-review header > div { flex: 1; min-width: 0; }
.m-review header small a { color: var(--m-gold-deep); }
.m-stars { color: var(--m-gold); letter-spacing: 1px; }
.m-review p { font-size: 14px; }

.m-activity li { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--m-line-2); font-size: 13px; }
.m-activity li:last-child { border-bottom: 0; }
.m-activity span { flex: 1; min-width: 0; }
.m-activity span a { color: var(--m-gold-deep); }
.m-activity time { color: var(--m-muted); font-size: 12px; white-space: nowrap; }
.m-perms li { padding: 7px 0; font-size: 13.5px; display: flex; gap: 10px; align-items: center; }
.m-perms .is-yes i { color: var(--m-green); }
.m-perms .is-no { color: var(--m-muted); }
.m-perms .is-no i { color: #ccc; }

/* Split bar */
.m-split { display: flex; gap: 2px; height: 14px; border-radius: 999px; overflow: hidden; background: var(--m-line-2); margin: 6px 0 14px; }
.m-split__a { background: var(--m-black); border-radius: 999px 0 0 999px; }
.m-split__b { background: var(--m-gold); border-radius: 0 999px 999px 0; }
.m-legend { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin: 0; font-size: 13px; }
.m-legend dd { margin: 0; text-align: right; font-weight: 600; }
.m-legend small { color: var(--m-muted); font-weight: 400; margin-left: 4px; }
.m-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; }
.m-sw--a { background: var(--m-black); }
.m-sw--b { background: var(--m-gold); }

/* Flash, empty, modal */
.m-flash { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; background: var(--m-green-bg); color: #1b5e20; font-size: 13.5px; font-weight: 500; animation: m-in .3s ease; }
.m-flash--error { background: var(--m-red-bg); color: #8e1c1c; }
.m-flash span { flex: 1; }
.m-flash button { border: 0; background: none; font-size: 18px; line-height: 1; color: inherit; opacity: .6; }
.m-empty { text-align: center; padding: 50px 16px; background: #fff; border: 1px dashed #e0d7c2; border-radius: var(--m-r); }
.m-empty > i { font-size: 34px; color: var(--m-gold); margin-bottom: 12px; }
.m-empty h3 { font-size: 17px; margin-bottom: 6px; }
.m-empty p { color: var(--m-muted); max-width: 420px; margin: 0 auto 14px; }
.m-modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .5); animation: m-fade .2s; }
.m-modal__box { width: min(100%, 400px); background: #fff; border-radius: 18px; padding: 24px; text-align: center; animation: m-in .25s ease; }
.m-modal__icon { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--m-red-bg); color: var(--m-red); font-size: 20px; }
.m-modal h2 { font-size: 16px; font-weight: 600; margin-bottom: 18px; }
.m-modal__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Auth */
.m-auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--m-black); background-image: radial-gradient(60% 60% at 80% 10%, rgba(217, 169, 58, .25), transparent 60%), radial-gradient(50% 50% at 0 100%, rgba(217, 169, 58, .12), transparent 60%); }
.m-auth__card { width: min(100%, 400px); background: #fff; border-radius: 22px; padding: 30px 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.m-auth__brand { text-align: center; margin-bottom: 22px; }
.m-auth__brand .m-brand__mark { margin: 0 auto 14px; }
.m-auth__brand h1 { font-family: var(--m-display); font-size: 20px; }
.m-auth__brand p { color: var(--m-gold-deep); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; margin: 6px 0 0; }
.m-auth__links { text-align: center; font-size: 13px; margin: 16px 0 0; color: var(--m-muted); }
.m-auth__links a { color: var(--m-gold-deep); }
.m-auth .dg-notice { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--m-red-bg); color: #8e1c1c; font-size: 13px; margin-bottom: 14px; }

/* Invoice */
.m-invoice-body { background: #eeeae1; padding: 20px 12px; font-family: var(--m-font); margin: 0; color: #111; }
.m-invoice-tools { max-width: 820px; margin: 0 auto 12px; text-align: right; }
.m-invoice { max-width: 820px; margin: 0 auto; background: #fff; padding: 36px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, .08); font-size: 13.5px; }
.m-invoice__head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 20px; border-bottom: 3px solid var(--m-gold); }
.m-invoice__brand { display: flex; gap: 14px; align-items: center; }
.m-invoice__brand strong { display: block; font-family: var(--m-display); font-size: 18px; }
.m-invoice__brand small { font-size: 9px; letter-spacing: .25em; color: var(--m-gold-deep); }
.m-invoice__logo { max-height: 64px; width: auto; }
.m-invoice__meta { text-align: right; }
.m-invoice__meta h1 { font-family: var(--m-display); font-size: 26px; color: var(--m-gold-deep); }
.m-invoice__parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin: 24px 0; }
.m-invoice__parties h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #888; margin-bottom: 6px; }
.m-invoice__table { width: 100%; border-collapse: collapse; }
.m-invoice__table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #777; border-bottom: 2px solid #111; padding: 8px 6px; }
.m-invoice__table td { padding: 10px 6px; border-bottom: 1px solid #eee; vertical-align: top; }
.m-invoice__totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 30px; width: min(100%, 320px); margin: 18px 0 0 auto; }
.m-invoice__totals dd { margin: 0; text-align: right; }
.m-invoice__totals .is-total { font-weight: 700; font-size: 15px; border-top: 1px solid #ddd; padding-top: 6px; }
.m-invoice__bank { margin-top: 24px; padding: 12px 14px; background: var(--m-cream); border-radius: 8px; }
.m-invoice__foot { margin-top: 30px; text-align: center; color: #888; font-size: 12px; }
@media print {
	.m-invoice-body { background: #fff; padding: 0; }
	.m-invoice-tools { display: none; }
	.m-invoice { box-shadow: none; padding: 0; }
}

@keyframes m-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes m-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Mobile tables → cards ---------- */
@media (max-width: 760px) {
	.m-table--rows thead { display: none; }
	.m-table--rows, .m-table--rows tbody, .m-table--rows tr, .m-table--rows td { display: block; width: 100%; }
	.m-table--rows tr { position: relative; padding: 12px 14px 12px 46px; border-bottom: 1px solid var(--m-line); }
	.m-table--rows tr:last-child { border-bottom: 0; }
	.m-table--rows td { padding: 3px 0; border: 0; text-align: left !important; display: flex; justify-content: space-between; gap: 12px; }
	.m-table--rows td[data-label]::before { content: attr(data-label); color: var(--m-muted); font-size: 12px; flex: none; }
	.m-table--rows td:nth-child(2)::before { display: none; }
	.m-table--rows td:nth-child(2) { margin-bottom: 4px; }
	.m-table--rows td.t-check { position: absolute; left: 14px; top: 14px; width: auto; padding: 0; }
	.m-table--rows td.t-actions { justify-content: flex-end; }
	.m-table--rows tr:not(:has(.t-check)) { padding-left: 14px; }
	.m-table--rows td:first-child:not(.t-check)::before { display: none; }
	.m-filters select, .m-filters input[type=date] { flex: 1 1 140px; }
}

/* ---------- 600px+ ---------- */
@media (min-width: 600px) {
	.m-content { padding: 22px 24px 60px; }
	.m-head__actions .m-btn span { display: inline; }
	.m-row { grid-template-columns: 1fr 1fr; }
	.m-row--4 { grid-template-columns: repeat(4, 1fr); }
	.m-row--wrap .m-field--full { grid-column: 1 / -1; }
	.m-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.m-kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.m-cols { grid-template-columns: 1fr 1fr; }
	.m-media { grid-template-columns: 220px 1fr; align-items: start; }
	.m-line { grid-template-columns: 1fr 1fr 80px 100px; align-items: end; }
	.m-line__product { grid-column: 1 / -1; }
	.m-line__sub { grid-column: auto; padding-bottom: 18px; }
	.m-permgrid { grid-template-columns: 1fr 1fr; }
	.m-radiocards { grid-template-columns: 1fr; }
	.m-rolepick { grid-template-columns: 1fr 1fr; }
	.m-user__txt { display: flex; }
	.m-user > i { display: inline; }
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
	.m-side { transform: none; }
	.m-scrim, .m-top__burger { display: none; }
	.m-main { margin-left: var(--m-side-w); }
	.m-top { padding: 12px 28px; }
	.m-content { padding: 26px 28px 70px; }
	.m-head h1 { font-size: 24px; }
	.m-kpis { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
	.m-kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row; }
	.m-kpi--hero { grid-column: auto; }
	.m-kpi--hero .m-kpi__value { font-size: 24px; }
	.m-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.m-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.m-grid--2-1 { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); align-items: start; }
	.m-sticky, .m-sticky-save { position: sticky; top: 84px; }
	.m-permgrid { grid-template-columns: repeat(3, 1fr); }
	.m-line { grid-template-columns: 2.2fr 1fr 1fr 80px 110px; }
	.m-line__product { grid-column: auto; padding-right: 0; }
	.m-line { padding-right: 48px; }
	.m-line .js-line-remove { top: auto; bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.m-items__info .m-pill { white-space: normal; text-align: left; }
.m-field > .m-btn { align-self: flex-start; }
