/* The pharmacy portal (pharmacy.axion-rx.com): the owner's and the managers' screens, as in the phone app. Black and
   white like the program; colour only for a state. */
@font-face { font-family: "AxionArabic"; src: url("/admin/fonts/PPNeueMontrealArabic-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "AxionArabic"; src: url("/admin/fonts/PPNeueMontrealArabic-Medium.otf") format("opentype"); font-weight: 500 700; font-display: swap; }
:root {
  --bg: #f6f6f7; --card: #fff; --ink: #0f0f10; --ink-2: #3a3a40; --mute: #707078; --line: #e8e8ec; --hover: #f4f4f6; --chip-on: #ececef;
  --green: #15803d; --red: #c62828; --orange: #c2410c; --yellow: #a16207; --blue: #1d4ed8; --purple: #6d28d9;
  --r: 18px; --r-sm: 12px;
  --shadow: 0 1px 2px #0f0f100a, 0 0 0 1px var(--line);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 "AxionArabic", "Segoe UI", Tahoma, system-ui, sans-serif; }
button, input { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }
.mute { color: var(--mute); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.loading { text-align: center; color: var(--mute); padding: 30vh 0; margin: 0; }

/* tones */
.t-green { color: var(--green); } .t-red { color: var(--red); } .t-orange { color: var(--orange); } .t-yellow { color: var(--yellow); }
.t-blue { color: var(--blue); } .t-purple { color: var(--purple); } .t-muted { color: var(--mute); }

/* controls */
.btn { border: 0; border-radius: var(--r-sm); padding: 10px 18px; min-height: 44px; cursor: pointer; background: var(--ink); color: #fff; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { background: #2a2a2e; }
.btn:disabled { opacity: .5; cursor: default; }
.btn--light { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn--light:hover { background: var(--hover); }
.btn--danger { background: #fdecec; color: var(--red); }
.btn--sm { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn--block { width: 100%; }
.field { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.field input { border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--r-sm); background: #fff; padding: 11px 14px; min-height: 48px; font-size: 16px; color: var(--ink); }
.field input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--ink); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.err { color: var(--red); min-height: 1.4em; margin: 0; font-size: 14px; }
.chip { border: 0; background: #fff; box-shadow: inset 0 0 0 1px var(--line); border-radius: 10px; padding: 6px 14px; min-height: 36px; cursor: pointer; white-space: nowrap; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { background: var(--hover); }
.chip.on { background: var(--chip-on); box-shadow: inset 0 0 0 1px #0f0f102e; font-weight: 700; }

/* the sign-in and «اختار كلمة السر» */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate__card { width: 100%; max-width: 400px; background: var(--card); border-radius: 24px; box-shadow: var(--shadow); padding: 32px 28px; display: grid; gap: 16px; }
.brand { font-weight: 700; letter-spacing: .01em; color: var(--mute); font-size: 14px; }
.gate h1 { margin: 0; font-size: 26px; line-height: 1.3; }
.gate p { margin: 0; color: var(--mute); font-size: 14px; }
.rules { margin: 0; padding-inline-start: 18px; color: var(--mute); font-size: 13px; }

/* the app: the name and the branch at the top; the screens in a side list (on a phone, a menu that slides in) */
.top { position: sticky; top: 0; z-index: 5; background: #f6f6f7ee; backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top__in { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 12px; }
.top__name { flex: 1; min-width: 0; }
.top__name b { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__name span { color: var(--mute); font-size: 13px; }
.top__acts { display: flex; gap: 6px; }
.pick { position: relative; display: inline-flex; align-items: center; gap: 8px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); border-radius: 12px; padding: 0 12px; min-height: 40px; max-width: 280px; cursor: pointer; }
.pick:hover { background: var(--hover); }
.pick select { appearance: none; border: 0; background: none; font: inherit; font-weight: 500; color: var(--ink); min-height: 38px; padding-inline-end: 4px; cursor: pointer; min-width: 0; text-overflow: ellipsis; }
.pick select:focus { outline: none; }
.pick:focus-within { box-shadow: inset 0 0 0 2px var(--ink); }
.pick svg { color: var(--mute); width: 16px; height: 16px; }
.pick--one { cursor: default; font-weight: 500; white-space: nowrap; overflow: hidden; }
.pick--one:hover { background: #fff; }
.shell { max-width: 1180px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-start; }
.side { position: sticky; top: 72px; flex: none; width: 210px; padding: 20px 12px 20px 0; display: grid; gap: 2px; }
.side__item { border: 0; background: none; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); cursor: pointer; text-align: start; font-size: 15px; }
.side__item:hover { background: #ececef; color: var(--ink); }
.side__item.on { background: #fff; color: var(--ink); font-weight: 700; box-shadow: var(--shadow); }
.side__item svg { color: var(--mute); }
.side__item.on svg { color: var(--ink); }
.top__menu, .side__close, .scrim { display: none; }
.page { flex: 1; min-width: 0; max-width: 860px; margin: 0; padding: 20px 20px 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.head h1 { margin: 0; font-size: 28px; line-height: 1.25; }
.head p { margin: 2px 0 0; color: var(--mute); }
.back { border: 0; background: none; color: var(--mute); cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.back:hover { color: var(--ink); }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.stale { background: #fdf2e0; color: #8a4b00; border-radius: var(--r-sm); padding: 10px 14px; font-size: 14px; }

/* blocks (the same as the phone: src/app/api/phone/_screens/blocks.ts) */
.hero { padding: 22px 24px; }
.hero.link { cursor: pointer; } .hero.link:hover { background: #fcfcfd; }
.hero__label { color: var(--ink-2); }
.hero__value { font-size: 52px; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; }
.hero__value small { font-size: 18px; color: var(--mute); font-weight: 400; margin-inline-start: 6px; }
.hero__sub { color: var(--mute); }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.figure { padding: 16px 18px; }
.figure__label { color: var(--ink-2); font-size: 14px; }
.figure__value { font-size: 24px; font-weight: 700; line-height: 1.3; }
.figure__sub { color: var(--mute); font-size: 13px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.section h2 { margin: 6px 4px 8px; font-size: 15px; color: var(--ink-2); font-weight: 500; }
.rows { overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row.link { cursor: pointer; } .row.link:hover { background: var(--hover); }
.row__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #f1f1f4; font-weight: 700; font-size: 14px; flex: none; }
.row__icon.t-green { background: #e8f6ee; } .row__icon.t-red { background: #fdecec; } .row__icon.t-orange { background: #fff1e6; }
.row__icon.t-blue { background: #e9effe; } .row__icon.t-purple { background: #f1ebfe; } .row__icon.t-yellow { background: #fdf6e0; }
.row__main { flex: 1; min-width: 0; }
.row__title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__title.bold { font-weight: 700; }
.row__badge { font-size: 12px; margin-inline-start: 6px; font-weight: 500; }
.row__sub { color: var(--mute); font-size: 13px; }
.row__value { text-align: end; flex: none; }
.row__value b { display: block; font-size: 15px; }
.row__value s { color: var(--mute); }
.row__value span { font-size: 12px; color: var(--mute); }
.row__go { color: var(--mute); }
.note { color: var(--mute); text-align: center; font-size: 14px; margin: 0; }
.empty { padding: 28px; text-align: center; }
.empty b { display: block; font-size: 16px; }
.empty span { color: var(--mute); }
.bars { padding: 18px; }
.bars h2 { margin: 0 0 12px; font-size: 15px; }
.bars__plot { display: flex; align-items: flex-end; gap: 6px; height: 160px; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars__bar { width: 100%; max-width: 44px; background: var(--ink); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bars__label { font-size: 11px; color: var(--mute); white-space: nowrap; }
.person { padding: 16px 18px; display: grid; gap: 10px; }
.person__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.person__top b { font-size: 16px; }
.person__metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.person__metrics div { background: #f6f6f7; border-radius: 10px; padding: 8px 10px; }
.person__metrics span { display: block; color: var(--mute); font-size: 12px; }
.person__metrics b { font-size: 16px; }
.person__foot { display: flex; justify-content: space-between; color: var(--mute); font-size: 13px; }
.person__foot b { color: var(--ink); font-size: 18px; }

/* «الأصناف», «المديرين», «حسابي» */
.search { display: flex; align-items: center; gap: 10px; padding: 0 16px; min-height: 52px; }
.search input { flex: 1; border: 0; outline: none; background: none; font-size: 16px; min-height: 50px; }
.list-card { padding: 4px 0; }
.list-card h3 { margin: 12px 16px 2px; font-size: 16px; }
.form { padding: 20px; display: grid; gap: 14px; max-width: 460px; }
.code { font-family: Consolas, ui-monospace, monospace; font-size: 22px; letter-spacing: .06em; direction: ltr; background: #f6f6f7; border-radius: 12px; padding: 14px; text-align: center; user-select: all; }

.toast { position: fixed; inset-inline: 0; bottom: 24px; margin: 0 auto; width: max-content; max-width: calc(100% - 32px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 14px; z-index: 20; }
.modal { position: fixed; inset: 0; background: #0f0f1066; display: grid; place-items: center; padding: 16px; z-index: 15; }
.modal__box { background: #fff; border-radius: 20px; max-width: 420px; width: 100%; padding: 24px; display: grid; gap: 14px; }
.modal__box h2 { margin: 0; font-size: 20px; }
.modal__box p { margin: 0; color: var(--ink-2); font-size: 14px; }
.modal__actions { display: flex; gap: 8px; justify-content: flex-start; flex-wrap: wrap; }

/* «النواقص»: pick, how many, send */
.order { display: grid; gap: 8px; }
.order__row { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 4px; }
.order__row.on { box-shadow: 0 0 0 1.5px #0f0f1066; }
.order__pick { width: 100%; border: 0; background: none; display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; text-align: start; cursor: pointer; border-radius: 12px; }
.order__pick:hover { background: var(--hover); }
.order__pick .row__sub { display: block; }
.box { width: 22px; height: 22px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px #0f0f1040; display: grid; place-items: center; flex: none; margin-top: 2px; }
.box svg { width: 15px; height: 15px; stroke-width: 2.4; }
.order__row.on .box { background: var(--chip-on); box-shadow: inset 0 0 0 1.5px #0f0f104d; }
.order__qty { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 12px 10px 12px; padding-inline-start: 46px; }
.stepper { display: flex; align-items: center; gap: 2px; background: #f1f1f4; border-radius: 12px; padding: 3px; }
.stepper button { border: 0; width: 36px; height: 36px; border-radius: 9px; background: #fff; display: grid; place-items: center; cursor: pointer; }
.stepper button:hover { background: var(--hover); }
.stepper input { width: 56px; border: 0; background: none; text-align: center; font-weight: 700; font-size: 17px; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.order__bar { margin-top: 4px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 12px 14px; }
.order__sup { min-width: 0; width: 38%; flex: none; border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 10px; background: #fff; min-height: 40px; padding: 0 10px; max-width: 220px; font: inherit; }
.order__sum { flex: 1 0 auto; display: grid; line-height: 1.3; white-space: nowrap; }
.order__sum span { font-size: 12px; }
.order__sum b { font-size: 17px; }
.name-input { flex: 1; min-width: 0; border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 10px; padding: 8px 12px; min-height: 40px; font: inherit; }
.name-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--ink); }

/* a phone: the side list becomes a menu that slides in from the side */
@media (max-width: 760px) {
  .page { padding: 16px 14px 48px; }
  .top__in { flex-wrap: wrap; padding: 10px 14px; row-gap: 8px; }
  .top__menu { display: inline-flex; }
  .pick { order: 3; flex-basis: 100%; max-width: none; }
  .pick select { flex: 1; }
  .side { display: none; position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 12; width: min(290px, 84vw); background: #fff; padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); align-content: start; overflow-y: auto; box-shadow: 0 0 40px #0f0f1033; }
  .side.open { display: grid; }
  .side__close { display: inline-flex; justify-self: end; margin-bottom: 8px; }
  .side__item { padding: 12px; font-size: 16px; }
  .side__item.on { background: #f1f1f4; box-shadow: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 11; background: #0f0f1059; }
  .scrim[hidden] { display: none; }
  .order__sup { width: 100%; max-width: none; flex: 1 1 100%; }
  .modal { place-items: end center; padding: 0; }
  .modal__box { border-radius: 22px 22px 0 0; max-width: none; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) {
  .hero__value { font-size: 40px; }
  .gate__card { padding: 26px 20px; }
}
