/* OrchestraRx screens rebuilt in HTML for the website (ui.js draws them). The app's own tokens (src/app/globals.css):
   neutral shadcn colours, the grey canvas, white cards with a hairline ring, the 5.4px radius scale, PP Neue Montreal
   Arabic, tabular numbers. Everything is drawn at the app's real size and scaled to fit its place on the page. */

.mock { position: relative; width: 100%; overflow: hidden; }
.mock__in { position: absolute; top: 0; left: 0; transform-origin: top left; } /* scaled from the left in both languages; the screen inside keeps its own direction */

.x {
  --x-bg: #fff; --x-canvas: oklch(0.962 0.002 264); --x-ink: oklch(0.145 0 0); --x-ink2: oklch(0.32 0 0); --x-mute: oklch(0.556 0 0); --x-faint: oklch(0.708 0 0);
  --x-line: oklch(0.922 0 0); --x-ring: oklch(0 0 0 / 7%); --x-hover: oklch(0.97 0 0); --x-active: oklch(0.94 0 0);
  --x-green: oklch(0.527 0.154 150.069); --x-green-soft: oklch(0.527 0.154 150.069 / 10%); --x-sell: oklch(0.68 0.16 152); --x-sell-soft: oklch(0.68 0.16 152 / 12%);
  --x-orange: oklch(0.553 0.195 38.402); --x-orange-soft: oklch(0.705 0.213 47.604 / 12%); --x-red: oklch(0.577 0.245 27.325); --x-red-soft: oklch(0.577 0.245 27.325 / 9%);
  --x-blue: oklch(0.546 0.245 262.881); --x-blue-soft: oklch(0.546 0.245 262.881 / 9%); --x-purple: oklch(0.496 0.265 301.924); --x-purple-soft: oklch(0.627 0.265 303.9 / 11%);
  --x-yellow: oklch(0.555 0.163 48.998); --x-yellow-soft: oklch(0.828 0.189 84.429 / 18%);
  --x-r: 5.4px; --x-r-lg: 7.6px; --x-r-xl: 9.7px; --x-r-2xl: 11.9px;
  font-family: "PP Neue Montreal Arabic", system-ui, sans-serif; font-size: 14px; line-height: 1.45; color: var(--x-ink); font-weight: 400;
  background: var(--x-canvas); text-align: start; -webkit-font-smoothing: antialiased;
}
.x * { box-sizing: border-box; }
.x svg { flex: none; display: block; }
.x b, .x strong { font-weight: 600; }
.x .n { font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.x .mute { color: var(--x-mute); }
.x .faint { color: var(--x-faint); }
.x .row { display: flex; align-items: center; gap: 8px; }
.x .grow { flex: 1; min-width: 0; }
.x .ltr { direction: ltr; unicode-bidi: isolate; }

/* cards, buttons, inputs, chips */
.x-card { background: #fff; border-radius: var(--x-r-2xl); box-shadow: 0 0 0 1px var(--x-ring), 0 1px 2px oklch(0 0 0 / 3%); }
.x-card:has(> .x-table) { overflow: hidden; } /* the table header follows the card's rounded corners */
.x-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--x-r-lg); background: #fff; box-shadow: 0 0 0 1px var(--x-ring); font-size: 14px; font-weight: 500; white-space: nowrap; color: var(--x-ink); }
.x-btn--dark { background: oklch(0.205 0 0); color: #fff; box-shadow: none; }
.x-btn--sell { background: var(--x-sell-soft); color: var(--x-green); box-shadow: inset 0 0 0 1px oklch(0.68 0.16 152 / 30%); }
.x-btn--sm { height: 30px; padding: 0 10px; font-size: 13px; }
.x-input { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: var(--x-r-lg); background: #fff; box-shadow: 0 0 0 1px var(--x-line); color: var(--x-faint); font-size: 14px; }
.x-kbd { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 5px; border-radius: 4px; background: var(--x-hover); box-shadow: inset 0 0 0 1px var(--x-line); font-size: 11px; color: var(--x-mute); font-weight: 500; }
.x-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.x-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.x-chip--plain::before { display: none; }
.x-chip--green { background: var(--x-green-soft); color: var(--x-green); }
.x-chip--blue { background: var(--x-blue-soft); color: var(--x-blue); }
.x-chip--purple { background: var(--x-purple-soft); color: var(--x-purple); }
.x-chip--orange { background: var(--x-orange-soft); color: var(--x-orange); }
.x-chip--red { background: var(--x-red-soft); color: var(--x-red); }
.x-chip--yellow { background: var(--x-yellow-soft); color: var(--x-yellow); }
.x-chip--grey { background: var(--x-hover); color: var(--x-ink2); }
.x-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--x-r-xl); }
.x-ico--green { background: var(--x-green-soft); color: var(--x-green); }
.x-ico--blue { background: var(--x-blue-soft); color: var(--x-blue); }
.x-ico--purple { background: var(--x-purple-soft); color: var(--x-purple); }
.x-ico--orange { background: var(--x-orange-soft); color: var(--x-orange); }
.x-ico--red { background: var(--x-red-soft); color: var(--x-red); }
.x-ico--grey { background: var(--x-hover); color: var(--x-ink2); }
.x-seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--x-r-xl); background: #fff; box-shadow: 0 0 0 1px var(--x-ring); }
.x-seg span { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--x-r-lg); color: var(--x-mute); font-size: 13.5px; white-space: nowrap; }
.x-seg span.on { background: var(--x-active); color: var(--x-ink); font-weight: 500; }
.x-count { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--x-hover); font-size: 11px; color: var(--x-ink2); font-weight: 500; }
.x-h1 { font-size: 26px; font-weight: 500; letter-spacing: -.01em; }
.x-sub { color: var(--x-mute); font-size: 14px; }

/* stat cards */
.x-stats { display: grid; gap: 12px; }
.x-stat { padding: 16px 18px 18px; }
.x-stat__top { display: flex; align-items: center; gap: 12px; }
.x-stat__label { font-size: 15px; font-weight: 500; }
.x-stat__hint { font-size: 12.5px; color: var(--x-mute); }
.x-stat__num { margin-top: 14px; display: flex; align-items: baseline; gap: 6px; font-size: 32px; font-weight: 500; line-height: 1; }
.x-stat__num small { font-size: 13px; color: var(--x-mute); letter-spacing: 0; }
.x-delta { margin-inline-start: auto; align-self: center; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--x-green-soft); color: var(--x-green); font-weight: 500; letter-spacing: 0; }

/* tables */
.x-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.x-table th { text-align: start; font-weight: 400; color: var(--x-mute); font-size: 12.5px; padding: 10px 16px; background: oklch(0.985 0 0); border-bottom: 1px solid var(--x-line); white-space: nowrap; }
.x-table td { padding: 11px 16px; border-bottom: 1px solid var(--x-line); vertical-align: middle; white-space: nowrap; }
.x-table tr:last-child td { border-bottom: 0; }
.x-table .end { text-align: end; }
.x-table .item b { font-weight: 500; }
.x-table .item span { color: var(--x-mute); }
.x-cell { display: inline-grid; place-items: center; min-width: 48px; height: 32px; padding: 0 8px; border-radius: var(--x-r-lg); box-shadow: 0 0 0 1px var(--x-line); background: #fff; }

/* the app frame: sidebar + top bar + page */
.x-app { display: grid; grid-template-columns: 236px 1fr; gap: 8px; padding: 8px; height: 100%; }
.x-side { display: flex; flex-direction: column; padding: 12px 10px; background: #fff; border-radius: var(--x-r-2xl); box-shadow: 0 0 0 1px var(--x-ring); }
.x-brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px 10px; }
.x-brand__mark { width: 30px; height: 30px; border-radius: 7px; background: oklch(0.145 0 0); display: grid; place-items: center; }
.x-brand b { display: block; font-size: 14px; font-weight: 500; line-height: 1.2; }
.x-brand span { display: block; font-size: 11.5px; color: var(--x-mute); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-nav { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--x-r-lg); font-size: 14px; color: var(--x-ink2); }
.x-nav.on { background: var(--x-active); color: var(--x-ink); font-weight: 500; }
.x-nav--sell { background: var(--x-sell-soft); color: var(--x-green); box-shadow: inset 0 0 0 1px oklch(0.68 0.16 152 / 28%); font-weight: 500; margin: 2px 0; }
.x-nav .x-kbd { margin-inline-start: auto; background: oklch(0.68 0.16 152 / 15%); color: var(--x-green); box-shadow: none; }
.x-nav .badge { margin-inline-start: auto; font-size: 11.5px; color: var(--x-red); background: var(--x-red-soft); padding: 0 6px; border-radius: 4px; }
.x-group { margin: 10px 10px 4px; font-size: 11.5px; color: var(--x-mute); }
.x-rule { height: 1px; background: var(--x-line); margin: 8px 6px; }
.x-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 8px 6px 0; }
.x-avatar { width: 30px; height: 30px; border-radius: 7px; background: var(--x-hover); display: grid; place-items: center; font-size: 11px; font-weight: 500; color: var(--x-ink2); letter-spacing: .08em; }
.x-main { display: flex; flex-direction: column; min-width: 0; }
.x-top { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 4px 0; }
.x-tab { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; width: 170px; border-radius: var(--x-r-lg); background: #fff; box-shadow: 0 0 0 1px var(--x-ring); font-size: 13px; color: var(--x-ink2); }
.x-tab.on { background: var(--x-active); color: var(--x-ink); }
.x-tab .x { margin-inline-start: auto; }
.x-iconbtn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--x-r-lg); background: #fff; box-shadow: 0 0 0 1px var(--x-ring); color: var(--x-ink2); position: relative; }
.x-iconbtn .dot { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 18px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--x-red); color: #fff; font-size: 10px; display: grid; place-items: center; font-weight: 600; }
.x-page { flex: 1; padding: 14px 18px 0; overflow: hidden; }

/* the brief (dashboard) */
.x-brief { display: grid; grid-template-columns: repeat(4, 1fr); }
.x-brief > div { padding: 12px 16px 14px; border-inline-end: 1px solid var(--x-line); }
.x-brief > div:last-child { border-inline-end: 0; }
.x-brief h5 { margin: 0 0 8px; font-size: 12.5px; font-weight: 400; color: var(--x-mute); }
.x-brief p { margin: 0 0 7px; font-size: 13.5px; display: flex; gap: 7px; align-items: baseline; }
.x-brief p i { width: 6px; height: 6px; border-radius: 50%; background: var(--x-red); flex: none; transform: translateY(-1px); }
.x-brief small { display: block; font-size: 12px; color: var(--x-mute); margin: -5px 0 7px 13px; }
[dir="rtl"] .x-brief small { margin: -5px 13px 7px 0; }
.x-attn > div { display: flex; align-items: center; gap: 12px; padding: 9px 16px; font-size: 13.5px; }
.x-attn .x-ico { width: 30px; height: 30px; border-radius: 7px; }
.x-attn .x-count { margin-inline-start: auto; }

/* selling */
.x-line { display: flex; align-items: center; gap: 16px; padding: 14px 16px; }
.x-line .grow > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-pill { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--x-r-xl); background: var(--x-blue-soft); color: var(--x-blue); }
.x-units { display: flex; gap: 2px; padding: 3px; border-radius: var(--x-r-lg); background: var(--x-hover); }
.x-units span { display: grid; text-align: center; padding: 4px 12px; border-radius: var(--x-r); font-size: 13px; color: var(--x-mute); line-height: 1.25; }
.x-units span small { font-size: 11px; }
.x-units span.on { background: oklch(0.205 0 0); color: #fff; }
.x-qty { display: flex; align-items: center; gap: 6px; }
.x-qty .r { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 0 0 1px var(--x-line); background: #fff; }
.x-qty .v { display: grid; place-items: center; width: 46px; height: 34px; border-radius: var(--x-r-lg); box-shadow: 0 0 0 1px var(--x-line); background: #fff; }
.x-safe { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--x-r-xl); background: var(--x-green-soft); color: var(--x-green); box-shadow: inset 0 0 0 1px oklch(0.527 0.154 150 / 22%); font-size: 13.5px; }
.x-pay { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: var(--x-r-xl); background: var(--x-hover); }
.x-pay span { display: grid; justify-items: center; gap: 2px; padding: 7px 0; border-radius: var(--x-r-lg); font-size: 12.5px; color: var(--x-mute); }
.x-pay span.on { background: #fff; color: var(--x-ink); box-shadow: 0 0 0 1px var(--x-ring); }

/* phone screens */
.x-phone { padding: 22px 16px 0; height: 100%; display: flex; flex-direction: column; }
.x-phone h2 { margin: 18px 0 2px; font-size: 30px; font-weight: 500; line-height: 1.15; }
.x-hero { border-radius: 18px; background: oklch(0.18 0 0); color: #fff; padding: 18px 20px; margin-top: 16px; }
.x-hero .n { font-size: 40px; font-weight: 500; line-height: 1.1; }
.x-tabbar { margin-top: auto; display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px 0 18px; background: #fff; margin-inline: -16px; border-top: 1px solid var(--x-line); }
.x-tabbar span { display: grid; justify-items: center; gap: 3px; font-size: 11px; color: var(--x-mute); }
.x-tabbar span.on { color: var(--x-ink); }
.x-tabbar span.on svg { background: var(--x-active); border-radius: 12px; padding: 4px 10px; width: 44px; height: 30px; }

/* outside the hero and the phones, a screen has no backdrop of its own: its cards sit on the section */
.mock:not([data-mock="app"]):not([data-mock^="m-"]) .x { background: transparent; }
.mock:not([data-mock="app"]):not([data-mock^="m-"]) .x > div:first-child { padding: 0 !important; background: transparent !important; }
.crop.mock, .stack__panel figure .mock { background: none; box-shadow: none; border-radius: 0; overflow: visible; }

/* the hero's app can be used (data-live): the menu opens each screen */
.mock[data-live] .mock__in { pointer-events: auto; }
.mock[data-live] .x-nav.is-live, .mock[data-live] .x-iconbtn { cursor: pointer; transition: background .15s; }
.mock[data-live] .x-nav.is-live:not(.on):not(.x-nav--sell):hover { background: var(--x-hover); color: var(--x-ink); }
.mock[data-live] .x-nav--sell:hover { background: oklch(0.68 0.16 152 / 20%); }
.mock[data-live] .x-nav.is-off { opacity: .55; }
.mock[data-live] .x-page { transition: opacity .25s, transform .25s; }
.mock[data-live] .x-page:not(.is-in) { opacity: 0; transform: translateY(6px); }
.mock[data-live] .x-page > div[style*="padding"] { padding: 0 !important; }

/* the selling screen can be used */
.is-pos-live .x-units span, .is-pos-live .x-qty .r, .is-pos-live [data-p="del"], .is-pos-live .x-pay span, .is-pos-live [data-p="b500"], .is-pos-live [data-p="exact"] { cursor: pointer; transition: background .15s, color .15s; }
.is-pos-live .x-units span:not(.on):hover, .is-pos-live .x-pay span:not(.on):hover { color: var(--x-ink); }
.is-pos-live .x-qty .r:hover, .is-pos-live [data-p="b500"]:hover, .is-pos-live [data-p="exact"]:hover { background: var(--x-hover); }
.is-pos-live [data-p="del"]:hover { color: var(--x-red); }

/* everything that responds shows it */
.x .x-click { cursor: pointer; }
.x .x-stat.x-click { transition: box-shadow .15s; }
.x .x-stat.x-click:hover { box-shadow: 0 0 0 1px oklch(0 0 0 / 14%); }
.x .x-stat.x-picked { box-shadow: 0 0 0 2px oklch(0.205 0 0); }
.x th.x-click:hover, .x th.x-sorted { color: var(--x-ink); }
.x th.x-sorted::after { content: " ↓"; }
.x .x-search { all: unset; flex: 1; min-width: 0; color: var(--x-ink); font: inherit; font-size: 14px; }
.x .x-search::placeholder { color: var(--x-faint); }
.x .x-btn.x-click:hover { filter: brightness(.96); }
.x .x-chip.x-click:hover { filter: brightness(.95); }

/* the screen comes in (ui.js enter): parts rise and fade in one after another */
.mock.is-entering :is(.x-side, .x-top, .x-stat, .x-card, .x-line, .x-table tr, .x-input, .x-hero, .x-safe, .x-seg, .x-tabbar, .x-phone > h2, .x-phone > .x-sub) {
  opacity: 0; transform: translateY(12px);
  transition: opacity .5s cubic-bezier(.22, 1, .36, 1), transform .6s cubic-bezier(.22, 1, .36, 1);
  transition-delay: calc(var(--xi, 0) * 55ms);
}
.mock.is-entering.is-entered :is(.x-side, .x-top, .x-stat, .x-card, .x-line, .x-table tr, .x-input, .x-hero, .x-safe, .x-seg, .x-tabbar, .x-phone > h2, .x-phone > .x-sub) { opacity: 1; transform: none; }
.mock.is-entering .x-table tr { transform: translateY(6px); }
.mock.is-entering.is-entered .x-table tr { transform: none; }

/* numbers: tighter digits, and every number card's figure on one baseline (a long hint no longer pushes it down) */
.x .n { letter-spacing: .015em; }
.x-stat { display: flex; flex-direction: column; }
.x-stat__top > div { min-width: 0; }
.x-stat__hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-stat__num { margin-top: auto; padding-top: 14px; }
.x-stat__num .n { letter-spacing: 0; }

/* drug-interaction bar (as at the till) */
.x-ix { border-radius: var(--x-r-xl); overflow: hidden; }
.x-ix--red { background: var(--x-red-soft); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--x-red) 30%, transparent); }
.x-ix--orange { background: var(--x-orange-soft); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--x-orange) 30%, transparent); }
.x-ix__bar { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; font-size: 13px; font-weight: 600; }
.x-ix--red .x-ix__bar { color: var(--x-red); } .x-ix--orange .x-ix__bar { color: var(--x-orange); }
.x-ix__must { border-radius: 999px; background: var(--x-red); color: #fff; padding: 2px 8px; font-size: 11px; }
.x-ix__rows { display: grid; gap: 8px; padding: 8px; border-top: 1px solid oklch(0 0 0 / 5%); background: oklch(1 0 0 / 70%); }
.x-ix__row { border-radius: var(--x-r-lg); background: #fff; box-shadow: 0 0 0 1px var(--x-line); padding: 12px; font-size: 14px; }
.x-ix__ack { height: 30px; padding: 0 12px; font-size: 12px; }
.x-ix__done { display: inline-flex; align-items: center; gap: 4px; color: var(--x-green); font-size: 12px; font-weight: 500; height: 30px; }
