/* ============================================================================
   MartPOS design system — fresh market palette, dense but calm till UI.
   ========================================================================== */

html[data-bs-theme="light"],
:root:not([data-bs-theme]) {
    color-scheme: light;
}

html[data-bs-theme="dark"] {
    color-scheme: dark;
    --mx-forest: #071c16;
    --mx-forest-2: #061712;
    --mx-forest-3: #04110d;
    --mx-green: #22d3a0;
    --mx-green-dark: #5ee7b8;
    --mx-mint: #15382b;
    --mx-mint-2: #1d4a39;
    --mx-amber: #f5b93a;
    --mx-amber-soft: #3a2c0d;
    --mx-red: #ff7b72;
    --mx-red-bg: #3a1e1d;
    --mx-blue: #78aaff;
    --mx-blue-bg: #14283f;
    --mx-bg: #0b1512;
    --mx-surface: #111f1a;
    --mx-surface-2: #162a22;
    --mx-surface-3: #1b332a;
    --mx-line: #273f35;
    --mx-line-strong: #365848;
    --mx-ink: #e9f7f0;
    --mx-ink-2: #c4ded1;
    --mx-muted: #91b0a1;
    --mx-faint: #6f8f7e;
    --mx-shadow: 0 20px 40px -26px rgba(0, 0, 0, 0.72);
}

:root {
    --mx-forest: #0b2f27;
    --mx-forest-2: #08251f;
    --mx-forest-3: #061b16;
    --mx-green: #12b886;
    --mx-green-dark: #0a8f68;
    --mx-mint: #e6f8f1;
    --mx-mint-2: #d3f2e5;
    --mx-amber: #f59f00;
    --mx-amber-soft: #fff4d6;
    --mx-red: #d64545;
    --mx-red-bg: #fdeceb;
    --mx-blue: #3b82f6;
    --mx-blue-bg: #eaf2ff;
    --mx-bg: #f3f7f4;
    --mx-surface: #ffffff;
    --mx-surface-2: #f8fbf9;
    --mx-surface-3: #eef5f1;
    --mx-line: #dde8e1;
    --mx-line-strong: #c7d8ce;
    --mx-ink: #12241f;
    --mx-ink-2: #2b453c;
    --mx-muted: #667a71;
    --mx-faint: #93a69d;
    --mx-display: 'Outfit', 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mx-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mx-shadow: 0 20px 40px -30px rgba(11, 47, 39, 0.45);
    --mx-radius: 16px;
}

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

html,
body {
    margin: 0;
    padding: 0;
}

html {
    background: var(--mx-bg) !important;
}

body.mx-body {
    min-height: 100vh;
    background: var(--mx-bg) !important;
    color: var(--mx-ink);
    font-family: var(--mx-body);
    font-size: 14px;
    line-height: 1.5;
    user-select: text;
    overflow-x: hidden;
}

body.mx-body button {
    cursor: pointer;
}

/* The notification iframe is not needed here; the app-window-menu is the
   global theme/app switcher and must stay visible. */
body.mx-body #notif-frame {
    display: none !important;
}

body.mx-body #app-window-menu {
    opacity: 1 !important;
    font-family: var(--mx-body);
    color: var(--mx-ink);
    background: var(--mx-surface) !important;
    border-color: var(--mx-line) !important;
}

body.mx-body #app-window-menu #king {
    background: linear-gradient(145deg, var(--mx-green), var(--mx-green-dark)) !important;
    color: #fff !important;
}

body.mx-body #app-window-menu .awm-grid>*,
body.mx-body #app-window-menu .awm-footer>* {
    color: var(--mx-ink-2);
}

body.mx-body #app-window-menu .awm-head,
body.mx-body #app-window-menu .awm-footer {
    border-color: var(--mx-line);
}

body.mx-body button:not([class]) {
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
}

h1,
h2,
h3,
h4,
p,
ul {
    margin: 0;
}

ul {
    padding: 0;
    list-style: none;
}

a {
    color: var(--mx-green-dark);
    text-decoration: none;
}

img,
svg {
    display: block;
}

input,
select,
textarea {
    font: inherit;
    color: inherit;
}

select {
    cursor: pointer;
}

.mx-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--mx-green-dark);
    font-family: var(--mx-body);
    font-size: 0.74rem;
    font-weight: 800;
}

.mx-muted {
    color: var(--mx-muted);
}

.mx-hr {
    border: 0;
    border-top: 1px solid var(--mx-line);
    margin: 1rem 0;
}

/* ---- Boot / no-JS ------------------------------------------------------- */
.mx-boot,
.mx-noscript {
    min-height: 100vh;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.7rem;
    padding: 2rem;
    text-align: center;
    background: radial-gradient(50% 50% at 50% 0%, #dff7eb, transparent 70%), var(--mx-bg);
}

.mx-boot__mark {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(145deg, var(--mx-green), var(--mx-green-dark));
    color: #fff;
    box-shadow: 0 18px 30px -18px rgba(10, 143, 104, 0.8);
}

.mx-boot h1 {
    font-family: var(--mx-display);
    font-size: 1.8rem;
    letter-spacing: -0.04em;
}

.mx-boot p {
    color: var(--mx-muted);
    font-size: 0.8rem;
}

.mx-boot__spin {
    width: 20px;
    height: 20px;
    border: 2px solid var(--mx-line-strong);
    border-top-color: var(--mx-green);
    border-radius: 50%;
    animation: mxSpin 0.8s linear infinite;
}

/* ---- Auth --------------------------------------------------------------- */
.mx-auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
    background: var(--mx-bg);
}

.mx-auth__hero {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: clamp(28px, 4vw, 64px);
    overflow: hidden;
    background:
        radial-gradient(70% 60% at 10% 0%, rgba(18, 184, 134, 0.28), transparent 60%),
        radial-gradient(40% 50% at 100% 100%, rgba(245, 159, 0, 0.16), transparent 65%),
        linear-gradient(155deg, var(--mx-forest), var(--mx-forest-3));
    color: #e9fff6;
}

.mx-auth__hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(151, 255, 207, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(151, 255, 207, 0.045) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(70% 70% at 50% 30%, #000, transparent 80%);
    pointer-events: none;
}

.mx-auth__hero>* {
    position: relative;
    z-index: 1;
}

.mx-auth__copy {
    margin-block: auto;
    max-width: 560px;
}

.mx-auth__copy h1 {
    margin-top: 1rem;
    font-family: var(--mx-display);
    font-size: clamp(2.2rem, 4.4vw, 3.8rem);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.055em;
}

.mx-auth__copy h1 em {
    color: #7df3c5;
    font-style: normal;
}

.mx-auth__copy p {
    max-width: 48ch;
    margin-top: 1rem;
    color: #a9cfc0;
    font-size: 0.96rem;
    line-height: 1.7;
}

.mx-auth__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.36rem 0.72rem;
    border: 1px solid rgba(151, 255, 207, 0.24);
    border-radius: 999px;
    background: rgba(151, 255, 207, 0.07);
    color: #a8fbd7;
    font-family: var(--mx-display);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.mx-auth__eyebrow i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6ff0bd;
    box-shadow: 0 0 0 4px rgba(111, 240, 189, 0.14);
}

.mx-auth__points {
    display: grid;
    gap: 0.6rem;
    margin-top: 1.5rem;
}

.mx-auth__points li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: #d3f0e3;
    font-size: 0.84rem;
}

.mx-auth__points svg {
    color: #6ff0bd;
}

.mx-auth__foot {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
    color: #7fae9a;
    font-size: 0.7rem;
}

.mx-auth__foot strong {
    display: block;
    color: #e4fff2;
    font-family: var(--mx-display);
    font-size: 1rem;
}

.mx-auth__panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4vw, 56px);
    background: radial-gradient(50% 40% at 50% 0%, #e8f9f1, transparent 70%), var(--mx-bg);
}

.mx-auth__card {
    width: min(440px, 100%);
}

.mx-auth__mobile-brand {
    display: none;
    margin-bottom: 1.5rem;
}

.mx-auth__title {
    font-family: var(--mx-display);
    font-size: clamp(1.65rem, 2.6vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.045em;
}

.mx-auth__sub {
    margin-top: 0.35rem;
    color: var(--mx-muted);
    font-size: 0.86rem;
}

.mx-auth__notice {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin-top: 1rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #bfe7d5;
    border-radius: 10px;
    background: var(--mx-mint);
    color: var(--mx-green-dark);
    font-size: 0.7rem;
    line-height: 1.45;
}

.mx-auth__notice svg {
    margin-top: 0.1rem;
}

.mx-auth__sso {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    margin-top: 1rem;
    padding: 0.62rem 0.7rem;
    border: 1px solid var(--mx-line-strong);
    border-radius: 12px;
    background: var(--mx-surface);
    color: var(--mx-ink);
    font-family: var(--mx-body);
    text-align: left;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.mx-auth__sso:hover {
    border-color: var(--mx-green);
    background: var(--mx-mint);
    transform: translateY(-1px);
}

.mx-auth__sso:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

.mx-auth__sso-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--mx-mint);
    color: var(--mx-green-dark);
}

.mx-auth__sso-copy {
    display: grid;
    gap: 0.08rem;
    min-width: 0;
}

.mx-auth__sso-copy b {
    font-family: var(--mx-display);
    font-size: 0.8rem;
    font-weight: 700;
}

.mx-auth__sso-copy small {
    overflow: hidden;
    color: var(--mx-muted);
    font-size: 0.64rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mx-auth__sso>svg {
    margin-left: auto;
    color: var(--mx-green-dark);
}

.mx-auth__or {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1rem;
    color: var(--mx-faint);
    font-size: 0.62rem;
}

.mx-auth__or::before,
.mx-auth__or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--mx-line);
}

.mx-auth__tabs {
    display: flex;
    gap: 0.3rem;
    margin: 1.2rem 0 1.1rem;
    padding: 4px;
    border: 1px solid var(--mx-line);
    border-radius: 12px;
    background: var(--mx-surface-3);
}

.mx-auth__tab {
    flex: 1;
    padding: 0.55rem 0.6rem;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--mx-muted);
    font-family: var(--mx-display);
    font-size: 0.78rem;
    font-weight: 700;
}

.mx-auth__tab[aria-selected="true"] {
    background: var(--mx-surface);
    color: var(--mx-ink);
    box-shadow: 0 4px 12px -8px rgba(6, 37, 28, 0.45);
}

.mx-auth__demo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1rem;
    padding: 0.7rem 0.8rem;
    border: 1px dashed var(--mx-line-strong);
    border-radius: 12px;
    background: var(--mx-surface-2);
    color: var(--mx-muted);
    font-size: 0.74rem;
    line-height: 1.45;
}

.mx-auth__demo button {
    margin-left: auto;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: none;
    color: var(--mx-green-dark);
    font-family: var(--mx-display);
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}

.mx-auth__legal {
    margin-top: 1rem;
    color: var(--mx-faint);
    font-size: 0.66rem;
    line-height: 1.5;
    text-align: center;
}

/* ---- Brand -------------------------------------------------------------- */
.mx-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: inherit;
}

.mx-brand__mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(145deg, var(--mx-green), var(--mx-green-dark));
    color: #fff;
    box-shadow: 0 10px 20px -14px rgba(10, 143, 104, 0.9);
}

.mx-brand__name {
    display: grid;
    font-family: var(--mx-display);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.mx-brand__name small {
    color: var(--mx-faint);
    font-family: var(--mx-body);
    font-size: 0.56rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.mx-auth__hero .mx-brand__name small {
    color: #7fae9a;
}

/* ---- Buttons / fields --------------------------------------------------- */
.mx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.62rem 0.95rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: var(--mx-display);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.mx-btn:active {
    transform: translateY(1px);
}

.mx-btn--primary {
    background: linear-gradient(145deg, #16c48e, var(--mx-green-dark));
    color: #fff;
    box-shadow: 0 12px 26px -16px rgba(10, 143, 104, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.mx-btn--primary:hover {
    box-shadow: 0 18px 34px -16px rgba(10, 143, 104, 0.95);
}

.mx-btn--ghost {
    border-color: var(--mx-line-strong);
    background: var(--mx-surface);
    color: var(--mx-ink-2);
}

.mx-btn--ghost:hover {
    background: var(--mx-surface-2);
}

.mx-btn--soft {
    background: var(--mx-mint);
    color: var(--mx-green-dark);
}

.mx-btn--danger {
    background: var(--mx-red-bg);
    color: var(--mx-red);
}

.mx-btn--sm {
    padding: 0.44rem 0.7rem;
    font-size: 0.7rem;
    border-radius: 8px;
}

.mx-btn--block {
    width: 100%;
}

.mx-btn[disabled] {
    opacity: 0.55;
    pointer-events: none;
}

.mx-field {
    display: grid;
    gap: 0.32rem;
    min-width: 0;
}

.mx-field label {
    color: var(--mx-ink-2);
    font-size: 0.7rem;
    font-weight: 700;
}

.mx-field__hint {
    color: var(--mx-faint);
    font-size: 0.65rem;
    line-height: 1.4;
}

.mx-input,
.mx-select {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--mx-line);
    border-radius: 9px;
    background: var(--mx-surface);
    color: var(--mx-ink);
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.mx-input:focus,
.mx-select:focus {
    border-color: var(--mx-green);
    box-shadow: 0 0 0 3px rgba(18, 184, 134, 0.13);
}

.mx-input[disabled] {
    background: var(--mx-surface-3);
    color: var(--mx-muted);
}

.mx-select--auto {
    width: auto;
    min-width: 150px;
}

.mx-input--date {
    width: auto;
}

.mx-check label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.mx-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.mx-field--full {
    grid-column: 1 / -1;
}

.mx-image-field {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 0.7rem;
    align-items: start;
}

.mx-image-preview {
    display: grid;
    place-items: center;
    width: 116px;
    height: 96px;
    overflow: hidden;
    border: 1px dashed var(--mx-line-strong);
    border-radius: 12px;
    background: var(--mx-surface-2);
    color: var(--mx-muted);
}

.mx-image-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mx-image-preview__empty {
    display: grid;
    place-items: center;
    gap: 0.15rem;
    padding: 0.4rem;
    text-align: center;
}

.mx-image-preview__empty b {
    color: var(--mx-ink-2);
    font-size: 0.66rem;
}

.mx-image-preview__empty small {
    font-size: 0.56rem;
    line-height: 1.25;
}

.mx-image-side {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
}

.mx-image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* ---- Shell -------------------------------------------------------------- */
.mx-app {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    min-height: 100vh;
}

.mx-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    height: 100vh;
    padding: 1.1rem 0.9rem;
    overflow-y: auto;
    background: linear-gradient(180deg, var(--mx-forest), var(--mx-forest-3));
    color: #e8fff5;
}

.mx-sidebar .mx-brand {
    padding: 0.25rem 0.25rem 0.9rem;
    color: #fff;
}

.mx-sidebar .mx-brand__mark {
    width: 36px;
    height: 36px;
}

.mx-sidebar__label {
    padding: 0.4rem 0.55rem;
    color: #6f9b88;
    font-family: var(--mx-display);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.mx-nav {
    display: grid;
    gap: 0.18rem;
}

.mx-nav__link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.65rem;
    border-radius: 9px;
    color: #a7c9ba;
    font-size: 0.76rem;
    font-weight: 600;
    transition: background 0.16s ease, color 0.16s ease;
}

.mx-nav__link:hover {
    background: rgba(255, 255, 255, 0.055);
    color: #fff;
}

.mx-nav__link.is-active {
    background: rgba(111, 240, 189, 0.14);
    color: #9dfbcc;
    box-shadow: inset 2px 0 0 #6ff0bd;
}

.mx-sidebar__spacer {
    flex: 1;
}

.mx-plan-card {
    padding: 0.65rem;
    border: 1px solid rgba(151, 255, 207, 0.13);
    border-radius: 11px;
    background: rgba(151, 255, 207, 0.06);
}

.mx-plan-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    color: #8fc3ae;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.mx-plan-card__top span:last-child {
    color: #9dfbcc;
}

.mx-plan-card h4 {
    margin-top: 0.4rem;
    font-family: var(--mx-display);
    font-size: 0.8rem;
    font-weight: 700;
}

.mx-plan-card p {
    margin-top: 0.18rem;
    color: #89b29f;
    font-size: 0.62rem;
}

.mx-plan-card a {
    display: inline-flex;
    margin-top: 0.45rem;
    color: #9dfbcc;
    font-size: 0.64rem;
    font-weight: 700;
}

.mx-sidebar__user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(151, 255, 207, 0.12);
}

.mx-sidebar__user div {
    display: grid;
    min-width: 0;
}

.mx-sidebar__user strong {
    overflow: hidden;
    color: #e8fff5;
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mx-sidebar__user small {
    color: #7fae9a;
    font-size: 0.58rem;
}

.mx-sidebar__user button {
    margin-left: auto;
    padding: 0;
    border: 0;
    background: none;
    color: #7fae9a;
}

.mx-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(145deg, #e5fff4, #c9f4e2);
    color: var(--mx-green-dark);
    font-family: var(--mx-display);
    font-size: 0.62rem;
    font-weight: 800;
}

.mx-avatar--lg {
    width: 46px;
    height: 46px;
    font-size: 0.8rem;
}

.mx-backdrop {
    display: none;
}

.mx-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.mx-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 64px;
    padding: 0 1.4rem;
    border-bottom: 1px solid var(--mx-line);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(14px);
}

.mx-topbar__menu {
    display: none;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--mx-line);
    border-radius: 10px;
    background: var(--mx-surface);
    color: var(--mx-ink);
}

.mx-topbar__title {
    display: grid;
    min-width: 0;
}

.mx-topbar__title span {
    font-family: var(--mx-display);
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.mx-topbar__title small {
    color: var(--mx-muted);
    font-size: 0.64rem;
}

.mx-topbar__spacer {
    flex: 1;
}

.mx-branch-pick {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.36rem 0.55rem;
    border: 1px solid var(--mx-line);
    border-radius: 9px;
    background: var(--mx-surface);
    color: var(--mx-ink-2);
    font-size: 0.7rem;
}

.mx-branch-pick select {
    max-width: 150px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    outline: none;
}

.mx-topbar__date {
    color: var(--mx-muted);
    font-size: 0.7rem;
    white-space: nowrap;
}

.mx-icon-btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--mx-line);
    border-radius: 10px;
    background: var(--mx-surface);
    color: var(--mx-ink-2);
}

.mx-icon-btn:hover {
    background: var(--mx-surface-2);
    border-color: var(--mx-line-strong);
}

.mx-icon-btn--sm {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.mx-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mx-red);
    box-shadow: 0 0 0 2px #fff;
}

.mx-user-chip {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding-left: 0.7rem;
    border-left: 1px solid var(--mx-line);
}

.mx-user-chip>span:last-child {
    display: grid;
    font-size: 0.7rem;
    font-weight: 700;
}

.mx-user-chip small {
    color: var(--mx-muted);
    font-size: 0.58rem;
    font-weight: 500;
}

.mx-content {
    flex: 1;
    padding: clamp(16px, 2.4vw, 28px);
}

.mx-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.mx-page-head h1 {
    font-family: var(--mx-display);
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.mx-page-head p {
    margin-top: 0.18rem;
    color: var(--mx-muted);
    font-size: 0.78rem;
}

.mx-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

/* ---- Cards / stats ------------------------------------------------------ */
.mx-card {
    min-width: 0;
    border: 1px solid var(--mx-line);
    border-radius: var(--mx-radius);
    background: var(--mx-surface);
    box-shadow: var(--mx-shadow);
    overflow: hidden;
}

.mx-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.9rem 1rem 0.6rem;
}

.mx-card__head h3 {
    font-family: var(--mx-display);
    font-size: 0.86rem;
    font-weight: 800;
}

.mx-card__head p {
    margin-top: 0.12rem;
    color: var(--mx-muted);
    font-size: 0.66rem;
}

.mx-card__body {
    padding: 0 1rem 1rem;
}

.mx-card__body>.mx-empty {
    padding: 1.4rem 0.4rem;
}

.mx-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.mx-stat {
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--mx-line);
    border-radius: 14px;
    background: var(--mx-surface);
    box-shadow: var(--mx-shadow);
}

.mx-stat__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--mx-muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.mx-stat__top i {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--mx-surface-3);
    color: var(--mx-ink-2);
}

.mx-stat--green .mx-stat__top i {
    background: var(--mx-mint);
    color: var(--mx-green-dark);
}

.mx-stat--amber .mx-stat__top i {
    background: var(--mx-amber-soft);
    color: #a36b00;
}

.mx-stat--blue .mx-stat__top i {
    background: var(--mx-blue-bg);
    color: #1d5fc4;
}

.mx-stat--red .mx-stat__top i {
    background: var(--mx-red-bg);
    color: var(--mx-red);
}

.mx-stat strong {
    display: block;
    margin-top: 0.5rem;
    font-family: var(--mx-display);
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.mx-stat small {
    color: var(--mx-muted);
    font-size: 0.64rem;
}

.mx-dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
    gap: 0.8rem;
}

.mx-card--wide {
    grid-column: 1 / -1;
}

.mx-report-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr);
    gap: 0.8rem;
}

.mx-quick {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.mx-quick__btn {
    display: grid;
    gap: 0.35rem;
    padding: 0.75rem;
    border: 1px solid var(--mx-line);
    border-radius: 11px;
    background: var(--mx-surface-2);
    color: var(--mx-ink);
    text-align: left;
}

.mx-quick__btn:hover {
    border-color: var(--mx-green);
    background: var(--mx-mint);
}

.mx-quick__btn span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--mx-mint);
    color: var(--mx-green-dark);
}

.mx-quick__btn b {
    font-size: 0.72rem;
}

.mx-list {
    display: grid;
}

.mx-list__row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.52rem 0;
    border-bottom: 1px solid var(--mx-line);
}

.mx-list__row:last-child {
    border-bottom: 0;
}

.mx-list__main {
    display: grid;
    min-width: 0;
    flex: 1;
}

.mx-list__main strong {
    overflow: hidden;
    font-size: 0.72rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mx-list__main small {
    color: var(--mx-muted);
    font-size: 0.6rem;
}

.mx-list__meta {
    display: grid;
    justify-items: end;
    gap: 0.18rem;
    min-width: 90px;
}

.mx-list__meta b {
    font-size: 0.72rem;
}

.mx-list__meta span {
    color: var(--mx-muted);
    font-size: 0.58rem;
}

.mx-mini-bar {
    display: block;
    width: 100%;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--mx-surface-3);
}

.mx-mini-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #16c48e, #0a8f68);
}

.mx-paymix {
    display: grid;
    gap: 0.55rem;
}

.mx-paymix__row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mx-paymix__icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--mx-surface-3);
    color: var(--mx-ink-2);
}

.mx-paymix__main {
    display: grid;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.mx-paymix__main>div {
    display: flex;
    justify-content: space-between;
    gap: 0.4rem;
    font-size: 0.66rem;
}

.mx-paymix__main>div span {
    color: var(--mx-muted);
}

.mx-paymix__row strong {
    font-size: 0.68rem;
    white-space: nowrap;
}

.mx-alert-card {
    display: flex;
    gap: 0.65rem;
    padding: 0.7rem;
    border: 1px solid var(--mx-line);
    border-radius: 11px;
}

.mx-alert-card>svg {
    flex: 0 0 auto;
    margin-top: 0.1rem;
}

.mx-alert-card b {
    display: block;
    font-size: 0.74rem;
}

.mx-alert-card p {
    margin-top: 0.18rem;
    color: var(--mx-muted);
    font-size: 0.64rem;
}

.mx-alert-card a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.4rem;
    font-size: 0.64rem;
    font-weight: 800;
}

.mx-alert-card--ok {
    background: var(--mx-mint);
    border-color: #bfe7d5;
    color: var(--mx-green-dark);
}

.mx-alert-card--warn {
    background: var(--mx-amber-soft);
    border-color: #f1dfb3;
    color: #8b5c00;
}

.mx-alert-card--danger {
    background: var(--mx-red-bg);
    border-color: #f3d0cd;
    color: var(--mx-red);
}

.mx-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
    margin-bottom: 0.9rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--mx-line);
    border-radius: 10px;
    font-size: 0.7rem;
}

.mx-banner b {
    font-size: 0.72rem;
}

.mx-banner--warn {
    background: var(--mx-amber-soft);
    border-color: #f1dfb3;
    color: #8b5c00;
}

.mx-banner--danger {
    background: var(--mx-red-bg);
    border-color: #f3d0cd;
    color: var(--mx-red);
}

/* ---- Charts ------------------------------------------------------------- */
.mx-bars {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 170px;
    padding-top: 0.4rem;
    border-bottom: 1px solid var(--mx-line);
}

.mx-bar {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-width: 0;
    height: 100%;
}

.mx-bar__fill {
    width: 100%;
    height: var(--h, 2%);
    min-height: 2px;
    border-radius: 4px 4px 1px 1px;
    background: linear-gradient(180deg, #2ed6a1, #0e9f6e);
    transition: height 0.35s ease;
}

.mx-bar:hover .mx-bar__fill {
    background: linear-gradient(180deg, #5ce3b8, #0a8f68);
}

.mx-bar__tip {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    z-index: 3;
    transform: translateX(-50%) translateY(3px);
    padding: 0.25rem 0.4rem;
    border-radius: 5px;
    background: var(--mx-forest);
    color: #eafff5;
    font-size: 0.55rem;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.mx-bar:hover .mx-bar__tip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.mx-bar:first-child .mx-bar__tip {
    left: 0;
    transform: translateY(3px);
}

.mx-bar:first-child:hover .mx-bar__tip,
.mx-bar:last-child:hover .mx-bar__tip {
    transform: translateY(0);
}

.mx-bar:last-child .mx-bar__tip {
    right: 0;
    left: auto;
    transform: translateY(3px);
}

.mx-bar-labels {
    display: flex;
    gap: 5px;
    margin-top: 0.35rem;
    color: var(--mx-faint);
    font-size: 0.55rem;
}

.mx-bar-labels span {
    flex: 1;
    text-align: center;
}

.mx-legend {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--mx-muted);
    font-size: 0.62rem;
}

.mx-legend i {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: linear-gradient(180deg, #2ed6a1, #0e9f6e);
}

/* ---- Badges / stock ----------------------------------------------------- */
.mx-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.18rem 0.42rem;
    border-radius: 999px;
    background: var(--mx-surface-3);
    color: var(--mx-ink-2);
    font-size: 0.58rem;
    font-weight: 800;
    white-space: nowrap;
}

.mx-badge--green {
    background: var(--mx-mint);
    color: var(--mx-green-dark);
}

.mx-badge--amber {
    background: var(--mx-amber-soft);
    color: #8b5c00;
}

.mx-badge--red {
    background: var(--mx-red-bg);
    color: var(--mx-red);
}

.mx-badge--ghost {
    border: 1px solid var(--mx-line);
    background: transparent;
    color: var(--mx-muted);
}

.mx-stock {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    padding: 0.16rem 0.38rem;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 800;
    white-space: nowrap;
}

.mx-stock--ok {
    background: var(--mx-mint);
    color: var(--mx-green-dark);
}

.mx-stock--low {
    background: var(--mx-amber-soft);
    color: #8b5c00;
}

.mx-stock--out {
    background: var(--mx-red-bg);
    color: var(--mx-red);
}

.mx-stock--service {
    background: var(--mx-blue-bg);
    color: #1d5fc4;
}

/* ---- Toolbar / tables --------------------------------------------------- */
.mx-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.mx-toolbar__count {
    margin-left: auto;
    color: var(--mx-muted);
    font-size: 0.66rem;
}

.mx-search {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0 0.65rem;
    border: 1px solid var(--mx-line);
    border-radius: 10px;
    background: var(--mx-surface);
    color: var(--mx-muted);
}

.mx-search:focus-within {
    border-color: var(--mx-green);
    box-shadow: 0 0 0 3px rgba(18, 184, 134, 0.12);
}

.mx-search .mx-input {
    border: 0;
    padding: 0.62rem 0;
    box-shadow: none;
    background: transparent;
}

.mx-search--sm {
    min-width: 260px;
}

.mx-search kbd {
    padding: 0.12rem 0.3rem;
    border: 1px solid var(--mx-line);
    border-radius: 4px;
    background: var(--mx-surface-2);
    color: var(--mx-faint);
    font-size: 0.55rem;
}

.mx-tabs {
    display: flex;
    gap: 0.2rem;
    margin-bottom: 0.85rem;
    padding: 4px;
    border: 1px solid var(--mx-line);
    border-radius: 11px;
    background: var(--mx-surface-3);
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.mx-tabs::-webkit-scrollbar {
    display: none;
}

.mx-tab {
    flex: 0 0 auto;
}

.mx-tabs--inline {
    margin: 0;
}

.mx-tab {
    padding: 0.42rem 0.72rem;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--mx-muted);
    font-family: var(--mx-display);
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.mx-tab.is-active {
    background: var(--mx-surface);
    color: var(--mx-ink);
    box-shadow: 0 4px 12px -8px rgba(6, 37, 28, 0.45);
}

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

.mx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem;
}

.mx-table th {
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid var(--mx-line);
    background: var(--mx-surface-2);
    color: var(--mx-muted);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.mx-table td {
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid var(--mx-line);
    vertical-align: middle;
}

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

.mx-table tbody tr:hover {
    background: var(--mx-surface-2);
}

.mx-cell-product {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.mx-cell-main {
    display: grid;
    min-width: 0;
}

.mx-cell-main strong {
    overflow: hidden;
    font-size: 0.72rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mx-cell-main small {
    color: var(--mx-muted);
    font-size: 0.58rem;
}

.mx-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.25rem;
}

/* ---- POS ---------------------------------------------------------------- */
.mx-register {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--mx-line);
    border-radius: 10px;
    background: var(--mx-surface);
    font-size: 0.68rem;
}

.mx-register b {
    font-size: 0.7rem;
}

.mx-register>span:not(.mx-register__dot) {
    color: var(--mx-muted);
}

.mx-register .mx-btn {
    margin-left: auto;
}

.mx-register__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mx-faint);
}

.mx-register--open {
    border-color: #bfe7d5;
    background: var(--mx-mint);
}

.mx-register--open .mx-register__dot {
    background: var(--mx-green);
    box-shadow: 0 0 0 4px rgba(18, 184, 134, 0.14);
}

.mx-pos {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 0.8rem;
    align-items: start;
}

.mx-pos__browse {
    display: grid;
    gap: 0.6rem;
    min-width: 0;
}

.mx-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.mx-chip {
    padding: 0.34rem 0.66rem;
    border: 1px solid var(--mx-line);
    border-radius: 999px;
    background: var(--mx-surface);
    color: var(--mx-muted);
    font-family: var(--mx-body);
    font-size: 0.66rem;
    font-weight: 700;
    white-space: nowrap;
}

.mx-chip span {
    opacity: 0.62;
}

.mx-chip.is-active {
    border-color: var(--mx-green);
    background: var(--mx-mint);
    color: var(--mx-green-dark);
}

.mx-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.55rem;
}

.mx-product {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    padding: 0.62rem;
    border: 1px solid var(--mx-line);
    border-radius: 12px;
    background: var(--mx-surface);
    color: var(--mx-ink);
    font-family: var(--mx-body);
    text-align: left;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.mx-product:hover {
    transform: translateY(-2px);
    border-color: rgba(18, 184, 134, 0.55);
    box-shadow: var(--mx-shadow);
}

.mx-product.is-disabled {
    opacity: 0.52;
    transform: none;
    cursor: not-allowed;
}

.mx-product.is-in-cart {
    border-color: var(--mx-green);
    background: var(--mx-mint);
    box-shadow: inset 0 0 0 1px var(--mx-green), var(--mx-shadow);
}

.mx-product__cart-badge {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
    padding: 0.16rem 0.38rem;
    border: 1px solid rgba(157, 251, 204, 0.4);
    border-radius: 999px;
    background: var(--mx-forest);
    color: #9dfbcc;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 5px 12px -6px rgba(5, 24, 19, 0.8);
}

.mx-product__cart-badge b {
    font-size: 0.62rem;
}

.mx-product__thumb {
    display: grid;
    place-items: center;
    width: 100%;
    height: 58px;
    border-radius: 9px;
    background: var(--mx-surface-3);
    color: var(--mx-ink-2);
    font-family: var(--mx-display);
    font-size: 1.3rem;
    font-weight: 800;
}

.mx-product__thumb--mint {
    background: var(--mx-mint);
    color: var(--mx-green-dark);
}

.mx-product__thumb--amber {
    background: var(--mx-amber-soft);
    color: #8b5c00;
}

.mx-product__thumb--blue {
    background: var(--mx-blue-bg);
    color: #1d5fc4;
}

.mx-product__thumb--cyan {
    background: #e4f9ff;
    color: #087f9a;
}

.mx-product__thumb--pink {
    background: #ffe9f2;
    color: #b02a63;
}

.mx-product__thumb--violet {
    background: #f0e9ff;
    color: #6d3bc4;
}

.mx-product__thumb--green {
    background: var(--mx-mint);
    color: var(--mx-green-dark);
}

.mx-product__thumb--slate {
    background: var(--mx-surface-3);
    color: var(--mx-ink-2);
}

.mx-product__thumb--image {
    padding: 0;
    overflow: hidden;
    background: var(--mx-surface-3);
}

.mx-product__thumb--image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mx-product__thumb--sm {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.mx-product__name {
    overflow: hidden;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mx-product__sub {
    overflow: hidden;
    color: var(--mx-muted);
    font-size: 0.58rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mx-product__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem;
    margin-top: 0.18rem;
}

.mx-product__foot b {
    font-family: var(--mx-display);
    font-size: 0.75rem;
}

.mx-cart {
    position: sticky;
    top: 78px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 96px);
    overflow: hidden;
    border: 1px solid var(--mx-line);
    border-radius: var(--mx-radius);
    background: var(--mx-surface);
    box-shadow: var(--mx-shadow);
}

.mx-cart__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 0.8rem;
    border-bottom: 1px solid var(--mx-line);
}

.mx-cart__head h2 {
    font-family: var(--mx-display);
    font-size: 0.85rem;
    font-weight: 800;
}

.mx-cart__head h2 span {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    margin-left: 0.2rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--mx-mint);
    color: var(--mx-green-dark);
    font-size: 0.6rem;
}

.mx-cart__scroll {
    flex: 1;
    min-height: 90px;
    max-height: 280px;
    overflow-y: auto;
    padding: 0 0.8rem;
}

.mx-cart__empty {
    display: grid;
    justify-items: center;
    gap: 0.25rem;
    padding: 1.8rem 0.5rem;
    color: var(--mx-muted);
    text-align: center;
}

.mx-cart__empty svg {
    color: var(--mx-faint);
}

.mx-cart__empty b {
    font-size: 0.74rem;
    color: var(--mx-ink);
}

.mx-cart__empty span {
    font-size: 0.62rem;
}

.mx-cart__foot {
    display: grid;
    gap: 0.55rem;
    padding: 0.7rem 0.8rem 0.8rem;
    border-top: 1px solid var(--mx-line);
    background: var(--mx-surface-2);
}

.mx-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--mx-line);
}

.mx-line:last-child {
    border-bottom: 0;
}

.mx-line__main {
    display: grid;
    min-width: 0;
}

.mx-line__main strong {
    overflow: hidden;
    font-size: 0.68rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mx-line__main small {
    color: var(--mx-muted);
    font-size: 0.56rem;
}

.mx-line__qty {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.mx-line__qty button {
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    padding: 0;
    border: 1px solid var(--mx-line);
    border-radius: 5px;
    background: var(--mx-surface);
    color: var(--mx-ink-2);
}

.mx-line__qty b {
    min-width: 18px;
    text-align: center;
    font-size: 0.66rem;
}

.mx-line__total {
    font-size: 0.66rem;
    white-space: nowrap;
}

.mx-line__del {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--mx-faint);
}

.mx-line__del:hover {
    background: var(--mx-red-bg);
    color: var(--mx-red);
}

.mx-loyalty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.45rem 0.5rem;
    border: 1px solid #f1dfb3;
    border-radius: 9px;
    background: var(--mx-amber-soft);
}

.mx-loyalty div:first-child {
    display: grid;
}

.mx-loyalty b {
    font-size: 0.64rem;
    color: #8b5c00;
}

.mx-loyalty span {
    font-size: 0.56rem;
    color: #a36b00;
}

.mx-loyalty__input {
    display: flex;
    gap: 0.25rem;
    width: 120px;
}

.mx-loyalty__input .mx-input {
    padding: 0.35rem 0.4rem;
    font-size: 0.62rem;
}

.mx-totals {
    display: grid;
    gap: 0.16rem;
}

.mx-totals>div {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--mx-muted);
    font-size: 0.66rem;
}

.mx-totals>div b {
    color: var(--mx-ink);
    font-weight: 700;
}

.mx-totals__discount b {
    color: var(--mx-green-dark);
}

.mx-totals__grand {
    margin-top: 0.22rem;
    padding-top: 0.28rem;
    border-top: 1px solid var(--mx-line);
    color: var(--mx-ink) !important;
    font-family: var(--mx-display);
    font-size: 0.86rem !important;
    font-weight: 800;
}

.mx-totals__grand b {
    font-size: 0.92rem;
}

.mx-pay-methods {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.25rem;
}

.mx-pay-method {
    display: grid;
    justify-items: center;
    gap: 0.12rem;
    padding: 0.36rem 0.15rem;
    border: 1px solid var(--mx-line);
    border-radius: 8px;
    background: var(--mx-surface);
    color: var(--mx-muted);
    font-family: var(--mx-body);
    font-size: 0.52rem;
    font-weight: 700;
}

.mx-pay-method.is-active {
    border-color: var(--mx-green);
    background: var(--mx-mint);
    color: var(--mx-green-dark);
}

.mx-pay-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem;
    align-items: end;
}

.mx-change {
    display: grid;
    justify-items: end;
    padding-bottom: 0.1rem;
}

.mx-change span {
    color: var(--mx-muted);
    font-size: 0.56rem;
}

.mx-change b {
    font-family: var(--mx-display);
    font-size: 0.8rem;
}

/* ---- Modals / toasts ---------------------------------------------------- */
.mx-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(5, 24, 19, 0.55);
    backdrop-filter: blur(3px);
    animation: mxFade 0.16s ease;
}

.mx-modal__panel {
    display: flex;
    flex-direction: column;
    width: min(620px, 100%);
    max-height: 90vh;
    overflow: hidden;
    border: 1px solid var(--mx-line);
    border-radius: 16px;
    background: var(--mx-surface);
    box-shadow: 0 30px 80px -30px rgba(5, 24, 19, 0.6);
    animation: mxPop 0.18s ease;
}

.mx-modal__panel--sm {
    width: min(430px, 100%);
}

.mx-modal__panel--lg {
    width: min(820px, 100%);
}

.mx-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.9rem 1rem 0.65rem;
    border-bottom: 1px solid var(--mx-line);
}

.mx-modal__head h2 {
    font-family: var(--mx-display);
    font-size: 1rem;
    font-weight: 800;
}

.mx-modal__head p {
    margin-top: 0.15rem;
    color: var(--mx-muted);
    font-size: 0.66rem;
}

.mx-modal__close {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--mx-muted);
}

.mx-modal__close:hover {
    background: var(--mx-surface-3);
}

.mx-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 0.9rem 1rem;
}

.mx-modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    padding: 0.65rem 1rem;
    border-top: 1px solid var(--mx-line);
    background: var(--mx-surface-2);
}

.mx-modal-copy {
    color: var(--mx-muted);
    font-size: 0.76rem;
    line-height: 1.55;
}

.mx-toasts {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 200;
    display: grid;
    gap: 0.4rem;
    width: min(340px, calc(100vw - 2rem));
}

.mx-toast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--mx-line);
    border-radius: 10px;
    background: var(--mx-surface);
    box-shadow: 0 18px 40px -22px rgba(5, 24, 19, 0.5);
    font-size: 0.7rem;
    animation: mxToastIn 0.18s ease;
}

.mx-toast__icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: var(--mx-mint);
    color: var(--mx-green-dark);
}

.mx-toast--error .mx-toast__icon {
    background: var(--mx-red-bg);
    color: var(--mx-red);
}

.mx-toast--warn .mx-toast__icon {
    background: var(--mx-amber-soft);
    color: #8b5c00;
}

.mx-toast__close {
    margin-left: auto;
    padding: 0;
    border: 0;
    background: none;
    color: var(--mx-faint);
}

.mx-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2.4rem 1rem;
    color: var(--mx-muted);
    font-size: 0.74rem;
}

.mx-spinner svg {
    animation: mxSpin 0.8s linear infinite;
    color: var(--mx-green);
}

.mx-empty {
    display: grid;
    justify-items: center;
    gap: 0.3rem;
    padding: 2.2rem 1rem;
    text-align: center;
    color: var(--mx-muted);
}

.mx-empty__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--mx-surface-3);
    color: var(--mx-faint);
}

.mx-empty h3 {
    font-family: var(--mx-display);
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--mx-ink);
}

.mx-empty p {
    max-width: 34ch;
    font-size: 0.68rem;
}

.mx-account {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
}

.mx-account div {
    display: grid;
}

.mx-account b {
    font-size: 0.86rem;
}

.mx-account span {
    color: var(--mx-muted);
    font-size: 0.66rem;
}

.mx-mini-list {
    display: grid;
    gap: 0.3rem;
}

.mx-mini-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--mx-line);
    border-radius: 9px;
    background: var(--mx-surface-2);
    color: var(--mx-ink-2);
    font-family: var(--mx-body);
    font-size: 0.7rem;
    text-align: left;
}

.mx-mini-row>span:last-child {
    margin-left: auto;
    color: var(--mx-muted);
    font-size: 0.62rem;
}

.mx-customer-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.mx-customer-stats>div {
    padding: 0.6rem;
    border: 1px solid var(--mx-line);
    border-radius: 10px;
    background: var(--mx-surface-2);
}

.mx-customer-stats span {
    display: block;
    color: var(--mx-muted);
    font-size: 0.6rem;
}

.mx-customer-stats b {
    display: block;
    margin-top: 0.15rem;
    font-family: var(--mx-display);
    font-size: 1rem;
}

.mx-batch-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-bottom: 0.6rem;
    color: var(--mx-muted);
    font-size: 0.66rem;
}

.mx-batch-head b {
    color: var(--mx-ink);
}

.mx-receive-lines {
    display: grid;
    gap: 0.4rem;
    margin: 0.65rem 0;
}

.mx-receive-line {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) 72px 86px 100px 126px 26px;
    gap: 0.3rem;
    align-items: center;
}

.mx-receive-line .mx-input,
.mx-receive-line .mx-select {
    padding: 0.42rem 0.45rem;
    font-size: 0.66rem;
}

.mx-plan-usage {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.mx-plan-usage>div {
    padding: 0.6rem;
    border: 1px solid var(--mx-line);
    border-radius: 10px;
    background: var(--mx-surface-2);
}

.mx-plan-usage span {
    display: block;
    color: var(--mx-muted);
    font-size: 0.6rem;
}

.mx-plan-usage b {
    display: block;
    margin-top: 0.15rem;
    font-family: var(--mx-display);
    font-size: 0.9rem;
}

.mx-feature-list {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.mx-feature-list li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
}

.mx-feature-list svg {
    color: var(--mx-green-dark);
}

/* ---- Receipt ------------------------------------------------------------ */
.mx-receipt {
    width: min(360px, 100%);
    margin-inline: auto;
    padding: 1.1rem;
    border: 1px solid var(--mx-line);
    border-radius: 14px;
    background: #fff;
    color: #17231f;
    font-size: 0.72rem;
}

.mx-receipt__brand {
    padding-bottom: 0.65rem;
    border-bottom: 1px dashed #b9c9c2;
    text-align: center;
}

.mx-receipt__brand h3 {
    font-family: var(--mx-display);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.mx-receipt__brand p {
    color: #5d7169;
    font-size: 0.6rem;
}

.mx-receipt__meta {
    display: grid;
    gap: 0.16rem;
    padding: 0.55rem 0;
    border-bottom: 1px dashed #b9c9c2;
    color: #5d7169;
    font-size: 0.6rem;
}

.mx-receipt__meta div {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.mx-receipt__meta b {
    color: #17231f;
    font-weight: 600;
}

.mx-receipt__items {
    display: grid;
    gap: 0.28rem;
    padding: 0.55rem 0;
    border-bottom: 1px dashed #b9c9c2;
}

.mx-receipt__line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    font-size: 0.64rem;
}

.mx-receipt__line small {
    display: block;
    color: #74877f;
    font-size: 0.56rem;
}

.mx-receipt__totals {
    display: grid;
    gap: 0.16rem;
    padding: 0.55rem 0;
    border-bottom: 1px dashed #b9c9c2;
}

.mx-receipt__totals div {
    display: flex;
    justify-content: space-between;
    color: #5d7169;
    font-size: 0.64rem;
}

.mx-receipt__totals .is-total {
    margin-top: 0.2rem;
    padding-top: 0.25rem;
    border-top: 1px solid #e4ece8;
    color: #17231f;
    font-family: var(--mx-display);
    font-size: 0.9rem;
    font-weight: 800;
}

.mx-receipt__foot {
    padding-top: 0.6rem;
    color: #5d7169;
    font-size: 0.58rem;
    line-height: 1.5;
    text-align: center;
}

.mx-print {
    display: none;
}

/* ---- Dark mode component details ---------------------------------------- */
/* The platform menu's button[data-theme] writes html[data-bs-theme]; these
   rules only describe the dark surface once that attribute is present. */

html[data-bs-theme="dark"] body.mx-body .mx-topbar {
    background: rgba(17, 31, 26, 0.92);
}

/* The dark palette uses a bright green for link/tint text, so solid green
   buttons need their own deeper gradient and dark ink to keep contrast. */
html[data-bs-theme="dark"] .mx-btn--primary {
    background: linear-gradient(145deg, #2dd4a4, #0f9c74);
    color: #04110d;
    box-shadow: 0 12px 26px -16px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

html[data-bs-theme="dark"] body.mx-body #app-window-menu #king {
    background: linear-gradient(145deg, #2dd4a4, #0f9c74) !important;
    color: #04110d !important;
}

html[data-bs-theme="dark"] .mx-auth__panel {
    background: radial-gradient(50% 40% at 50% 0%, #122a20, transparent 70%), var(--mx-bg);
}

html[data-bs-theme="dark"] .mx-boot,
html[data-bs-theme="dark"] .mx-noscript {
    background: radial-gradient(50% 50% at 50% 0%, #122a20, transparent 70%), var(--mx-bg);
}

html[data-bs-theme="dark"] .mx-auth__notice {
    border-color: #26513f;
}

html[data-bs-theme="dark"] .mx-auth__sso {
    background: var(--mx-surface);
}

html[data-bs-theme="dark"] .mx-auth__sso:hover {
    background: var(--mx-mint);
}

html[data-bs-theme="dark"] .mx-auth__demo {
    background: var(--mx-surface-2);
}

html[data-bs-theme="dark"] .mx-quick__btn {
    background: var(--mx-surface-2);
}

html[data-bs-theme="dark"] .mx-quick__btn:hover {
    background: var(--mx-mint);
}

html[data-bs-theme="dark"] .mx-alert-card--ok {
    border-color: #26513f;
    background: #133326;
    color: #7ef0c6;
}

html[data-bs-theme="dark"] .mx-alert-card--warn {
    border-color: #6b5115;
    background: #33280d;
    color: #ffd36b;
}

html[data-bs-theme="dark"] .mx-alert-card--danger {
    border-color: #6a2f2c;
    background: #351b1a;
    color: #ff8f87;
}

html[data-bs-theme="dark"] .mx-banner--warn {
    border-color: #6b5115;
    background: #33280d;
    color: #ffd36b;
}

html[data-bs-theme="dark"] .mx-banner--danger {
    border-color: #6a2f2c;
    background: #351b1a;
    color: #ff8f87;
}

html[data-bs-theme="dark"] .mx-badge--amber,
html[data-bs-theme="dark"] .mx-stock--low {
    color: #ffd36b;
}

html[data-bs-theme="dark"] .mx-loyalty {
    border-color: #6b5115;
}

html[data-bs-theme="dark"] .mx-loyalty b {
    color: #ffd36b;
}

html[data-bs-theme="dark"] .mx-loyalty span {
    color: #d9b25a;
}

html[data-bs-theme="dark"] .mx-product__thumb--mint,
html[data-bs-theme="dark"] .mx-product__thumb--green {
    background: #15382b;
    color: #5ee7b8;
}

html[data-bs-theme="dark"] .mx-product__thumb--amber {
    background: #3a2c0d;
    color: #ffd36b;
}

html[data-bs-theme="dark"] .mx-product__thumb--blue {
    background: #14283f;
    color: #86b7ff;
}

html[data-bs-theme="dark"] .mx-product__thumb--cyan {
    background: #0e3440;
    color: #6fe3ff;
}

html[data-bs-theme="dark"] .mx-product__thumb--pink {
    background: #3a1a2a;
    color: #ff9ac4;
}

html[data-bs-theme="dark"] .mx-product__thumb--violet {
    background: #2a1d44;
    color: #c2a7ff;
}

html[data-bs-theme="dark"] .mx-product__thumb--slate {
    background: #1b332a;
    color: #c4ded1;
}

html[data-bs-theme="dark"] .mx-auth__tabs,
html[data-bs-theme="dark"] .mx-cart__foot,
html[data-bs-theme="dark"] .mx-modal__foot {
    background: var(--mx-surface-2);
}

html[data-bs-theme="dark"] .mx-modal {
    background: rgba(2, 10, 7, 0.72);
}

html[data-bs-theme="dark"] .mx-receipt {
    background: #fff;
    color: #17231f;
}

/* ---- Animations --------------------------------------------------------- */
@keyframes mxSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes mxFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes mxPop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.99);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes mxToastIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 1180px) {
    .mx-pos {
        grid-template-columns: minmax(0, 1fr) 320px;
    }

    .mx-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mx-dash-grid,
    .mx-report-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .mx-card--wide {
        grid-column: auto;
    }

    .mx-topbar__date {
        display: none;
    }
}

@media (max-width: 960px) {
    .mx-auth {
        grid-template-columns: minmax(0, 1fr);
    }

    .mx-auth__hero {
        display: none;
    }

    .mx-auth__mobile-brand {
        display: inline-flex;
    }

    .mx-auth__panel {
        min-height: 100vh;
        min-height: 100dvh;
    }

    .mx-app {
        grid-template-columns: minmax(0, 1fr);
    }

    .mx-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 60;
        width: 250px;
        transform: translateX(-102%);
        transition: transform 0.2s ease;
    }

    .mx-sidebar.is-open {
        transform: none;
    }

    .mx-backdrop {
        position: fixed;
        inset: 0;
        z-index: 55;
        display: block;
        background: rgba(5, 24, 19, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .mx-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .mx-topbar__menu {
        display: grid;
    }

    .mx-pos {
        grid-template-columns: minmax(0, 1fr);
    }

    .mx-cart {
        position: static;
        max-height: none;
    }

    .mx-cart__scroll {
        max-height: 260px;
    }
}

@media (max-width: 720px) {
    .mx-content {
        padding: 14px;
    }

    .mx-topbar {
        padding: 0 0.85rem;
    }

    .mx-topbar__title small {
        display: none;
    }

    .mx-topbar__date,
    .mx-user-chip>span:last-child {
        display: none;
    }

    .mx-user-chip {
        padding-left: 0.45rem;
        border-left: 0;
    }

    .mx-page-head {
        flex-direction: column;
        align-items: stretch;
    }

    .mx-page-actions {
        justify-content: flex-start;
    }

    .mx-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mx-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    }

    .mx-search--sm {
        min-width: 0;
        flex: 1;
    }

    .mx-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .mx-image-field {
        grid-template-columns: minmax(0, 1fr);
    }

    .mx-image-preview {
        width: 100%;
        height: 132px;
    }

    .mx-receive-line {
        grid-template-columns: minmax(0, 1fr) 66px 76px;
    }

    .mx-receive-line [data-batch],
    .mx-receive-line [data-expiry] {
        grid-column: span 1;
    }

    .mx-plan-usage {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mx-toolbar__count {
        width: 100%;
        margin-left: 0;
    }

    .mx-modal {
        padding: 0.5rem;
    }

    .mx-modal__panel {
        max-height: 94vh;
    }
}

@media (max-width: 480px) {
    .mx-stat-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .mx-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mx-pay-methods {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mx-customer-stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .mx-receive-line {
        grid-template-columns: minmax(0, 1fr) 64px;
    }

    .mx-receive-line [data-cost],
    .mx-receive-line [data-batch],
    .mx-receive-line [data-expiry] {
        grid-column: span 1;
    }

    .mx-modal__foot {
        flex-wrap: wrap;
    }
}

@media print {

    body.mx-body>#mxApp,
    body.mx-body>.mx-toasts,
    body.mx-body>#mxModalRoot {
        display: none !important;
    }

    .mx-print {
        display: block !important;
    }

    .mx-print.is-printing {
        display: block;
    }

    .mx-receipt {
        border: 0;
        border-radius: 0;
    }
}