/* ============================================================================
   SuperPOS — global supermarket retail operating system.
   ========================================================================== */

html[data-bs-theme="light"],
:root:not([data-bs-theme]) {
    color-scheme: light;
    --sx-bg: #f5f7f2;
    --sx-bg-2: #eef2e9;
    --sx-surface: #fffefb;
    --sx-surface-2: #f8faf5;
    --sx-surface-3: #eef3ea;
    --sx-line: #dde6da;
    --sx-line-strong: #c6d5c3;
    --sx-ink: #10231c;
    --sx-ink-2: #2f4a40;
    --sx-muted: #6f8378;
    --sx-faint: #9eafa5;
    --sx-green: #0f766e;
    --sx-green-2: #0d9488;
    --sx-green-soft: #e5f5ef;
    --sx-forest: #0b2e24;
    --sx-forest-2: #09251d;
    --sx-lime: #a3e635;
    --sx-lime-soft: #f1fadf;
    --sx-amber: #f59e0b;
    --sx-amber-soft: #fff5d9;
    --sx-red: #dc2626;
    --sx-red-soft: #fdeceb;
    --sx-blue: #2563eb;
    --sx-blue-soft: #e9f0ff;
    --sx-violet: #7c3aed;
    --sx-violet-soft: #f0e9ff;
    --sx-cyan: #0891b2;
    --sx-cyan-soft: #e2f8fd;
    --sx-sidebar: #0b2e24;
    --sx-sidebar-2: #09251d;
    --sx-sidebar-ink: #e6f4ec;
    --sx-shadow: 0 22px 50px -34px rgba(15, 59, 45, 0.38);
    --sx-shadow-lg: 0 38px 90px -38px rgba(15, 59, 45, 0.44);
    --sx-display: 'Sora', 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --sx-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --sx-radius: 18px;
    --sx-glow: rgba(15, 118, 110, 0.24);
}

html[data-bs-theme="dark"] {
    color-scheme: dark;
    --sx-bg: #08120f;
    --sx-bg-2: #0b1915;
    --sx-surface: #0f1e19;
    --sx-surface-2: #132720;
    --sx-surface-3: #183029;
    --sx-line: #234137;
    --sx-line-strong: #315748;
    --sx-ink: #eef8f1;
    --sx-ink-2: #c6dbd0;
    --sx-muted: #8fa99d;
    --sx-faint: #6a8479;
    --sx-green: #2dd4bf;
    --sx-green-2: #14b8a6;
    --sx-green-soft: #11352e;
    --sx-forest: #0b2e24;
    --sx-forest-2: #071d17;
    --sx-lime: #bef264;
    --sx-lime-soft: #253314;
    --sx-amber: #fbbf24;
    --sx-amber-soft: #3a2a0b;
    --sx-red: #f87171;
    --sx-red-soft: #3c181a;
    --sx-blue: #93c5fd;
    --sx-blue-soft: #13283f;
    --sx-violet: #c4b5fd;
    --sx-violet-soft: #291d44;
    --sx-cyan: #67e8f9;
    --sx-cyan-soft: #0f303a;
    --sx-sidebar: #06130f;
    --sx-sidebar-2: #04100c;
    --sx-sidebar-ink: #e7f6ee;
    --sx-shadow: 0 24px 58px -34px rgba(0, 0, 0, 0.82);
    --sx-shadow-lg: 0 42px 110px -38px rgba(0, 0, 0, 0.9);
    --sx-glow: rgba(45, 212, 191, 0.2);
}

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

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

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

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

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

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

body.sx-body #notif-frame {
    display: none !important;
}

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

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

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

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

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

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

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

.sx-faint {
    color: var(--sx-faint);
}

/* ---- boot / auth -------------------------------------------------------- */
.sx-boot,
.sx-noscript {
    min-height: 100vh;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 0.4rem;
    padding: 2rem;
    text-align: center;
}

.sx-boot__mark {
    display: grid;
    place-items: center;
    width: 66px;
    height: 66px;
    border-radius: 22px;
    background: linear-gradient(145deg, var(--sx-green), var(--sx-lime));
    color: #082116;
    box-shadow: 0 20px 40px -18px var(--sx-glow);
}

.sx-boot h1 {
    margin-top: 0.5rem;
    font-family: var(--sx-display);
    font-size: 1.15rem;
    letter-spacing: -0.04em;
}

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

.sx-boot__spin {
    width: 21px;
    height: 21px;
    margin-top: 0.6rem;
    border: 2px solid var(--sx-line);
    border-top-color: var(--sx-green);
    border-radius: 50%;
    animation: sx-spin 0.8s linear infinite;
}

@keyframes sx-spin {
    to {
        transform: rotate(360deg);
    }
}

.sx-auth {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
    min-height: 100vh;
    background: var(--sx-bg);
}

.sx-auth__visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: clamp(2rem, 5vw, 4rem);
    background:
        radial-gradient(circle at 88% 4%, rgba(163, 230, 53, 0.18), transparent 28rem),
        radial-gradient(circle at 4% 90%, rgba(20, 184, 166, 0.18), transparent 24rem),
        linear-gradient(140deg, var(--sx-forest), var(--sx-forest-2));
    color: var(--sx-sidebar-ink);
    overflow: hidden;
}

.sx-auth__visual::after {
    content: '';
    position: absolute;
    right: -9rem;
    bottom: -10rem;
    width: 30rem;
    height: 30rem;
    border: 1px solid rgba(163, 230, 53, 0.16);
    border-radius: 50%;
    box-shadow: 0 0 0 5rem rgba(163, 230, 53, 0.03), 0 0 0 10rem rgba(163, 230, 53, 0.02);
}

.sx-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.sx-lockup__mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--sx-green), var(--sx-lime));
    color: #082116;
}

.sx-lockup strong {
    display: block;
    font-family: var(--sx-display);
    font-size: 1rem;
    letter-spacing: -0.04em;
}

.sx-lockup small {
    display: block;
    color: rgba(231, 246, 238, 0.65);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sx-auth__tagline {
    position: relative;
    z-index: 1;
    max-width: 42rem;
}

.sx-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--sx-green);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sx-auth__tagline .sx-eyebrow {
    color: var(--sx-lime);
}

.sx-auth__tagline h1 {
    margin: 0.7rem 0 0.7rem;
    font-family: var(--sx-display);
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    line-height: 0.98;
    letter-spacing: -0.07em;
}

.sx-auth__tagline h1 em {
    color: var(--sx-lime);
    font-style: normal;
}

.sx-auth__tagline p {
    max-width: 33rem;
    color: rgba(231, 246, 238, 0.72);
    font-size: 0.86rem;
    line-height: 1.7;
}

.sx-auth__quote {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 1.4rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(163, 230, 53, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(231, 246, 238, 0.82);
    font-size: 0.68rem;
}

.sx-auth__panel {
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 3rem);
}

.sx-auth__card {
    width: min(430px, 100%);
    padding: clamp(1.2rem, 3vw, 2rem);
    border: 1px solid var(--sx-line);
    border-radius: 24px;
    background: var(--sx-surface);
    box-shadow: var(--sx-shadow-lg);
}

.sx-auth__head h2 {
    font-family: var(--sx-display);
    font-size: 1.55rem;
    letter-spacing: -0.055em;
}

.sx-auth__head p {
    margin-top: 0.2rem;
    color: var(--sx-muted);
    font-size: 0.72rem;
}

.sx-auth__notice {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin-top: 0.8rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid color-mix(in srgb, var(--sx-green) 26%, var(--sx-line));
    border-radius: 12px;
    background: var(--sx-green-soft);
    color: var(--sx-ink-2);
    font-size: 0.64rem;
}

.sx-auth__sso {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--sx-line);
    border-radius: 14px;
    background: var(--sx-surface-2);
    color: var(--sx-ink);
    text-align: left;
}

.sx-auth__sso-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--sx-green), var(--sx-lime));
    color: #082116;
}

.sx-auth__sso b {
    display: block;
    font-size: 0.74rem;
}

.sx-auth__sso small {
    display: block;
    color: var(--sx-muted);
    font-size: 0.58rem;
}

.sx-auth__sso>svg {
    margin-left: auto;
    color: var(--sx-muted);
}

.sx-auth__or {
    margin: 1rem 0 0.7rem;
    text-align: center;
    color: var(--sx-faint);
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sx-auth__tabs {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.8rem;
    padding: 0.22rem;
    border-radius: 11px;
    background: var(--sx-surface-3);
}

.sx-auth__tab {
    flex: 1;
    padding: 0.45rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--sx-muted);
    font-size: 0.66rem;
    font-weight: 800;
}

.sx-auth__tab.is-active {
    background: var(--sx-surface);
    color: var(--sx-ink);
    box-shadow: 0 4px 12px -8px rgba(0, 0, 0, 0.25);
}

.sx-auth__demo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.9rem;
    padding: 0.65rem;
    border: 1px dashed var(--sx-line-strong);
    border-radius: 12px;
    background: var(--sx-surface-2);
    font-size: 0.62rem;
}

.sx-auth__demo span {
    flex: 1;
}

.sx-auth__foot {
    margin-top: 1rem;
    color: var(--sx-faint);
    font-size: 0.55rem;
    text-align: center;
    line-height: 1.5;
}

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

.sx-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1rem 0.8rem 0.85rem;
    background:
        radial-gradient(circle at 40% 0%, rgba(163, 230, 53, 0.13), transparent 16rem),
        linear-gradient(180deg, var(--sx-sidebar), var(--sx-sidebar-2));
    color: var(--sx-sidebar-ink);
    overflow-y: auto;
    z-index: 60;
}

.sx-sidebar .sx-lockup {
    padding: 0.25rem 0.35rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sx-sidebar .sx-lockup small {
    color: rgba(231, 246, 238, 0.48);
}

.sx-sidebar__label {
    margin: 0.9rem 0.5rem 0.3rem;
    color: rgba(231, 246, 238, 0.4);
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.sx-nav {
    display: grid;
    gap: 0.12rem;
}

.sx-nav__link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.53rem 0.62rem;
    border-radius: 10px;
    color: rgba(231, 246, 238, 0.67);
    font-size: 0.71rem;
    font-weight: 700;
    transition: 140ms ease;
}

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

.sx-nav__link.is-active {
    background: linear-gradient(90deg, rgba(163, 230, 53, 0.18), rgba(20, 184, 166, 0.1));
    color: #f3ffe9;
    box-shadow: inset 2px 0 0 var(--sx-lime);
}

.sx-nav__link svg {
    opacity: 0.8;
}

.sx-sidebar__spacer {
    flex: 1;
    min-height: 1.2rem;
}

.sx-plan-card {
    padding: 0.7rem;
    border: 1px solid rgba(163, 230, 53, 0.14);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.045);
}

.sx-plan-card__top {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--sx-lime);
    font-size: 0.54rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sx-plan-card h4 {
    margin-top: 0.3rem;
    font-family: var(--sx-display);
    font-size: 0.8rem;
    color: #f0faf4;
    letter-spacing: -0.02em;
}

.sx-plan-card p {
    margin-top: 0.15rem;
    color: rgba(231, 246, 238, 0.56);
    font-size: 0.56rem;
}

.sx-plan-card a {
    display: inline-block;
    margin-top: 0.35rem;
    color: var(--sx-lime);
    font-size: 0.57rem;
    font-weight: 800;
}

.sx-sidebar__user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.55rem 0.3rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sx-sidebar__user div {
    min-width: 0;
    flex: 1;
}

.sx-sidebar__user strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.67rem;
}

.sx-sidebar__user small {
    display: block;
    color: rgba(231, 246, 238, 0.5);
    font-size: 0.55rem;
    text-transform: capitalize;
}

.sx-sidebar__user button {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(231, 246, 238, 0.7);
}

.sx-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 31px;
    height: 31px;
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(163, 230, 53, 0.28), rgba(20, 184, 166, 0.2));
    color: var(--sx-lime);
    font-size: 0.6rem;
    font-weight: 800;
}

.sx-backdrop {
    display: none;
}

.sx-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sx-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 58px;
    padding: 0 clamp(0.9rem, 3vw, 1.4rem);
    border-bottom: 1px solid var(--sx-line);
    background: color-mix(in srgb, var(--sx-bg) 90%, transparent);
    backdrop-filter: blur(16px);
}

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

.sx-topbar__title {
    min-width: 0;
    flex: 1;
}

.sx-topbar__title strong {
    display: block;
    font-family: var(--sx-display);
    font-size: 0.92rem;
    letter-spacing: -0.03em;
}

.sx-topbar__title small {
    display: block;
    color: var(--sx-muted);
    font-size: 0.58rem;
}

.sx-topbar__right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sx-outlet {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.5rem;
    border: 1px solid var(--sx-line);
    border-radius: 999px;
    background: var(--sx-surface);
    color: var(--sx-ink-2);
    font-size: 0.6rem;
    font-weight: 700;
}

.sx-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--sx-line);
    border-radius: 10px;
    background: var(--sx-surface);
    color: var(--sx-ink-2);
}

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

.sx-user-chip strong {
    display: block;
    font-size: 0.64rem;
}

.sx-user-chip small {
    display: block;
    color: var(--sx-muted);
    font-size: 0.53rem;
    text-transform: capitalize;
}

.sx-content {
    flex: 1;
    width: 100%;
    max-width: 1540px;
    margin: 0 auto;
    padding: clamp(0.9rem, 2.4vw, 1.35rem);
}

/* ---- page / cards / controls ------------------------------------------- */
.sx-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.9rem;
    margin-bottom: 0.9rem;
}

.sx-page-head h1 {
    font-family: var(--sx-display);
    font-size: clamp(1.3rem, 2.4vw, 1.7rem);
    letter-spacing: -0.05em;
}

.sx-page-head p {
    margin-top: 0.16rem;
    color: var(--sx-muted);
    font-size: 0.69rem;
}

.sx-page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.36rem;
}

.sx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.36rem;
    min-height: 36px;
    padding: 0.48rem 0.72rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-size: 0.67rem;
    font-weight: 800;
    white-space: nowrap;
    transition: 140ms ease;
}

.sx-btn svg {
    flex: 0 0 auto;
}

.sx-btn--primary {
    background: linear-gradient(145deg, var(--sx-green), var(--sx-green-2));
    color: #fff;
    box-shadow: 0 12px 24px -16px var(--sx-glow);
}

html[data-bs-theme="dark"] .sx-btn--primary {
    background: linear-gradient(145deg, #2dd4bf, #0d9488);
    color: #06201a;
}

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

.sx-btn--soft {
    border-color: color-mix(in srgb, var(--sx-green) 16%, var(--sx-line));
    background: var(--sx-green-soft);
    color: var(--sx-green);
}

.sx-btn--danger {
    background: var(--sx-red);
    color: #fff;
}

.sx-btn--sm {
    min-height: 30px;
    padding: 0.34rem 0.55rem;
    font-size: 0.6rem;
}

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

.sx-btn--lg {
    min-height: 44px;
    font-size: 0.76rem;
}

.sx-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

.sx-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--sx-green);
    font-size: 0.62rem;
    font-weight: 800;
}

.sx-card {
    border: 1px solid var(--sx-line);
    border-radius: var(--sx-radius);
    background: var(--sx-surface);
    box-shadow: var(--sx-shadow);
}

.sx-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid var(--sx-line);
}

.sx-card__head h3 {
    font-family: var(--sx-display);
    font-size: 0.82rem;
    letter-spacing: -0.025em;
}

.sx-card__head p {
    margin-top: 0.08rem;
    color: var(--sx-muted);
    font-size: 0.58rem;
}

.sx-card__body {
    padding: 0.85rem 0.9rem;
}

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

.sx-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.sx-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.7rem;
}

.sx-toolbar__count {
    margin-left: auto;
    color: var(--sx-muted);
    font-size: 0.61rem;
    font-weight: 700;
}

.sx-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 220px;
    flex: 1;
    padding: 0 0.62rem;
    border: 1px solid var(--sx-line);
    border-radius: 10px;
    background: var(--sx-surface);
    color: var(--sx-muted);
}

.sx-search--sm {
    min-width: 160px;
    flex: 0 1 260px;
}

.sx-search .sx-input {
    min-height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.sx-input,
.sx-select,
.sx-textarea {
    width: 100%;
    min-height: 36px;
    padding: 0.46rem 0.58rem;
    border: 1px solid var(--sx-line);
    border-radius: 9px;
    outline: 0;
    background: var(--sx-surface);
    color: var(--sx-ink);
    font: inherit;
    font-size: 0.7rem;
}

.sx-input:focus,
.sx-select:focus,
.sx-textarea:focus {
    border-color: var(--sx-green);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sx-green) 14%, transparent);
}

.sx-select--auto {
    width: auto;
    min-width: 130px;
}

.sx-textarea {
    min-height: 70px;
    resize: vertical;
}

.sx-field {
    display: grid;
    gap: 0.23rem;
}

.sx-field label {
    color: var(--sx-muted);
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

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

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

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

.sx-check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--sx-ink-2);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.sx-check input {
    accent-color: var(--sx-green);
}

.sx-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    padding: 0.2rem 0.42rem;
    border-radius: 999px;
    background: var(--sx-surface-3);
    color: var(--sx-ink-2);
    font-size: 0.54rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    white-space: nowrap;
}

.sx-badge--green {
    background: var(--sx-green-soft);
    color: var(--sx-green);
}

.sx-badge--amber {
    background: var(--sx-amber-soft);
    color: var(--sx-amber);
}

.sx-badge--red {
    background: var(--sx-red-soft);
    color: var(--sx-red);
}

.sx-badge--blue {
    background: var(--sx-blue-soft);
    color: var(--sx-blue);
}

.sx-badge--violet {
    background: var(--sx-violet-soft);
    color: var(--sx-violet);
}

.sx-badge--cyan {
    background: var(--sx-cyan-soft);
    color: var(--sx-cyan);
}

.sx-badge--lime {
    background: var(--sx-lime-soft);
    color: color-mix(in srgb, var(--sx-lime) 60%, var(--sx-ink));
}

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

/* ---- dashboard --------------------------------------------------------- */
.sx-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: 1rem;
    overflow: hidden;
    margin-bottom: 0.7rem;
    padding: clamp(1rem, 3vw, 1.5rem);
    border-radius: 24px;
    background:
        radial-gradient(circle at 88% 0%, rgba(163, 230, 53, 0.22), transparent 22rem),
        radial-gradient(circle at 4% 100%, rgba(20, 184, 166, 0.18), transparent 22rem),
        linear-gradient(135deg, var(--sx-forest), var(--sx-forest-2));
    color: var(--sx-sidebar-ink);
    box-shadow: var(--sx-shadow-lg);
}

.sx-hero::after {
    content: '';
    position: absolute;
    right: -7rem;
    bottom: -10rem;
    width: 26rem;
    height: 26rem;
    border: 1px solid rgba(163, 230, 53, 0.13);
    border-radius: 50%;
    box-shadow: 0 0 0 4rem rgba(163, 230, 53, 0.03), 0 0 0 8rem rgba(163, 230, 53, 0.02);
}

.sx-hero__copy,
.sx-hero__side {
    position: relative;
    z-index: 1;
}

.sx-live {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    padding: 0.24rem 0.5rem;
    border-radius: 999px;
    background: rgba(163, 230, 53, 0.14);
    color: var(--sx-lime);
    font-size: 0.53rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sx-hero h2 {
    max-width: 38rem;
    margin-top: 0.55rem;
    font-family: var(--sx-display);
    font-size: clamp(1.5rem, 3.4vw, 2.25rem);
    line-height: 1.05;
    letter-spacing: -0.06em;
}

.sx-hero h2 em {
    color: var(--sx-lime);
    font-style: normal;
}

.sx-hero__copy p {
    max-width: 32rem;
    margin-top: 0.4rem;
    color: rgba(231, 246, 238, 0.7);
    font-size: 0.72rem;
}

.sx-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.8rem;
}

.sx-hero__actions .sx-btn--ghost {
    border-color: rgba(231, 246, 238, 0.15);
    background: rgba(255, 255, 255, 0.07);
    color: #effaf4;
}

.sx-hero__side {
    display: grid;
    align-content: center;
    gap: 0.55rem;
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
}

.sx-hero__metric {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.38rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sx-hero__metric:last-child {
    border-bottom: 0;
}

.sx-hero__metric strong {
    font-family: var(--sx-display);
    font-size: 1.35rem;
    letter-spacing: -0.05em;
}

.sx-hero__metric span {
    color: rgba(231, 246, 238, 0.62);
    font-size: 0.58rem;
    font-weight: 700;
}

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

.sx-stat {
    padding: 0.75rem 0.82rem;
    border: 1px solid var(--sx-line);
    border-radius: 15px;
    background: var(--sx-surface);
    box-shadow: var(--sx-shadow);
}

.sx-stat__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--sx-muted);
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sx-stat__top i {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--sx-green-soft);
    color: var(--sx-green);
    font-style: normal;
}

.sx-stat>strong {
    display: block;
    margin-top: 0.3rem;
    font-family: var(--sx-display);
    font-size: clamp(1.1rem, 2.4vw, 1.42rem);
    letter-spacing: -0.05em;
}

.sx-stat>small {
    display: block;
    margin-top: 0.12rem;
    color: var(--sx-muted);
    font-size: 0.56rem;
}

.sx-stat__delta {
    color: var(--sx-green);
    font-weight: 800;
}

.sx-stat__delta.is-down {
    color: var(--sx-red);
}

.sx-list {
    display: grid;
}

.sx-list__row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0;
    border-bottom: 1px dashed var(--sx-line);
}

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

.sx-list__main {
    min-width: 0;
    flex: 1;
}

.sx-list__main strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.69rem;
}

.sx-list__main small {
    display: block;
    color: var(--sx-muted);
    font-size: 0.56rem;
}

.sx-list__meta {
    display: grid;
    justify-items: end;
    gap: 0.12rem;
}

.sx-list__meta b {
    font-size: 0.69rem;
}

.sx-list__meta small {
    color: var(--sx-muted);
    font-size: 0.54rem;
}

.sx-ticket__qty {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--sx-green-soft);
    color: var(--sx-green);
    font-size: 0.58rem;
    font-weight: 800;
}

.sx-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 150px;
    padding-top: 0.4rem;
}

.sx-bar {
    position: relative;
    flex: 1;
    height: 100%;
    display: flex;
    align-items: flex-end;
    min-width: 3px;
}

.sx-bar__fill {
    display: block;
    width: 100%;
    height: var(--h, 2%);
    min-height: 2px;
    border-radius: 4px 4px 2px 2px;
    background: linear-gradient(180deg, var(--sx-green-2), var(--sx-green));
    transition: height 220ms ease;
}

.sx-bar__tip {
    position: absolute;
    left: 50%;
    bottom: calc(var(--h, 2%) + 5px);
    z-index: 2;
    display: none;
    padding: 0.2rem 0.35rem;
    border-radius: 6px;
    background: var(--sx-ink);
    color: var(--sx-surface);
    font-size: 0.5rem;
    white-space: nowrap;
    transform: translateX(-50%);
}

.sx-bar:hover .sx-bar__tip {
    display: block;
}

.sx-bar-labels {
    display: flex;
    gap: 3px;
    margin-top: 0.35rem;
    color: var(--sx-faint);
    font-size: 0.47rem;
    font-weight: 700;
}

.sx-bar-labels span {
    flex: 1;
    min-width: 3px;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
}

.sx-donut-wrap {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    align-items: center;
    gap: 0.85rem;
}

.sx-donut {
    width: 116px;
    height: 116px;
    border-radius: 50%;
    background: var(--donut);
    -webkit-mask: radial-gradient(circle, transparent 45%, #000 46%);
    mask: radial-gradient(circle, transparent 45%, #000 46%);
}

.sx-legend {
    display: grid;
    gap: 0.25rem;
}

.sx-legend div {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.35rem;
    color: var(--sx-muted);
    font-size: 0.58rem;
}

.sx-legend i {
    width: 8px;
    height: 8px;
    border-radius: 3px;
}

.sx-legend b {
    color: var(--sx-ink-2);
    font-size: 0.58rem;
}

/* ---- tables ------------------------------------------------------------ */
.sx-table-wrap {
    overflow-x: auto;
}

.sx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.68rem;
}

.sx-table th {
    padding: 0.48rem 0.55rem;
    border-bottom: 1px solid var(--sx-line);
    color: var(--sx-muted);
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.sx-table td {
    padding: 0.52rem 0.55rem;
    border-bottom: 1px solid color-mix(in srgb, var(--sx-line) 65%, transparent);
    vertical-align: middle;
}

.sx-table tbody tr:hover {
    background: color-mix(in srgb, var(--sx-green) 3%, transparent);
}

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

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

.sx-cell-main strong {
    font-size: 0.69rem;
}

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

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

.sx-icon-btn--sm {
    width: 27px;
    height: 27px;
    border-radius: 8px;
}

.sx-product-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 190px;
}

.sx-thumb {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--thumb-tone, var(--sx-green)) 20%, var(--sx-surface)), var(--sx-surface-2));
    color: var(--thumb-tone, var(--sx-green));
    font-family: var(--sx-display);
    font-size: 0.8rem;
    font-weight: 800;
    overflow: hidden;
}

.sx-thumb--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sx-thumb--lg {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    font-size: 1.15rem;
}

.sx-thumb--xl {
    width: 110px;
    height: 110px;
    border-radius: 18px;
    font-size: 2rem;
}

/* ---- POS --------------------------------------------------------------- */
.sx-pos {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 0.75rem;
    align-items: start;
}

.sx-pos .sx-menu-panel {
    min-width: 0;
}

.sx-pos__head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.6rem;
}

.sx-scan {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    padding: 0 0.72rem;
    border: 1px solid var(--sx-line);
    border-radius: 13px;
    background: var(--sx-surface);
    box-shadow: var(--sx-shadow);
    color: var(--sx-muted);
}

.sx-scan input {
    width: 100%;
    min-height: 44px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--sx-ink);
    font: inherit;
    font-size: 0.8rem;
}

.sx-cat-row {
    display: flex;
    gap: 0.34rem;
    margin-bottom: 0.6rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.sx-cat-row::-webkit-scrollbar {
    display: none;
}

.sx-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    flex: 0 0 auto;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--sx-line);
    border-radius: 999px;
    background: var(--sx-surface);
    color: var(--sx-ink-2);
    font-size: 0.61rem;
    font-weight: 800;
    white-space: nowrap;
}

.sx-chip span {
    display: grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    padding: 0 0.2rem;
    border-radius: 999px;
    background: var(--sx-surface-3);
    font-size: 0.5rem;
}

.sx-chip.is-active {
    border-color: var(--sx-green);
    background: var(--sx-green);
    color: #fff;
}

html[data-bs-theme="dark"] .sx-chip.is-active {
    color: #06201a;
}

.sx-chip.is-active span {
    background: rgba(255, 255, 255, 0.2);
}

.sx-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.42rem;
}

.sx-tile {
    display: flex;
    flex-direction: column;
    min-height: 132px;
    padding: 0.55rem;
    border: 1px solid var(--sx-line);
    border-radius: 14px;
    background: var(--sx-surface);
    text-align: left;
    box-shadow: 0 10px 22px -22px rgba(0, 0, 0, 0.28);
    transition: 140ms ease;
}

.sx-tile:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--sx-green) 28%, var(--sx-line));
    box-shadow: var(--sx-shadow);
}

.sx-tile.is-incart {
    border-color: color-mix(in srgb, var(--sx-green) 55%, var(--sx-line));
    background: color-mix(in srgb, var(--sx-green) 5%, var(--sx-surface));
}

.sx-tile.is-low {
    border-color: color-mix(in srgb, var(--sx-amber) 40%, var(--sx-line));
}

.sx-tile__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.3rem;
}

.sx-tile__badge {
    display: grid;
    place-items: center;
    min-width: 23px;
    height: 23px;
    padding: 0 0.25rem;
    border-radius: 8px;
    background: var(--sx-green);
    color: #fff;
    font-size: 0.56rem;
    font-weight: 800;
}

html[data-bs-theme="dark"] .sx-tile__badge {
    color: #06201a;
}

.sx-tile__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.38rem;
    font-size: 0.67rem;
    font-weight: 800;
    line-height: 1.25;
}

.sx-tile__sub {
    margin-top: 0.1rem;
    color: var(--sx-muted);
    font-size: 0.52rem;
}

.sx-tile__foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.3rem;
    margin-top: auto;
    padding-top: 0.35rem;
}

.sx-tile__foot b {
    font-size: 0.7rem;
}

.sx-tile__foot small {
    color: var(--sx-faint);
    font-size: 0.5rem;
    font-weight: 700;
}

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

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

.sx-cart__head h2 {
    font-family: var(--sx-display);
    font-size: 0.86rem;
    letter-spacing: -0.03em;
}

.sx-cart__head h2 span {
    color: var(--sx-green);
}

.sx-cart__context {
    display: grid;
    gap: 0.35rem;
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid var(--sx-line);
    background: var(--sx-surface-2);
}

.sx-cart__scroll {
    flex: 1;
    min-height: 100px;
    overflow-y: auto;
    padding: 0.55rem 0.8rem;
}

.sx-cart-empty {
    display: grid;
    justify-items: center;
    gap: 0.2rem;
    padding: 2rem 0.5rem;
    color: var(--sx-muted);
    text-align: center;
}

.sx-cart-empty b {
    color: var(--sx-ink-2);
    font-family: var(--sx-display);
    font-size: 0.78rem;
}

.sx-cart-empty span {
    font-size: 0.58rem;
}

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

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

.sx-cart-line__main strong {
    display: block;
    font-size: 0.65rem;
    line-height: 1.25;
}

.sx-cart-line__main small {
    display: block;
    margin-top: 0.08rem;
    color: var(--sx-muted);
    font-size: 0.53rem;
}

.sx-cart-line__total {
    font-size: 0.65rem;
    white-space: nowrap;
}

.sx-cart-line__del {
    grid-column: 3;
    justify-self: end;
    padding: 0;
    border: 0;
    background: none;
    color: var(--sx-faint);
    font-size: 0.52rem;
    font-weight: 700;
}

.sx-qty {
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
    padding: 0.13rem;
    border: 1px solid var(--sx-line);
    border-radius: 999px;
    background: var(--sx-surface-2);
}

.sx-qty button {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--sx-ink-2);
}

.sx-qty b {
    min-width: 22px;
    text-align: center;
    font-size: 0.57rem;
}

.sx-cart__foot {
    padding: 0.6rem 0.8rem 0.8rem;
    border-top: 1px solid var(--sx-line);
    background: var(--sx-surface-2);
}

.sx-totals {
    display: grid;
    gap: 0.2rem;
    margin-bottom: 0.45rem;
}

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

.sx-totals div b {
    color: var(--sx-ink-2);
}

.sx-totals__grand {
    margin-top: 0.2rem;
    padding-top: 0.38rem;
    border-top: 1px solid var(--sx-line);
    color: var(--sx-ink) !important;
    font-size: 0.82rem !important;
    font-weight: 800;
}

.sx-totals__grand b {
    color: var(--sx-ink) !important;
}

.sx-cart__actions {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 0.35rem;
}

.sx-quick-cash {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.4rem;
}

.sx-quick-cash button {
    flex: 1;
    min-width: 52px;
    padding: 0.32rem 0.3rem;
    border: 1px solid var(--sx-line);
    border-radius: 8px;
    background: var(--sx-surface);
    color: var(--sx-ink-2);
    font-size: 0.55rem;
    font-weight: 800;
}

.sx-pay-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr) 28px;
    gap: 0.3rem;
    align-items: center;
    margin-bottom: 0.3rem;
}

.sx-pay-summary {
    display: grid;
    gap: 0.23rem;
    margin-bottom: 0.55rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--sx-line);
    border-radius: 11px;
    background: var(--sx-surface-2);
}

.sx-pay-summary div {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--sx-muted);
    font-size: 0.62rem;
}

.sx-pay-summary .is-due {
    padding-top: 0.25rem;
    border-top: 1px solid var(--sx-line);
    color: var(--sx-ink);
    font-weight: 800;
}

.sx-order-types {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.25rem;
}

.sx-order-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.34rem;
    border: 1px solid var(--sx-line);
    border-radius: 8px;
    background: var(--sx-surface);
    color: var(--sx-muted);
    font-size: 0.55rem;
    font-weight: 800;
}

.sx-order-type.is-active {
    border-color: var(--sx-green);
    background: var(--sx-green-soft);
    color: var(--sx-green);
}

/* ---- modal / toast / forms --------------------------------------------- */
.sx-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem;
    background: rgba(4, 20, 15, 0.56);
    backdrop-filter: blur(4px);
    animation: sx-fade 160ms ease;
}

@keyframes sx-fade {
    from {
        opacity: 0;
    }
}

.sx-modal__panel {
    width: min(620px, 100%);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--sx-line);
    border-radius: 22px;
    background: var(--sx-surface);
    box-shadow: var(--sx-shadow-lg);
    animation: sx-rise 180ms ease;
}

.sx-modal__panel--sm {
    max-width: 440px;
}

.sx-modal__panel--lg {
    max-width: 920px;
}

.sx-modal__panel--xl {
    max-width: 1120px;
}

@keyframes sx-rise {
    from {
        transform: translateY(16px);
        opacity: 0;
    }
}

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

.sx-modal__head h2 {
    font-family: var(--sx-display);
    font-size: 1rem;
    letter-spacing: -0.035em;
}

.sx-modal__head p {
    margin-top: 0.1rem;
    color: var(--sx-muted);
    font-size: 0.62rem;
}

.sx-modal__close {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    padding: 0;
    border: 1px solid var(--sx-line);
    border-radius: 9px;
    background: var(--sx-surface-2);
    color: var(--sx-muted);
}

.sx-modal__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.9rem 1rem;
}

.sx-modal__foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--sx-line);
    background: var(--sx-surface-2);
    border-radius: 0 0 22px 22px;
}

.sx-modal-copy {
    color: var(--sx-ink-2);
    font-size: 0.72rem;
    line-height: 1.6;
}

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

.sx-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.42rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--sx-line);
    border-radius: 11px;
    background: var(--sx-surface);
    color: var(--sx-ink-2);
    font-size: 0.66rem;
    font-weight: 600;
    box-shadow: var(--sx-shadow-lg);
    pointer-events: auto;
    animation: sx-rise 180ms ease;
}

.sx-toast>span:nth-child(2) {
    flex: 1;
}

.sx-toast__icon {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 7px;
    background: var(--sx-green-soft);
    color: var(--sx-green);
}

.sx-toast--error .sx-toast__icon {
    background: var(--sx-red-soft);
    color: var(--sx-red);
}

.sx-toast--warn .sx-toast__icon {
    background: var(--sx-amber-soft);
    color: var(--sx-amber);
}

.sx-toast__close {
    padding: 0;
    border: 0;
    background: none;
    color: var(--sx-faint);
}

.sx-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 2rem 1rem;
    color: var(--sx-muted);
    font-size: 0.68rem;
}

.sx-spinner svg {
    animation: sx-spin 0.9s linear infinite;
}

.sx-empty {
    display: grid;
    justify-items: center;
    gap: 0.25rem;
    padding: 2.2rem 1rem;
    text-align: center;
}

.sx-empty__icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: var(--sx-green-soft);
    color: var(--sx-green);
}

.sx-empty h3 {
    font-family: var(--sx-display);
    font-size: 0.88rem;
    letter-spacing: -0.03em;
}

.sx-empty p {
    max-width: 22rem;
    color: var(--sx-muted);
    font-size: 0.62rem;
}

/* ---- settings ---------------------------------------------------------- */
.sx-settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.7rem;
    padding: 0.22rem;
    border: 1px solid var(--sx-line);
    border-radius: 12px;
    background: var(--sx-surface);
}

.sx-settings-tab {
    padding: 0.42rem 0.7rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--sx-muted);
    font-size: 0.63rem;
    font-weight: 800;
}

.sx-settings-tab.is-active {
    background: var(--sx-green-soft);
    color: var(--sx-green);
}

.sx-setting-section {
    display: none;
}

.sx-setting-section.is-active {
    display: block;
}

.sx-usage {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
}

.sx-usage__item {
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--sx-line);
    border-radius: 10px;
    background: var(--sx-surface-2);
}

.sx-usage__item b {
    display: block;
    font-family: var(--sx-display);
    font-size: 0.95rem;
    letter-spacing: -0.04em;
}

.sx-usage__item span {
    color: var(--sx-muted);
    font-size: 0.54rem;
}

/* ---- image picker ------------------------------------------------------ */
.sx-image-field {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 0.6rem;
    align-items: start;
}

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

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

.sx-image-preview__empty {
    display: grid;
    justify-items: center;
    gap: 0.1rem;
    padding: 0.4rem;
    text-align: center;
}

.sx-image-preview__empty b {
    font-size: 0.58rem;
}

.sx-image-preview__empty small {
    font-size: 0.5rem;
    color: var(--sx-faint);
}

.sx-image-side {
    display: grid;
    gap: 0.35rem;
}

.sx-image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.sx-po-line {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) repeat(4, minmax(0, 1fr)) 30px;
    gap: 0.3rem;
    align-items: center;
    margin-bottom: 0.3rem;
}

.sx-po-line .sx-input,
.sx-po-line .sx-select {
    min-height: 32px;
    padding: 0.32rem 0.4rem;
    font-size: 0.62rem;
}

@media (max-width: 760px) {
    .sx-po-line {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .sx-po-line>[data-product] {
        grid-column: 1 / -1;
    }
}

/* ---- receipt / print --------------------------------------------------- */
.sx-print {
    display: none;
}

.sx-receipt {
    width: 80mm;
    margin: 0 auto;
    padding: 4mm;
    color: #15221c;
    font-family: 'Manrope', sans-serif;
    font-size: 10px;
    background: #fff;
}

.sx-receipt__brand {
    text-align: center;
}

.sx-receipt__brand h3 {
    font-size: 15px;
    letter-spacing: -0.03em;
}

.sx-receipt__brand p {
    color: #65756c;
    font-size: 9px;
}

.sx-receipt__meta {
    display: grid;
    gap: 2px;
    margin: 3mm 0;
    padding: 2mm 0;
    border-top: 1px dashed #c4d1c8;
    border-bottom: 1px dashed #c4d1c8;
}

.sx-receipt__meta div {
    display: flex;
    justify-content: space-between;
    gap: 4mm;
}

.sx-receipt__meta span {
    color: #65756c;
}

.sx-receipt__line {
    display: flex;
    justify-content: space-between;
    gap: 4mm;
    padding: 1mm 0;
}

.sx-receipt__line small {
    display: block;
    color: #65756c;
    font-size: 8px;
}

.sx-receipt__totals {
    display: grid;
    gap: 1px;
    margin-top: 2mm;
    padding-top: 2mm;
    border-top: 1px dashed #c4d1c8;
}

.sx-receipt__totals div {
    display: flex;
    justify-content: space-between;
    gap: 4mm;
}

.sx-receipt__totals .is-total {
    margin-top: 1mm;
    padding-top: 1mm;
    border-top: 1px solid #15221c;
    font-size: 13px;
    font-weight: 800;
}

.sx-receipt__foot {
    margin-top: 3mm;
    color: #65756c;
    font-size: 8px;
    text-align: center;
}

/* ---- responsive -------------------------------------------------------- */
@media (max-width: 1180px) {
    .sx-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

    .sx-auth__visual {
        min-height: 280px;
        padding: 2rem;
    }

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

    .sx-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 252px;
        transform: translateX(-105%);
        transition: transform 200ms ease;
    }

    .sx-sidebar.is-open {
        transform: translateX(0);
    }

    .sx-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 55;
        background: rgba(4, 20, 15, 0.5);
        backdrop-filter: blur(2px);
        opacity: 0;
        visibility: hidden;
        transition: 180ms ease;
    }

    .sx-backdrop.is-open {
        opacity: 1;
        visibility: visible;
    }

    .sx-topbar__menu {
        display: grid;
    }

    .sx-user-chip>span:last-child,
    .sx-outlet span {
        display: none;
    }

    .sx-content {
        padding: 0.85rem;
    }

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

    .sx-cart {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        z-index: 70;
        max-height: 88vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(105%);
        transition: transform 220ms ease;
    }

    .sx-cart.is-open {
        transform: translateY(0);
    }

    .sx-mobile-cart-open {
        display: inline-flex !important;
    }
}

@media (min-width: 981px) {
    .sx-mobile-cart-open {
        display: none !important;
    }
}

@media (max-width: 760px) {
    .sx-page-head {
        flex-direction: column;
        align-items: stretch;
    }

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

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

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

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

    .sx-donut-wrap {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
    }

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

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

    .sx-modal {
        align-items: flex-end;
        padding: 0;
    }

    .sx-modal__panel {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
    }

    .sx-modal__foot {
        border-radius: 0;
    }
}

@media (max-width: 560px) {
    .sx-topbar {
        gap: 0.35rem;
        padding: 0 0.6rem;
    }

    .sx-topbar__title strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sx-topbar__title small {
        display: none;
    }

    .sx-topbar__right {
        gap: 0.22rem;
    }

    .sx-outlet {
        max-width: 104px;
        padding: 0.3rem 0.35rem;
    }

    .sx-outlet select {
        max-width: 74px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sx-user-chip {
        padding-left: 0;
        border-left: 0;
    }
}

@media (max-width: 430px) {
    .sx-product-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .sx-tile {
        min-height: 118px;
    }

    .sx-auth__visual {
        min-height: 230px;
    }

    .sx-auth__tagline h1 {
        font-size: 2rem;
    }
}

@media print {

    body.sx-body #sxApp,
    body.sx-body #sxToasts,
    body.sx-body #sxModalRoot,
    body.sx-body #app-window-menu,
    body.sx-body #notif-frame {
        display: none !important;
    }

    body.sx-body {
        background: #fff !important;
    }

    .sx-print {
        display: block !important;
        position: static;
        width: 80mm;
        margin: 0 auto;
    }

    .sx-print .sx-receipt {
        width: 80mm;
    }
}