/* ============================================================================
   RxPOS — pharmacy point of sale
   ----------------------------------------------------------------------------
   A light, clinical interface with a deep-green rail. Every rule is scoped to
   body.rx-body / .rx-* so the platform stylesheet cannot bleed in.
   ========================================================================== */

/* ----------------------------------------------------------------------------
   1. Tokens & platform neutralisers
   ------------------------------------------------------------------------- */

html:has(body.rx-body) {
    background: #f3f8f5;
}

body.rx-body,
body.rx-body.bg-transparent {
    --rx-bg: #f3f8f5;
    --rx-bg-2: #eaf2ee;
    --rx-surface: #ffffff;
    --rx-surface-2: #f8fbf9;
    --rx-surface-3: #eef6f2;
    --rx-ink: #10231c;
    --rx-ink-2: #33483f;
    --rx-muted: #6b7f76;
    --rx-faint: #99aaa2;
    --rx-line: #dce8e2;
    --rx-line-strong: #c7dbd2;
    --rx-green: #0e9f6e;
    --rx-green-2: #12b981;
    --rx-green-dark: #075c43;
    --rx-forest: #06251c;
    --rx-mint: #e7f7ef;
    --rx-mint-2: #d2f0e2;
    --rx-cyan: #0e9aa7;
    --rx-blue: #2b6cb0;
    --rx-amber: #b7791f;
    --rx-amber-bg: #fff7e6;
    --rx-red: #c2413b;
    --rx-red-bg: #fdeceb;
    --rx-violet: #6b5bd2;
    --rx-radius: 16px;
    --rx-radius-sm: 11px;
    --rx-shadow: 0 18px 42px -28px rgba(6, 37, 28, 0.38);
    --rx-shadow-lg: 0 40px 90px -42px rgba(6, 37, 28, 0.55);
    --rx-rail-bg: radial-gradient(70% 40% at 20% 0%, rgba(18, 185, 129, 0.1), transparent 70%), linear-gradient(180deg, #fbfefc, #edf7f1);
    --rx-rail-ink: #10231c;
    --rx-rail-link: #425a50;
    --rx-rail-muted: #60786c;
    --rx-rail-label: #6b8078;
    --rx-rail-line: rgba(6, 37, 28, 0.09);
    --rx-rail-hover: rgba(14, 159, 110, 0.08);
    --rx-rail-active: rgba(14, 159, 110, 0.14);
    --rx-rail-active-ink: #075c43;
    --rx-rail-accent: #0e9f6e;
    --rx-rail-badge-bg: rgba(183, 121, 31, 0.14);
    --rx-rail-badge-ink: #8a5a10;
    --rx-rail-card: rgba(255, 255, 255, 0.72);
    --rx-rail-card-line: rgba(6, 37, 28, 0.1);
    --rx-rail-card-head: #3c6b57;
    --rx-rail-scroll: #c7d8d0;
    --rx-display: "Sora", "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
    --rx-body: "Manrope", "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;

    display: block !important;
    height: auto !important;
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--rx-bg) !important;
    color: var(--rx-ink);
    font-family: var(--rx-body);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    color-scheme: light;
    user-select: text;
    -webkit-user-select: text;
    overflow-x: clip;
}

/* ----------------------------------------------------------------------------
   Dark theme — follows the platform `html[data-bs-theme]` contract.
   ------------------------------------------------------------------------- */

html[data-bs-theme="dark"]:has(body.rx-body) {
    background: #06130f;
}

html[data-bs-theme="dark"] body.rx-body,
html[data-bs-theme="dark"] body.rx-body.bg-transparent {
    --rx-bg: #06130f;
    --rx-bg-2: #0a1b15;
    --rx-surface: #0d211a;
    --rx-surface-2: #11291f;
    --rx-surface-3: #16362a;
    --rx-ink: #e9f7ef;
    --rx-ink-2: #c3dccd;
    --rx-muted: #8cad9c;
    --rx-faint: #6d8e7d;
    --rx-line: #224438;
    --rx-line-strong: #2f5b49;
    --rx-green: #24c98d;
    --rx-green-2: #34d399;
    --rx-green-dark: #7cf0c2;
    --rx-forest: #04120d;
    --rx-mint: #123427;
    --rx-mint-2: #184a35;
    --rx-cyan: #38d0d8;
    --rx-blue: #7cb3f5;
    --rx-amber: #f2c66d;
    --rx-amber-bg: #3a2c10;
    --rx-red: #f28b84;
    --rx-red-bg: #3a1a18;
    --rx-violet: #b4a6ff;
    --rx-shadow: 0 20px 46px -28px rgba(0, 0, 0, 0.75);
    --rx-shadow-lg: 0 42px 96px -40px rgba(0, 0, 0, 0.85);
    --rx-rail-bg: radial-gradient(70% 40% at 20% 0%, rgba(18, 185, 129, 0.15), transparent 70%), linear-gradient(180deg, #07271e, #04160f);
    --rx-rail-ink: #eafff5;
    --rx-rail-link: #a8c9bb;
    --rx-rail-muted: #7fae9a;
    --rx-rail-label: #5e8b78;
    --rx-rail-line: rgba(151, 255, 207, 0.1);
    --rx-rail-hover: rgba(151, 255, 207, 0.07);
    --rx-rail-active: rgba(111, 240, 189, 0.13);
    --rx-rail-active-ink: #eafff5;
    --rx-rail-accent: #6ff0bd;
    --rx-rail-badge-bg: rgba(255, 204, 102, 0.16);
    --rx-rail-badge-ink: #ffd98a;
    --rx-rail-card: rgba(151, 255, 207, 0.05);
    --rx-rail-card-line: rgba(151, 255, 207, 0.14);
    --rx-rail-card-head: #8fd9bb;
    --rx-rail-scroll: #2a4d3f;
    color-scheme: dark;
}

html[data-bs-theme="dark"] body.rx-body .rx-topbar {
    background: rgba(7, 21, 16, 0.88);
}

html[data-bs-theme="dark"] body.rx-body .rx-boot {
    background:
        radial-gradient(48% 60% at 50% 0%, rgba(36, 201, 141, 0.12), transparent 70%),
        var(--rx-bg);
}

html[data-bs-theme="dark"] body.rx-body .rx-auth__notice {
    border-color: var(--rx-line-strong);
}

html[data-bs-theme="dark"] body.rx-body .rx-btn--ghost:hover {
    border-color: var(--rx-line-strong);
}

html[data-bs-theme="dark"] body.rx-body .rx-btn--danger:hover {
    background: #4a211e;
}

html[data-bs-theme="dark"] body.rx-body .rx-icon-btn__dot {
    border-color: var(--rx-bg);
}

html[data-bs-theme="dark"] body.rx-body .rx-badge--blue {
    background: #13283d;
    color: #8ec5ff;
}

html[data-bs-theme="dark"] body.rx-body .rx-badge--violet {
    background: #241d3f;
    color: #c4b5fd;
}

html[data-bs-theme="dark"] body.rx-body .rx-kpi--blue .rx-kpi__icon {
    background: #13283d;
    color: #8ec5ff;
}

html[data-bs-theme="dark"] body.rx-body .rx-chart__legend i.is-refund,
html[data-bs-theme="dark"] body.rx-body .rx-bar__refund {
    background: #a34d47;
}

html[data-bs-theme="dark"] body.rx-body .rx-select {
    background-image:
        linear-gradient(45deg, transparent 50%, #8cad9c 50%),
        linear-gradient(135deg, #8cad9c 50%, transparent 50%);
}

html[data-bs-theme="dark"] body.rx-body .rx-product-card__thumb {
    background: linear-gradient(145deg, #123427, #0d211a);
}

html[data-bs-theme="dark"] body.rx-body .rx-product-card:nth-child(3n + 2) .rx-product-card__thumb {
    background: linear-gradient(145deg, #12283d, #0e1f30);
    color: #7cb3f5;
}

html[data-bs-theme="dark"] body.rx-body .rx-product-card:nth-child(3n + 3) .rx-product-card__thumb {
    background: linear-gradient(145deg, #241d3f, #19142e);
    color: #b4a6ff;
}

html[data-bs-theme="dark"] body.rx-body .rx-product-card .rx-product-card__thumb.rx-thumb--image {
    background: var(--rx-surface-3);
}

html[data-bs-theme="dark"] body.rx-body .rx-receipt {
    color-scheme: light;
}

/* The global app-window menu owns theme switching; keep its bubble visible
   and themed, while hiding the unrelated platform overlays on the clinical UI. */
body.rx-body #app-window-menu {
    display: flex !important;
    opacity: 1 !important;
    font-family: var(--rx-body);
    color: var(--rx-ink);
    background: var(--rx-surface) !important;
    border-color: var(--rx-line) !important;
}

body.rx-body #app-window-menu #king {
    background: linear-gradient(145deg, #16c98a, #0b7c58) !important;
    color: #03130e !important;
}

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

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

body.rx-body #notif-frame,
body.rx-body #notif-counter,
body.rx-body #streak-card,
body.rx-body .streak-card,
body.rx-body .streak-btn {
    display: none !important;
}

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

body.rx-body h1,
body.rx-body h2,
body.rx-body h3,
body.rx-body h4,
body.rx-body p,
body.rx-body figure,
body.rx-body blockquote {
    margin: 0;
}

body.rx-body ul,
body.rx-body ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

body.rx-body a {
    color: var(--rx-green-dark);
    text-decoration: none;
}

body.rx-body input,
body.rx-body select,
body.rx-body textarea {
    font: inherit;
    color: inherit;
}

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

/* Only completely unstyled buttons get the browser chrome removed. Styled
   components (.rx-btn, .rx-product-card, .rx-pay__method, …) must keep their
   own font/colour/background/border; a blanket `body button` reset silently
   erased them (and outranked every component rule with its higher specificity). */
body.rx-body button:not([class]) {
    font: inherit;
    color: inherit;
    border: 0;
    background: none;
}

body.rx-body svg {
    display: block;
    flex: 0 0 auto;
}

body.rx-body img {
    max-width: 100%;
}

body.rx-body :focus-visible {
    outline: 2px solid var(--rx-green-2);
    outline-offset: 2px;
    border-radius: 6px;
}

body.rx-body ::selection {
    background: var(--rx-mint-2);
    color: var(--rx-forest);
}

body.rx-body ::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

body.rx-body ::-webkit-scrollbar-thumb {
    background: #c7d8d0;
    border-radius: 999px;
}

body.rx-body ::-webkit-scrollbar-track {
    background: transparent;
}

/* ----------------------------------------------------------------------------
   2. Boot & auth
   ------------------------------------------------------------------------- */

.rx-boot {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.45rem;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 2rem;
    text-align: center;
    background:
        radial-gradient(48% 60% at 50% 0%, #e1f5ec, transparent 70%),
        var(--rx-bg);
}

.rx-boot__mark {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    margin-bottom: 0.4rem;
    border-radius: 18px;
    background: var(--rx-forest);
    color: #6ff0bd;
    box-shadow: 0 22px 50px -22px rgba(6, 37, 28, 0.7);
}

.rx-boot h1 {
    font-family: var(--rx-display);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

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

.rx-boot__spin {
    width: 22px;
    height: 22px;
    margin-top: 0.7rem;
    border: 2px solid var(--rx-line-strong);
    border-top-color: var(--rx-green);
    border-radius: 50%;
    animation: rxSpin 0.8s linear infinite;
}

.rx-noscript {
    max-width: 520px;
    margin: 4rem auto;
    padding: 2rem;
    border: 1px solid var(--rx-line);
    border-radius: var(--rx-radius);
    background: var(--rx-surface);
    text-align: center;
}

.rx-auth {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--rx-bg);
}

.rx-auth__hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(28px, 4vw, 56px);
    overflow: hidden;
    background:
        radial-gradient(60% 60% at 18% 12%, rgba(18, 185, 129, 0.32), transparent 70%),
        radial-gradient(50% 50% at 90% 80%, rgba(14, 154, 167, 0.2), transparent 70%),
        linear-gradient(155deg, #07271e 0%, #041a14 60%, #03120e 100%);
    color: #eafff5;
}

.rx-auth__hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(151, 255, 207, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(151, 255, 207, 0.055) 1px, transparent 1px);
    background-size: 54px 54px;
    -webkit-mask-image: radial-gradient(70% 70% at 35% 25%, #000, transparent 78%);
    mask-image: radial-gradient(70% 70% at 35% 25%, #000, transparent 78%);
    pointer-events: none;
}

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

.rx-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--rx-display);
    font-size: 1.16rem;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.rx-brand__mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(145deg, #16c98a, #0b7c58);
    color: #03130e;
    box-shadow: 0 12px 30px -14px rgba(18, 185, 129, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.rx-brand__name small {
    display: block;
    margin-top: -2px;
    color: #8fd9bb;
    font-family: var(--rx-body);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.rx-auth__copy {
    max-width: 560px;
    margin: clamp(30px, 6vw, 70px) 0;
}

.rx-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: #9dfbcc;
    font-family: var(--rx-display);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

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

.rx-auth__copy h1 {
    margin-top: 1rem;
    font-family: var(--rx-display);
    font-size: clamp(2.1rem, 4.2vw, 3.5rem);
    font-weight: 800;
    line-height: 1.03;
    letter-spacing: -0.05em;
}

.rx-auth__copy h1 em {
    color: #6ff0bd;
    font-style: normal;
}

.rx-auth__copy p {
    max-width: 46ch;
    margin-top: 1rem;
    color: #a8c9bb;
    font-size: 0.95rem;
    line-height: 1.7;
}

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

.rx-auth__points li {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    color: #cbebdd;
    font-size: 0.83rem;
}

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

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

.rx-auth__foot strong {
    display: block;
    color: #d9f5e8;
    font-family: var(--rx-display);
    font-size: 1rem;
    font-weight: 700;
}

.rx-auth__panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4vw, 56px);
}

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

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

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

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

.rx-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(--rx-mint);
    color: var(--rx-green-dark);
    font-size: 0.7rem;
    line-height: 1.45;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* ----------------------------------------------------------------------------
   3. App shell
   ------------------------------------------------------------------------- */

.rx-app {
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
}

.rx-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: 1.05rem 0.8rem 0.9rem;
    overflow-y: auto;
    border-right: 1px solid var(--rx-rail-line);
    background: var(--rx-rail-bg);
    color: var(--rx-rail-ink);
    z-index: 40;
}

.rx-sidebar .rx-brand {
    padding: 0.2rem 0.45rem 1.1rem;
}

.rx-sidebar .rx-brand__name small {
    color: var(--rx-rail-muted);
}

.rx-sidebar::-webkit-scrollbar-thumb {
    background: var(--rx-rail-scroll);
}

.rx-sidebar__label {
    padding: 0.85rem 0.6rem 0.35rem;
    color: var(--rx-rail-label);
    font-family: var(--rx-display);
    font-size: 0.54rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.rx-nav {
    display: grid;
    gap: 2px;
}

.rx-sidebar .rx-nav__link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.62rem 0.62rem;
    border-radius: 9px;
    color: var(--rx-rail-link);
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.18s ease, color 0.18s ease;
}

.rx-sidebar .rx-nav__link:hover {
    background: var(--rx-rail-hover);
    color: var(--rx-rail-ink);
}

.rx-sidebar .rx-nav__link.is-active {
    background: var(--rx-rail-active);
    color: var(--rx-rail-active-ink);
    box-shadow: inset 2px 0 0 var(--rx-rail-accent);
}

.rx-sidebar .rx-nav__link svg {
    opacity: 0.85;
}

.rx-sidebar .rx-nav__link.is-active svg {
    color: var(--rx-rail-accent);
    opacity: 1;
}

.rx-nav__badge {
    margin-left: auto;
    padding: 0.06rem 0.38rem;
    border-radius: 999px;
    background: var(--rx-rail-badge-bg);
    color: var(--rx-rail-badge-ink);
    font-size: 0.56rem;
    font-weight: 700;
}

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

.rx-plan-card {
    margin: 0.5rem 0.15rem 0.7rem;
    padding: 0.85rem;
    border: 1px solid var(--rx-rail-card-line);
    border-radius: 13px;
    background: var(--rx-rail-card);
}

.rx-plan-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--rx-rail-card-head);
    font-family: var(--rx-display);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.rx-plan-card h4 {
    margin-top: 0.2rem;
    color: var(--rx-rail-ink);
    font-family: var(--rx-display);
    font-size: 0.92rem;
    font-weight: 700;
}

.rx-plan-card p {
    margin-top: 0.15rem;
    color: var(--rx-rail-muted);
    font-size: 0.64rem;
}

.rx-plan-card a {
    display: inline-block;
    margin-top: 0.55rem;
    color: var(--rx-rail-accent);
    font-size: 0.66rem;
    font-weight: 700;
}

.rx-sidebar__user {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 0.55rem;
    border-top: 1px solid var(--rx-rail-line);
}

.rx-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(145deg, #16c98a, #0b7c58);
    color: #03130e;
    font-family: var(--rx-display);
    font-size: 0.62rem;
    font-weight: 800;
}

.rx-sidebar__user strong {
    display: block;
    color: var(--rx-rail-ink);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
}

.rx-sidebar__user small {
    display: block;
    color: var(--rx-rail-muted);
    font-size: 0.6rem;
    text-transform: capitalize;
}

.rx-sidebar__user button {
    margin-left: auto;
    padding: 0;
    border: 0;
    background: none;
    color: var(--rx-rail-muted);
}

.rx-sidebar__user button:hover {
    color: var(--rx-rail-ink);
}

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

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

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

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

.rx-topbar__title small {
    display: block;
    color: var(--rx-muted);
    font-family: var(--rx-body);
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0;
}

.rx-topbar__spacer {
    flex: 1;
}

.rx-branch-pick {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    height: 38px;
    padding: 0 0.7rem;
    border: 1px solid var(--rx-line);
    border-radius: 10px;
    background: var(--rx-surface);
    color: var(--rx-ink-2);
    font-size: 0.76rem;
    font-weight: 600;
}

.rx-branch-pick svg {
    color: var(--rx-green);
}

.rx-branch-pick select {
    max-width: 170px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    outline: none;
}

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

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

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

.rx-icon-btn__dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--rx-red);
    border: 1.5px solid #fff;
}

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

.rx-user-chip__name {
    display: none;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.2;
}

.rx-user-chip__name small {
    display: block;
    color: var(--rx-muted);
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: capitalize;
}

.rx-content {
    flex: 1;
    width: 100%;
    max-width: 1540px;
    margin-inline: auto;
    padding: clamp(18px, 2.4vw, 30px);
}

.rx-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1.25rem;
}

.rx-page-head h1 {
    font-family: var(--rx-display);
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.15;
}

.rx-page-head p {
    margin-top: 0.2rem;
    color: var(--rx-muted);
    font-size: 0.8rem;
}

.rx-page-head__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rx-mobile-backdrop {
    display: none;
}

/* ----------------------------------------------------------------------------
   4. Buttons, fields, badges
   ------------------------------------------------------------------------- */

.rx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.62rem 0.95rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: var(--rx-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, border-color 0.16s ease;
}

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

.rx-btn--primary {
    background: linear-gradient(145deg, #10b47c, #0a8a60);
    color: #fff;
    box-shadow: 0 12px 26px -16px rgba(10, 138, 96, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.rx-btn--primary:hover {
    box-shadow: 0 18px 34px -16px rgba(10, 138, 96, 0.95);
}

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

.rx-btn--ghost:hover {
    background: var(--rx-surface-2);
    border-color: #b4cdc2;
}

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

.rx-btn--soft:hover {
    background: var(--rx-mint-2);
}

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

.rx-btn--danger:hover {
    background: #fbdad8;
}

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

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

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

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

.rx-link:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rx-field {
    display: grid;
    gap: 0.3rem;
}

.rx-field>label,
.rx-label {
    color: var(--rx-ink-2);
    font-size: 0.7rem;
    font-weight: 600;
}

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

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

.rx-input::placeholder,
.rx-textarea::placeholder {
    color: var(--rx-faint);
}

.rx-input:focus,
.rx-select:focus,
.rx-textarea:focus {
    border-color: var(--rx-green-2);
    box-shadow: 0 0 0 3px rgba(18, 185, 129, 0.13);
}

.rx-select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #6b7f76 50%),
        linear-gradient(135deg, #6b7f76 50%, transparent 50%);
    background-position:
        calc(100% - 15px) calc(50% - 2px),
        calc(100% - 10px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 1.8rem;
}

.rx-textarea {
    min-height: 78px;
    resize: vertical;
}

.rx-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--rx-ink-2);
    font-size: 0.74rem;
    line-height: 1.4;
}

.rx-check input {
    margin-top: 0.15rem;
    accent-color: var(--rx-green);
}

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

.rx-form-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.rx-form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--rx-line);
}

.rx-search {
    position: relative;
    flex: 1;
    min-width: 180px;
}

.rx-search svg {
    position: absolute;
    top: 50%;
    left: 0.65rem;
    transform: translateY(-50%);
    color: var(--rx-faint);
}

.rx-search .rx-input {
    padding-left: 2rem;
}

.rx-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.16rem 0.46rem;
    border-radius: 999px;
    background: var(--rx-surface-3);
    color: var(--rx-muted);
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}

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

.rx-badge--amber {
    background: var(--rx-amber-bg);
    color: var(--rx-amber);
}

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

.rx-badge--blue {
    background: #eaf2fb;
    color: var(--rx-blue);
}

.rx-badge--violet {
    background: #eeecfb;
    color: var(--rx-violet);
}

.rx-status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.rx-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

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

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

.rx-avatar--sm {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 0.54rem;
}

/* ----------------------------------------------------------------------------
   5. Cards, tables, empty states
   ------------------------------------------------------------------------- */

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

.rx-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--rx-line);
}

.rx-card__head h2,
.rx-card__head h3 {
    font-family: var(--rx-display);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.rx-card__head p {
    color: var(--rx-muted);
    font-size: 0.68rem;
}

.rx-card__body {
    padding: 1rem;
}

.rx-card__foot {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--rx-line);
    background: var(--rx-surface-2);
    border-radius: 0 0 var(--rx-radius) var(--rx-radius);
}

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

.rx-kpi {
    position: relative;
    padding: 0.95rem 1rem;
    border: 1px solid var(--rx-line);
    border-radius: 14px;
    background: var(--rx-surface);
    box-shadow: var(--rx-shadow);
    overflow: hidden;
}

.rx-kpi::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 52px;
    height: 3px;
    border-radius: 0 0 3px 0;
    background: linear-gradient(90deg, var(--rx-green-2), var(--rx-cyan));
}

.rx-kpi__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--rx-muted);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.rx-kpi__icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--rx-mint);
    color: var(--rx-green-dark);
}

.rx-kpi__value {
    margin-top: 0.35rem;
    font-family: var(--rx-display);
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.rx-kpi__sub {
    margin-top: 0.2rem;
    color: var(--rx-muted);
    font-size: 0.66rem;
}

.rx-kpi__sub b {
    color: var(--rx-green-dark);
    font-weight: 700;
}

.rx-kpi--amber::before {
    background: linear-gradient(90deg, #e7b34a, #d97706);
}

.rx-kpi--amber .rx-kpi__icon {
    background: var(--rx-amber-bg);
    color: var(--rx-amber);
}

.rx-kpi--red::before {
    background: linear-gradient(90deg, #e2766f, #b91c1c);
}

.rx-kpi--red .rx-kpi__icon {
    background: var(--rx-red-bg);
    color: var(--rx-red);
}

.rx-kpi--blue::before {
    background: linear-gradient(90deg, #60a5fa, #2563eb);
}

.rx-kpi--blue .rx-kpi__icon {
    background: #eaf2fb;
    color: var(--rx-blue);
}

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

.rx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.76rem;
}

.rx-table th {
    padding: 0.62rem 0.75rem;
    border-bottom: 1px solid var(--rx-line);
    background: var(--rx-surface-2);
    color: var(--rx-muted);
    font-family: var(--rx-display);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.rx-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--rx-line);
    color: var(--rx-ink-2);
    vertical-align: middle;
}

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

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

.rx-table__primary {
    color: var(--rx-ink);
    font-weight: 600;
}

.rx-table__sub {
    display: block;
    color: var(--rx-muted);
    font-size: 0.66rem;
}

.rx-table__right {
    text-align: right;
}

.rx-table__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.3rem;
}

.rx-table__actions button,
.rx-table__actions a {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--rx-line);
    border-radius: 7px;
    background: var(--rx-surface);
    color: var(--rx-muted);
}

.rx-table__actions button:hover,
.rx-table__actions a:hover {
    color: var(--rx-ink);
    border-color: var(--rx-line-strong);
}

.rx-empty {
    display: grid;
    justify-items: center;
    gap: 0.4rem;
    padding: 2.4rem 1rem;
    text-align: center;
}

.rx-empty__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 0.3rem;
    border-radius: 15px;
    background: var(--rx-mint);
    color: var(--rx-green-dark);
}

.rx-empty h3 {
    font-family: var(--rx-display);
    font-size: 0.95rem;
    font-weight: 700;
}

.rx-empty p {
    max-width: 42ch;
    color: var(--rx-muted);
    font-size: 0.76rem;
}

.rx-empty .rx-btn {
    margin-top: 0.55rem;
}

.rx-progress {
    height: 6px;
    border-radius: 999px;
    background: var(--rx-surface-3);
    overflow: hidden;
}

.rx-progress span {
    display: block;
    width: var(--w, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--rx-green-2), var(--rx-cyan));
}

.rx-progress--amber span {
    background: linear-gradient(90deg, #e7b34a, #d97706);
}

/* ----------------------------------------------------------------------------
   6. Dashboard
   ------------------------------------------------------------------------- */

.rx-dash {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: 0.9rem;
}

.rx-dash__wide {
    grid-column: 1 / -1;
}

.rx-chart {
    padding: 1rem;
}

.rx-chart__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.rx-chart__head h3 {
    font-family: var(--rx-display);
    font-size: 0.86rem;
    font-weight: 700;
}

.rx-chart__head p {
    color: var(--rx-muted);
    font-size: 0.66rem;
}

.rx-chart__legend {
    display: flex;
    gap: 0.8rem;
    color: var(--rx-muted);
    font-size: 0.62rem;
}

.rx-chart__legend i {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 0.25rem;
    border-radius: 2px;
    background: var(--rx-green-2);
}

.rx-chart__legend i.is-refund {
    background: #f0b4ae;
}

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

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

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

.rx-bar__refund {
    width: 100%;
    height: var(--r, 0%);
    margin-top: 1px;
    border-radius: 1px;
    background: #f0b4ae;
}

.rx-bar:hover .rx-bar__fill {
    background: linear-gradient(180deg, #4ade9f, #0a8a60);
}

.rx-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(--rx-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;
}

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

/* Keep the first/last tooltips inside the chart. A centred tooltip on the last
   bar contributes to horizontal document overflow even while it is invisible. */
.rx-bar:first-child .rx-bar__tip {
    left: 0;
    transform: translateY(3px);
}

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

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

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

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

.rx-list {
    display: grid;
}

.rx-list__row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0;
    border: 0;
    border-bottom: 1px solid var(--rx-line);
    background: none;
    color: var(--rx-ink);
    font-family: var(--rx-body);
    font-size: 0.72rem;
    text-align: left;
}

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

.rx-list__row strong {
    color: var(--rx-ink);
    font-weight: 600;
}

.rx-list__row small {
    color: var(--rx-muted);
    font-size: 0.62rem;
}

.rx-list__meta {
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
}

.rx-list__meta b {
    display: block;
    color: var(--rx-ink);
    font-family: var(--rx-display);
    font-size: 0.74rem;
}

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

.rx-alert-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.6rem;
    border-radius: 9px;
    background: var(--rx-surface-2);
    font-size: 0.7rem;
}

.rx-alert-item+.rx-alert-item {
    margin-top: 0.4rem;
}

.rx-alert-item__icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--rx-amber-bg);
    color: var(--rx-amber);
}

.rx-alert-item--red .rx-alert-item__icon {
    background: var(--rx-red-bg);
    color: var(--rx-red);
}

.rx-alert-item__meta {
    margin-left: auto;
    color: var(--rx-muted);
    font-size: 0.62rem;
    white-space: nowrap;
}

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

.rx-quick a,
.rx-quick button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.75rem;
    border: 1px solid var(--rx-line);
    border-radius: 11px;
    background: var(--rx-surface-2);
    color: var(--rx-ink-2);
    font-size: 0.7rem;
    font-weight: 600;
    text-align: left;
}

.rx-quick a:hover,
.rx-quick button:hover {
    border-color: var(--rx-green-2);
    background: var(--rx-mint);
}

.rx-quick svg {
    color: var(--rx-green-dark);
}

/* ----------------------------------------------------------------------------
   7. POS
   ------------------------------------------------------------------------- */

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

.rx-pos__catalog {
    min-width: 0;
}

.rx-pos__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin-bottom: 0.7rem;
}

.rx-pos__search {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.rx-pos__search svg {
    position: absolute;
    top: 50%;
    left: 0.7rem;
    transform: translateY(-50%);
    color: var(--rx-faint);
}

.rx-pos__search input {
    width: 100%;
    height: 44px;
    padding: 0 0.8rem 0 2.15rem;
    border: 1px solid var(--rx-line-strong);
    border-radius: 11px;
    background: var(--rx-surface);
    font-size: 0.82rem;
    outline: none;
    box-shadow: var(--rx-shadow);
}

.rx-pos__search input:focus {
    border-color: var(--rx-green-2);
    box-shadow: 0 0 0 3px rgba(18, 185, 129, 0.13);
}

.rx-pos__search kbd {
    position: absolute;
    top: 50%;
    right: 0.6rem;
    transform: translateY(-50%);
    padding: 0.1rem 0.3rem;
    border: 1px solid var(--rx-line);
    border-radius: 4px;
    background: var(--rx-surface-2);
    color: var(--rx-faint);
    font-size: 0.56rem;
}

.rx-pos__cats {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.7rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
}

.rx-body .rx-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 0.6rem;
}

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

.rx-product-card:hover {
    transform: translateY(-2px);
    border-color: rgba(18, 185, 129, 0.55);
    box-shadow: var(--rx-shadow);
}

.rx-product-card:disabled {
    opacity: 0.5;
    transform: none;
    cursor: not-allowed;
}

.rx-product-card__thumb {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1.5;
    margin-bottom: 0.2rem;
    border-radius: 9px;
    background: linear-gradient(145deg, var(--rx-mint), #f1faf6);
    color: var(--rx-green-dark);
}

.rx-product-card__thumb.rx-thumb--image {
    padding: 0;
    background: var(--rx-surface-3);
}

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

.rx-product-card:nth-child(3n + 2) .rx-product-card__thumb {
    background: linear-gradient(145deg, #e9f2fb, #f4f8fd);
    color: var(--rx-blue);
}

.rx-product-card:nth-child(3n + 3) .rx-product-card__thumb {
    background: linear-gradient(145deg, #f4eefc, #faf7ff);
    color: var(--rx-violet);
}

.rx-product-card__name {
    color: var(--rx-ink);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rx-product-card__sub {
    color: var(--rx-muted);
    font-size: 0.6rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rx-product-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem;
    margin-top: auto;
    padding-top: 0.3rem;
}

.rx-product-card__price {
    color: var(--rx-ink);
    font-family: var(--rx-display);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.rx-product-card__stock {
    color: var(--rx-muted);
    font-size: 0.56rem;
    white-space: nowrap;
}

.rx-product-card__stock.is-low {
    color: var(--rx-amber);
    font-weight: 700;
}

.rx-product-card__stock.is-out {
    color: var(--rx-red);
    font-weight: 700;
}

.rx-product-card__flags {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    display: flex;
    gap: 3px;
}

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

.rx-cart__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.85rem 0.95rem;
    border-bottom: 1px solid var(--rx-line);
}

.rx-cart__head h2 {
    font-family: var(--rx-display);
    font-size: 0.9rem;
    font-weight: 700;
}

.rx-cart__head button {
    padding: 0;
    border: 0;
    background: none;
}

.rx-cart__count {
    padding: 0.1rem 0.42rem;
    border-radius: 999px;
    background: var(--rx-mint);
    color: var(--rx-green-dark);
    font-size: 0.6rem;
    font-weight: 700;
}

.rx-cart__scroll {
    flex: 1;
    min-height: 110px;
    overflow-y: auto;
    padding: 0.7rem 0.9rem;
}

.rx-cart__empty {
    display: grid;
    place-items: center;
    gap: 0.3rem;
    padding: 2rem 0.5rem;
    color: var(--rx-muted);
    font-size: 0.74rem;
    text-align: center;
}

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

.rx-cart__line {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--rx-line);
}

.rx-cart__line:last-child {
    border-bottom: 0;
}

.rx-cart__thumb {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--rx-mint);
    color: var(--rx-green-dark);
}

.rx-cart__name {
    color: var(--rx-ink);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
}

.rx-cart__sub {
    color: var(--rx-muted);
    font-size: 0.6rem;
}

.rx-cart__right {
    display: grid;
    justify-items: end;
    gap: 0.2rem;
}

.rx-cart__price {
    color: var(--rx-ink);
    font-family: var(--rx-display);
    font-size: 0.72rem;
    font-weight: 700;
}

.rx-qty {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.1rem;
    border: 1px solid var(--rx-line);
    border-radius: 7px;
    background: var(--rx-surface-2);
}

.rx-qty button {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: none;
    color: var(--rx-ink-2);
}

.rx-qty button:hover {
    background: var(--rx-mint);
    color: var(--rx-green-dark);
}

.rx-qty span {
    min-width: 18px;
    font-size: 0.66rem;
    font-weight: 700;
    text-align: center;
}

.rx-cart__meta {
    padding: 0.7rem 0.9rem;
    border-top: 1px solid var(--rx-line);
    background: var(--rx-surface-2);
}

.rx-cart__selects {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.55rem;
}

.rx-cart__selects .rx-field>label {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rx-cart__selects .rx-select {
    padding: 0.42rem 0.5rem;
    font-size: 0.68rem;
    background-position:
        calc(100% - 15px) calc(50% - 1px),
        calc(100% - 10px) calc(50% - 1px);
}

.rx-rx-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    background: var(--rx-amber-bg);
    color: #8a5a10;
    font-size: 0.64rem;
    line-height: 1.4;
}

.rx-rx-banner svg {
    margin-top: 0.05rem;
}

.rx-rx-banner--ok {
    background: var(--rx-mint);
    color: var(--rx-green-dark);
}

.rx-totals {
    display: grid;
    gap: 0.18rem;
    margin-bottom: 0.55rem;
}

.rx-totals__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    color: var(--rx-muted);
    font-size: 0.68rem;
}

.rx-totals__row b {
    color: var(--rx-ink-2);
    font-weight: 600;
}

.rx-totals__row--total {
    margin-top: 0.3rem;
    padding-top: 0.4rem;
    border-top: 1px dashed var(--rx-line-strong);
    color: var(--rx-ink);
    font-family: var(--rx-display);
    font-size: 0.8rem;
    font-weight: 700;
}

.rx-totals__row--total b {
    color: var(--rx-ink);
    font-size: 1.16rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.rx-pay {
    display: grid;
    gap: 0.4rem;
}

.rx-pay__methods {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.28rem;
}

.rx-pay__method {
    display: grid;
    justify-items: center;
    gap: 0.14rem;
    padding: 0.38rem 0.2rem;
    border: 1px solid var(--rx-line);
    border-radius: 8px;
    background: var(--rx-surface);
    color: var(--rx-muted);
    font-family: var(--rx-body);
    font-size: 0.54rem;
    font-weight: 600;
}

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

.rx-pay__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem;
}

.rx-pay__row .rx-input {
    padding: 0.5rem 0.6rem;
    font-size: 0.74rem;
}

.rx-register-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--rx-line);
    border-radius: 9px;
    background: var(--rx-surface);
    color: var(--rx-muted);
    font-size: 0.64rem;
}

.rx-register-bar b {
    color: var(--rx-ink-2);
}

.rx-register-bar .rx-btn {
    margin-left: auto;
}

/* ----------------------------------------------------------------------------
   8. Inventory, prescriptions, patients
   ------------------------------------------------------------------------- */

.rx-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.rx-toolbar .rx-select {
    width: auto;
    min-width: 130px;
    padding-top: 0.46rem;
    padding-bottom: 0.46rem;
    font-size: 0.72rem;
}

.rx-prod-cell {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.rx-prod-cell__thumb {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--rx-mint);
    color: var(--rx-green-dark);
    font-family: var(--rx-display);
    font-size: 0.62rem;
    font-weight: 800;
    overflow: hidden;
}

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

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

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

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

.rx-image-preview__empty {
    display: grid;
    justify-items: center;
    gap: 0.2rem;
    padding: 0.4rem;
    text-align: center;
    font-size: 0.56rem;
}

.rx-image-side {
    display: grid;
    gap: 0.4rem;
}

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

.rx-image-actions label.rx-btn {
    cursor: pointer;
}

.rx-stock-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
}

.rx-stock-pill.is-low {
    color: var(--rx-amber);
}

.rx-stock-pill.is-out {
    color: var(--rx-red);
}

.rx-stock-pill.is-ok {
    color: var(--rx-green-dark);
}

.rx-flag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.rx-line-items {
    display: grid;
    gap: 0.5rem;
}

.rx-line-item {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 0.7fr)) auto;
    gap: 0.4rem;
    align-items: end;
    padding: 0.55rem;
    border: 1px solid var(--rx-line);
    border-radius: 10px;
    background: var(--rx-surface-2);
}

.rx-line-item--rx {
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 0.7fr)) minmax(0, 1.4fr) auto;
}

.rx-line-item .rx-field>label {
    font-size: 0.56rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rx-line-item .rx-input,
.rx-line-item .rx-select {
    padding: 0.42rem 0.5rem;
    font-size: 0.7rem;
}

.rx-line-item__del {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-bottom: 0.05rem;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--rx-muted);
}

.rx-line-item__del:hover {
    background: var(--rx-red-bg);
    color: var(--rx-red);
}

.rx-mini-list {
    display: grid;
    gap: 0.35rem;
}

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

.rx-mini-row__meta {
    margin-left: auto;
    color: var(--rx-muted);
    font-size: 0.62rem;
    white-space: nowrap;
}

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

.rx-tab {
    padding: 0.45rem 0.8rem;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--rx-muted);
    font-family: var(--rx-display);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

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

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

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

.rx-plan {
    position: relative;
    padding: 0.95rem;
    border: 1px solid var(--rx-line);
    border-radius: 13px;
    background: var(--rx-surface);
}

.rx-plan.is-current {
    border-color: var(--rx-green);
    background: linear-gradient(160deg, var(--rx-mint), var(--rx-surface));
    box-shadow: var(--rx-shadow);
}

.rx-plan__name {
    color: var(--rx-green-dark);
    font-family: var(--rx-display);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rx-plan__price {
    margin-top: 0.2rem;
    font-family: var(--rx-display);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.rx-plan__price small {
    color: var(--rx-muted);
    font-family: var(--rx-body);
    font-size: 0.6rem;
    font-weight: 500;
}

.rx-plan ul {
    display: grid;
    gap: 0.28rem;
    margin-top: 0.55rem;
}

.rx-plan li {
    display: flex;
    gap: 0.35rem;
    color: var(--rx-ink-2);
    font-size: 0.68rem;
}

.rx-plan li svg {
    flex: 0 0 auto;
    margin-top: 0.1rem;
    color: var(--rx-green);
}

.rx-usage {
    display: grid;
    gap: 0.6rem;
}

.rx-usage__row {
    display: grid;
    gap: 0.22rem;
}

.rx-usage__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    color: var(--rx-ink-2);
    font-size: 0.68rem;
}

.rx-usage__top b {
    font-weight: 700;
}

.rx-usage__top span {
    color: var(--rx-muted);
    font-size: 0.6rem;
}

.rx-audit-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--rx-line);
    font-size: 0.68rem;
}

.rx-audit-row:last-child {
    border-bottom: 0;
}

.rx-audit-row b {
    color: var(--rx-ink);
    font-weight: 600;
}

.rx-audit-row span {
    color: var(--rx-muted);
    font-size: 0.6rem;
}

.rx-audit-row time {
    margin-left: auto;
    color: var(--rx-faint);
    font-size: 0.58rem;
    white-space: nowrap;
}

/* ----------------------------------------------------------------------------
   9. Modal, toast, receipt
   ------------------------------------------------------------------------- */

.rx-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(3, 18, 14, 0.45);
    backdrop-filter: blur(4px);
    animation: rxFade 0.16s ease both;
}

.rx-modal__dialog {
    display: flex;
    flex-direction: column;
    width: min(560px, 100%);
    max-height: calc(100vh - 2rem);
    border: 1px solid var(--rx-line);
    border-radius: 18px;
    background: var(--rx-surface);
    box-shadow: var(--rx-shadow-lg);
    animation: rxPop 0.18s ease both;
}

.rx-modal__dialog--lg {
    width: min(860px, 100%);
}

.rx-modal__dialog--sm {
    width: min(420px, 100%);
}

.rx-modal__head {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.95rem 1.05rem;
    border-bottom: 1px solid var(--rx-line);
}

.rx-modal__head h2 {
    font-family: var(--rx-display);
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

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

.rx-modal__close:hover {
    background: var(--rx-surface-3);
    color: var(--rx-ink);
}

.rx-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.05rem;
}

.rx-modal__foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.8rem 1.05rem;
    border-top: 1px solid var(--rx-line);
    background: var(--rx-surface-2);
    border-radius: 0 0 18px 18px;
}

.rx-toasts {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 300;
    display: grid;
    gap: 0.45rem;
    width: min(360px, calc(100vw - 2rem));
    pointer-events: none;
}

.rx-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--rx-line);
    border-radius: 11px;
    background: var(--rx-surface);
    box-shadow: var(--rx-shadow-lg);
    color: var(--rx-ink-2);
    font-size: 0.74rem;
    line-height: 1.45;
    pointer-events: auto;
    animation: rxToastIn 0.2s ease both;
}

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

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

.rx-toast--warn .rx-toast__icon {
    background: var(--rx-amber-bg);
    color: var(--rx-amber);
}

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

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

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

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

.rx-receipt__brand p {
    color: #5d7169;
    font-size: 0.62rem;
}

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

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

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

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

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

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

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

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

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

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

.rx-receipt__barcode {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1px;
    height: 28px;
    margin-top: 0.55rem;
}

.rx-receipt__barcode i {
    display: block;
    width: 1px;
    height: 100%;
    background: #17231f;
}

.rx-print {
    display: none;
}

/* ----------------------------------------------------------------------------
   10. Animations
   ------------------------------------------------------------------------- */

@keyframes rxSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes rxFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

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

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

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

@media (prefers-reduced-motion: reduce) {

    body.rx-body *,
    body.rx-body *::before,
    body.rx-body *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ----------------------------------------------------------------------------
   11. Responsive
   ------------------------------------------------------------------------- */

@media (max-width: 1240px) {
    .rx-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

@media (max-width: 1080px) {
    .rx-app {
        grid-template-columns: minmax(0, 1fr);
    }

    .rx-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(280px, 86vw);
        transform: translateX(-102%);
        transition: transform 0.22s ease;
        box-shadow: 30px 0 80px -40px rgba(0, 0, 0, 0.7);
    }

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

    .rx-mobile-backdrop.is-open {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 35;
        background: rgba(3, 18, 14, 0.45);
        backdrop-filter: blur(2px);
    }

    .rx-topbar__menu {
        display: grid;
    }

    .rx-topbar__date {
        display: none;
    }

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

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

    .rx-cart__scroll {
        max-height: 320px;
    }

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

    .rx-auth__hero {
        display: none;
    }

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

    .rx-auth__panel {
        min-height: 100vh;
        min-height: 100dvh;
        background:
            radial-gradient(45% 45% at 50% 0%, #e2f6ec, transparent 70%),
            var(--rx-bg);
    }

    html[data-bs-theme="dark"] body.rx-body .rx-auth__panel {
        background:
            radial-gradient(45% 45% at 50% 0%, rgba(36, 201, 141, 0.12), transparent 70%),
            var(--rx-bg);
    }

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

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

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

    .rx-topbar__title small {
        display: none;
    }

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

    .rx-user-chip__name {
        display: none;
    }

    .rx-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .rx-kpi {
        padding: 0.75rem;
    }

    .rx-kpi__value {
        font-size: 1.1rem;
    }

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

    .rx-line-item,
    .rx-line-item--rx {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rx-line-item>.rx-field:first-child,
    .rx-line-item__del {
        grid-column: 1 / -1;
    }

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

    .rx-page-head {
        align-items: flex-start;
    }

    .rx-page-head__actions {
        width: 100%;
    }

    .rx-brand-pick {
        display: none;
    }
}

@media (max-width: 520px) {
    .rx-kpis {
        grid-template-columns: minmax(0, 1fr);
    }

    .rx-branch-pick {
        max-width: 130px;
    }

    .rx-branch-pick select {
        max-width: 92px;
    }

    .rx-qty button {
        width: 26px;
        height: 26px;
    }

    .rx-auth__panel {
        padding: 20px;
    }

    .rx-modal {
        padding: 0.5rem;
    }

    .rx-modal__dialog {
        max-height: calc(100vh - 1rem);
    }

    .rx-tabs {
        width: 100%;
    }

    .rx-tab {
        flex: 1;
        text-align: center;
    }
}

/* ----------------------------------------------------------------------------
   12. Print — only the receipt survives
   ------------------------------------------------------------------------- */

@media print {
    @page {
        margin: 10mm;
    }

    body.rx-body * {
        visibility: hidden !important;
    }

    body.rx-body #rxPrint,
    body.rx-body #rxPrint * {
        visibility: visible !important;
    }

    body.rx-body #rxPrint {
        display: block !important;
        position: absolute;
        inset: 0;
        padding: 0;
        background: #fff;
    }

    body.rx-body #rxPrint .rx-receipt {
        width: 80mm;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
}