/* =========================================================
   التوأم للجملة — التصميم
   ========================================================= */
:root {
  --background: #ffffff;
  --foreground: #0a0a0a;
  --brand: #2563c9;
  --brand-deep: #0f2f63;
  --brand-light: #5790e6;
  --accent-teal: #0b6e97;
  --lime: #c2e029;
  --surface: #f4f4f4;
  --surface-card: #ffffff;
  --ink: #0a0a0a;
  --ink-soft: #717784;
  --ghost: #d7dae1;
  --hairline: #e6e8ec;
  --on-brand: #ffffff;
  --ok: #17915a;
  --warn: #b7791f;
  --danger: #d23f3f;

  --radius-card: 1.5rem;
  --radius-card-lg: 2rem;
  --radius-pill: 62.5rem;
  --radius-xl: 0.75rem;

  --ease-spring: cubic-bezier(.2, 1.25, .35, 1);
  --ease-soft: cubic-bezier(.22, 1, .36, 1);
  --ease-expo: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
@media (max-width: 1440px) { html { font-size: 15.5px; } }
@media (max-width: 640px)  { html { font-size: 15px; } }
body {
  min-height: 100vh;
  font-family: "Readex Pro", system-ui, sans-serif;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; color: inherit; background: none; border: 0; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--brand-light); outline-offset: 2px; }
.lat { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--ink-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hide { display: none !important; }

/* ---------- Loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--brand-deep); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem;
  transition: transform .85s var(--ease-io);
}
#loader.out { transform: translateY(-105%); }
.loader-mark { display: flex; align-items: center; gap: .6rem; font-size: 1.6rem; font-weight: 500; animation: rise .9s var(--ease-spring) both; }
.loader-mark .mark { width: 1.9rem; height: 1.9rem; }
.loader-track { width: 10rem; height: 1px; border-radius: var(--radius-pill); background: rgba(255,255,255,.2); overflow: hidden; }
.loader-fill { height: 100%; background: #fff; transform: scaleX(0); transform-origin: right; animation: fill 1.28s .12s var(--ease-io) forwards; }
@keyframes fill { to { transform: scaleX(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Reveal primitives ---------- */
.clip { display: inline-block; overflow: hidden; vertical-align: top; padding: .12em 0 .22em; margin: -.12em 0 -.22em; }
.clip > span { display: inline-block; transform: translateY(115%); opacity: 0; transition: transform 1.1s var(--ease-expo), opacity 1.1s var(--ease-expo); }
.rv .clip > span, .modal.open .clip > span { transform: none; opacity: 1; }
.iv { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease-soft), transform .9s var(--ease-spring); transition-delay: var(--d, 0ms); }
.iv.on { opacity: 1; transform: none; }
.quiet .clip > span, .quiet .iv { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .clip > span, .iv { transition: none !important; transform: none !important; opacity: 1 !important; }
}

/* ---------- Frame ---------- */
.frame { width: 100%; min-height: 100vh; padding: .5rem; overflow-x: clip; display: flex; flex-direction: column; }
@media (min-width: 640px) { .frame { padding: .75rem; } }

.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--brand-deep); color: #fff;
  border-radius: var(--radius-card-lg);
  padding-bottom: 4.5rem;
  flex-shrink: 0;
}
.hero-deco { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-deco::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(87,144,230,.45), transparent 60%),
    radial-gradient(40rem 26rem at 0% 110%, rgba(11,110,151,.55), transparent 60%),
    linear-gradient(to bottom, rgba(15,47,99,.2), rgba(15,47,99,.6));
}
.hero-deco::after {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 4rem 4rem;
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.ghost-word {
  position: absolute; left: -2%; bottom: -12%;
  font-size: 22vw; font-weight: 600; line-height: 1;
  color: rgba(255,255,255,.04); white-space: nowrap; user-select: none;
}

/* header */
.topbar { display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.25rem 0; font-size: .82rem; }
@media (min-width: 640px) { .topbar { padding: 1.75rem 2.5rem 0; } }
.tb-side { flex: 1; display: flex; align-items: center; gap: .75rem; min-width: 0; }
.tb-side.end { justify-content: flex-end; }
.brand { display: flex; align-items: center; gap: .55rem; font-size: 1.05rem; font-weight: 500; white-space: nowrap; }
.brand .mark { width: 1.45rem; height: 1.45rem; }
.burger {
  width: 2.6rem; height: 2.6rem; border-radius: var(--radius-pill); flex: none;
  display: grid; place-items: center; align-content: center; gap: 5px;
  background: rgba(255,255,255,.15); backdrop-filter: blur(10px);
  transition: background .25s;
}
.burger i { display: block; width: 1rem; height: 1.5px; background: #fff; border-radius: 2px; }
.glass-pill {
  display: inline-flex; align-items: center; gap: .45rem; max-width: 100%;
  border-radius: var(--radius-pill); padding: .5rem .95rem;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.15); backdrop-filter: blur(10px);
  color: #fff; font-size: .8rem; white-space: nowrap;
}
.glass-pill select { background: transparent; border: 0; color: #fff; outline: none; max-width: 11rem; cursor: pointer; }
.glass-pill select option { color: var(--ink); }
.glass-pill .dot { width: .45rem; height: .45rem; border-radius: 50%; background: var(--lime); flex: none; }
.user-pill { display: none; }
@media (max-width: 640px) {
  .topbar .brand span { display: none; }
  .topbar .brand .mark { width: 1.7rem; height: 1.7rem; }
  .glass-pill select { max-width: 8.5rem; }
}
.cart-fab {
  position: fixed; bottom: 1rem; inset-inline: 1rem; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--ink); color: #fff; border-radius: var(--radius-pill); padding: .9rem 1.3rem;
  box-shadow: 0 16px 40px rgba(15,47,99,.35); font-weight: 500; font-size: .92rem;
  transform: translateY(160%); transition: transform .5s var(--ease-spring);
}
.cart-fab.on { transform: none; }
@media (min-width: 1024px) { .cart-fab { display: none; } }
@media (min-width: 768px) { .user-pill { display: inline-flex; } }

.quicknav { display: none; gap: .35rem; justify-content: center; padding: 1.25rem 2.5rem 0; flex-wrap: wrap; }
@media (min-width: 1024px) { .quicknav { display: flex; } }
.quicknav a { padding: .45rem .95rem; border-radius: var(--radius-pill); font-size: .82rem; color: rgba(255,255,255,.75); transition: background .25s, color .25s; }
.quicknav a.on { background: #fff; color: var(--brand-deep); }

.hero-body { padding: 2.25rem 1.25rem 0; }
@media (min-width: 640px) { .hero-body { padding: 3rem 2.5rem 0; } }
.hero-grid { display: flex; flex-direction: column; gap: 1.5rem; }
@media (min-width: 900px) { .hero-grid { flex-direction: row; align-items: flex-end; justify-content: space-between; } }
.hero-title { font-size: clamp(2.5rem, 7vw, 6rem); font-weight: 500; line-height: 1.3; margin-top: .6rem; }
.hero-side { display: flex; flex-wrap: wrap; gap: .75rem; align-items: stretch; }

.glass {
  border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.1);
  border-radius: var(--radius-card); padding: .9rem 1rem;
  backdrop-filter: blur(14px); box-shadow: 0 12px 30px rgba(15,47,99,.22);
  color: #fff; min-width: 12rem;
}
.glass .g-label { font-size: .72rem; opacity: .75; }
.glass .g-value { font-size: 1.85rem; font-weight: 500; line-height: 1.15; margin-top: .2rem; }
.glass .g-sub { font-size: .72rem; opacity: .8; margin-top: .25rem; }
.glass .btn { margin-top: .7rem; }
.dots { display: flex; margin-top: .45rem; }
.dots i { width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 1px solid rgba(15,47,99,.4); margin-inline-start: -.45rem; }
.dots i:first-child { margin-inline-start: 0; }

/* content card that overlaps the hero */
.content {
  position: relative; z-index: 1; flex: 1;
  background: var(--background); border-radius: var(--radius-card-lg);
  margin-top: -2.5rem; padding: 2rem 1.1rem 4rem;
}
@media (min-width: 640px) { .content { padding: 2.5rem 2.5rem 5rem; } }

.foot {
  margin-top: .75rem; border-radius: var(--radius-card-lg); background: var(--brand-deep); color: rgba(255,255,255,.6);
  padding: 1.5rem 1.5rem; display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; justify-content: space-between; align-items: center; font-size: .82rem;
}
@media (min-width: 640px) { .foot { padding: 1.75rem 2.5rem; } }
.foot .brand { color: #fff; font-size: .95rem; }

/* ---------- Typography blocks ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .78rem; font-weight: 500; color: var(--ink-soft); }
.eyebrow::before { content: ""; width: .4rem; height: .4rem; border-radius: var(--radius-pill); background: var(--brand); flex: none; }
.eyebrow.light { color: rgba(255,255,255,.72); }
.eyebrow.light::before { background: var(--brand-light); }
.h2 { font-size: clamp(1.8rem, 3.6vw, 3rem); font-weight: 500; line-height: 1.1; margin-top: .6rem; letter-spacing: -.01em; }
.h3 { font-size: 1.2rem; font-weight: 500; }
.sec { margin-top: 3rem; }
.sec:first-child { margin-top: 0; }
.sec-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.5rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: var(--radius-pill); padding: .78rem 1.45rem;
  font-size: .88rem; font-weight: 500; white-space: nowrap; border: 1px solid transparent;
  transition: background .25s, color .25s, border-color .25s, opacity .2s, transform .35s var(--ease-spring);
}
.btn svg { width: 1rem; height: 1rem; flex: none; }
.btn svg.arr { transition: transform .4s var(--ease-spring); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-sm { padding: .5rem .95rem; font-size: .8rem; }
.btn-block { width: 100%; }
.btn-solid { background: var(--ink); color: #fff; }
.btn-brand { background: var(--brand); color: #fff; }
.btn-light { background: #fff; color: var(--brand-deep); }
.btn-glass { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.18); }
.btn-outline { border-color: var(--hairline); color: var(--ink); background: #fff; }
.btn-danger { background: #fdeeee; color: var(--danger); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }

.icon-btn {
  width: 2.4rem; height: 2.4rem; border-radius: var(--radius-pill); flex: none;
  display: grid; place-items: center; border: 1px solid var(--hairline); background: #fff; color: var(--ink);
  transition: background .25s, color .25s, border-color .25s;
}
.icon-btn svg { width: 1.05rem; height: 1.05rem; transition: transform .4s var(--ease-spring); }
.icon-btn.danger { color: var(--danger); }

@media (hover: hover) and (min-width: 769px) {
  .burger:hover { background: rgba(255,255,255,.25); }
  .quicknav a:hover:not(.on) { color: #fff; background: rgba(255,255,255,.1); }
  .btn:hover svg.arr { transform: translateX(-5px); }
  .btn-solid:hover { background: var(--brand-deep); }
  .btn-brand:hover { background: var(--brand-deep); }
  .btn-light:hover { background: var(--brand-light); color: #fff; }
  .btn-glass:hover { background: rgba(255,255,255,.25); }
  .btn-outline:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
  .btn-danger:hover { background: var(--danger); color: #fff; }
  .icon-btn:hover { border-color: var(--ink); }
  .icon-btn:hover svg { transform: scale(1.15); }
  .icon-btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
  .row-link:hover .go svg { transform: translateX(-8px); opacity: 1; }
  .row-link:hover .go { border-color: var(--ink); }
  .lift:hover { transform: translateY(-6px); }
  .pcard:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(15,47,99,.12); }
  .x-btn:hover { background: var(--hairline); }
  .x-btn:hover svg { transform: rotate(90deg); }
  .menu-links a:hover { color: var(--brand-light); }
  .menu-close:hover { background: rgba(255,255,255,.25); }
  .menu-close:hover svg { transform: rotate(90deg); }
}

/* ---------- Chips / segmented ---------- */
.chip { display: inline-flex; align-items: center; gap: .35rem; border-radius: var(--radius-pill); padding: .22rem .7rem; font-size: .74rem; font-weight: 500; background: var(--surface); color: var(--ink-soft); white-space: nowrap; }
.chip::before { content: ""; width: .38rem; height: .38rem; border-radius: 50%; background: currentColor; opacity: .85; }
.chip.blue { background: #e8f0fd; color: var(--brand); }
.chip.amber { background: #fdf4e1; color: var(--warn); }
.chip.green { background: #e4f5ec; color: var(--ok); }
.chip.red { background: #fdeeee; color: var(--danger); }
.chip.teal { background: #e2f1f7; color: var(--accent-teal); }
.chip.ink { background: var(--ink); color: #fff; }
.chip.plain::before { display: none; }

.seg { display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; border-radius: var(--radius-pill); background: var(--surface); }
.seg button { padding: .45rem 1rem; border-radius: var(--radius-pill); font-size: .8rem; color: var(--ink-soft); transition: background .25s, color .25s; }
.seg button.on { background: var(--ink); color: #fff; }

.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1.25rem; }
.toolbar .grow { flex: 1 1 14rem; }
.search { position: relative; }
.search svg { position: absolute; inset-inline-start: .9rem; top: 50%; transform: translateY(-50%); width: 1.05rem; height: 1.05rem; color: var(--ink-soft); pointer-events: none; }
.search .input { padding-inline-start: 2.5rem; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 1rem; }
.grid2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid2 .full { grid-column: 1 / -1; } }
.grid3 { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .grid3 { grid-template-columns: repeat(3, 1fr); } }
.field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.field > span { font-size: .75rem; font-weight: 500; color: var(--ink-soft); }
.input {
  width: 100%; min-width: 0; border-radius: var(--radius-xl); border: 1px solid var(--hairline); background: #fff;
  padding: .72rem .95rem; font-size: .92rem; transition: border-color .2s, box-shadow .2s;
}
.input:focus { outline: none; border-color: var(--brand-light); box-shadow: 0 0 0 3px rgba(87,144,230,.18); }
textarea.input { resize: vertical; min-height: 5rem; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23717784' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left .8rem center; background-size: 1rem; padding-inline-end: .95rem; padding-left: 2.3rem; }
.in-btn { display: flex; gap: .5rem; }
.in-btn .input { flex: 1; }
.sub-title { font-size: .82rem; font-weight: 500; color: var(--ink); margin-top: .5rem; display: flex; align-items: center; gap: .5rem; }
.sub-title::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .5rem; }
.hint { font-size: .78rem; color: var(--ink-soft); }
.check { display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--brand); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border-radius: var(--radius-card); padding: 1.4rem; }
.card.white { background: #fff; border: 1px solid var(--hairline); }
.cards { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .cards.c2 { grid-template-columns: 1fr 1fr; } .cards.c3 { grid-template-columns: repeat(3, 1fr); } }
.lift { transition: transform .45s var(--ease-spring); }

/* stats band */
.stats { background: var(--brand-deep); color: #fff; border-radius: var(--radius-card-lg); padding: 2rem 1.5rem; position: relative; overflow: hidden; }
@media (min-width: 640px) { .stats { padding: 2.5rem; } }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem 1.5rem; margin-top: 2rem; }
@media (min-width: 1024px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { border-top: 1px solid rgba(255,255,255,.2); padding-top: 1rem; }
.stat .v { font-size: clamp(1.7rem, 3.6vw, 3.2rem); font-weight: 500; line-height: 1.1; letter-spacing: -.01em; word-break: break-word; }
.stat .l { font-size: .84rem; color: rgba(255,255,255,.65); margin-top: .55rem; }
.stats.light { background: var(--surface); color: var(--ink); }
.stats.light .stat { border-color: var(--hairline); }
.stats.light .stat .l { color: var(--ink-soft); }

/* rows list (programs style) */
.rows { list-style: none; padding: 0; }
.rows > li { border-top: 1px solid var(--hairline); }
.rows > li:last-child { border-bottom: 1px solid var(--hairline); }
.row-link { display: flex; align-items: center; gap: 1.1rem; padding: 1.15rem 0; width: 100%; text-align: start; }
.row-link .idx { width: 2.3rem; flex: none; font-size: .85rem; font-weight: 500; color: var(--ink-soft); }
.row-link .main { flex: 1; min-width: 0; }
.row-link .name { font-size: 1.12rem; font-weight: 500; line-height: 1.35; }
.row-link .desc { font-size: .84rem; color: var(--ink-soft); margin-top: .15rem; display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.row-link .end { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; flex: none; text-align: end; }
.row-link .amount { font-weight: 500; }
.row-link .go { width: 2.6rem; height: 2.6rem; border-radius: var(--radius-pill); border: 1px solid var(--hairline); display: grid; place-items: center; flex: none; transition: border-color .3s; }
.row-link .go svg { width: 1.1rem; height: 1.1rem; opacity: .55; transition: transform .4s var(--ease-spring), opacity .3s; }
.rows.big .name { font-size: clamp(1.3rem, 2.4vw, 1.8rem); }
@media (max-width: 640px) { .row-link .go { display: none; } .row-link .idx { width: auto; } }

/* tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius-card); background: #fff; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .87rem; }
.tbl th { text-align: start; font-weight: 500; font-size: .74rem; color: var(--ink-soft); padding: .85rem 1rem; background: var(--surface); white-space: nowrap; }
.tbl td { padding: .8rem 1rem; border-top: 1px solid var(--hairline); vertical-align: middle; }
.tbl tr.click { cursor: pointer; transition: background .2s; }
.tbl tr.click:hover td { background: #f8f9fb; }
.tbl .num { white-space: nowrap; }
.tbl .acts { display: flex; gap: .35rem; justify-content: flex-end; }
.tbl tfoot td { background: var(--surface); font-weight: 500; }
.low { color: var(--danger); font-weight: 500; }

.empty { padding: 2.5rem 1rem; text-align: center; color: var(--ink-soft); background: var(--surface); border-radius: var(--radius-card); font-size: .9rem; }
.empty.sm { padding: 1.5rem 1rem; }
.loading { display: grid; place-items: center; min-height: 14rem; }
.loading span { width: 2rem; height: 2rem; border-radius: 50%; border: 2px solid var(--hairline); border-top-color: var(--brand); animation: spin .8s linear infinite; }

/* key/value lines */
.kv { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1.25rem; font-size: .9rem; }
.kv dt { color: var(--ink-soft); }
.kv dd { font-weight: 500; }
.totline { display: flex; justify-content: space-between; align-items: baseline; padding: .4rem 0; font-size: .9rem; }
.totline.big { font-size: 1.25rem; font-weight: 500; border-top: 1px solid var(--hairline); margin-top: .35rem; padding-top: .75rem; }

/* ---------- POS ---------- */
.pos { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .pos { grid-template-columns: 1fr 25rem; align-items: start; } .pos-cart { position: sticky; top: 1rem; } }
.scanbar { display: flex; gap: .5rem; }
.scanbar .search { flex: 1; }
.scanbar .input { font-size: 1rem; padding-top: .9rem; padding-bottom: .9rem; border-radius: var(--radius-card); }
.pgrid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); margin-top: 1.25rem; }
.pcard { text-align: start; background: var(--surface); border-radius: var(--radius-card); padding: 1rem; display: flex; flex-direction: column; gap: .35rem; min-height: 7.5rem; transition: transform .45s var(--ease-spring), box-shadow .3s; }
.pcard b { font-weight: 500; font-size: .92rem; line-height: 1.35; }
.pcard .pp { margin-top: auto; font-weight: 500; color: var(--brand); }
.pcard small { color: var(--ink-soft); font-size: .74rem; }
.pcard.out { opacity: .45; }
.cart-lines { display: flex; flex-direction: column; margin: 1rem 0; max-height: 46vh; overflow-y: auto; }
.cl { display: grid; grid-template-columns: 1fr auto; gap: .4rem .75rem; padding: .8rem 0; border-top: 1px solid var(--hairline); align-items: center; }
.cl:first-child { border-top: 0; }
.cl-name { font-size: .9rem; font-weight: 500; line-height: 1.35; }
.cl-price { font-size: .76rem; color: var(--ink-soft); display: flex; align-items: center; gap: .35rem; }
.cl-row2 { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.qty { display: inline-flex; align-items: center; background: #fff; border: 1px solid var(--hairline); border-radius: var(--radius-pill); }
.qty button { width: 2rem; height: 2rem; display: grid; place-items: center; font-size: 1.1rem; }
.qty input { width: 3.2rem; text-align: center; border: 0; background: transparent; outline: none; font-size: .9rem; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.mini-in { width: 5.5rem; border: 1px solid var(--hairline); border-radius: .5rem; padding: .2rem .4rem; font-size: .78rem; background: #fff; }
.cl .rm { color: var(--ink-soft); width: 1.8rem; height: 1.8rem; display: grid; place-items: center; border-radius: 50%; }
.cl .rm svg { width: .95rem; height: .95rem; }
.cl .rm:hover { background: #fdeeee; color: var(--danger); }

/* picker (search dropdown) */
.picker { position: relative; }
.pk-list { position: absolute; inset-inline: 0; top: calc(100% + .35rem); z-index: 5; background: #fff; border: 1px solid var(--hairline); border-radius: var(--radius-xl); box-shadow: 0 18px 40px rgba(15,47,99,.15); overflow: hidden; max-height: 16rem; overflow-y: auto; }
.pk-list:empty { display: none; }
.pk-item { display: flex; justify-content: space-between; gap: 1rem; width: 100%; padding: .7rem .95rem; text-align: start; font-size: .88rem; border-top: 1px solid var(--hairline); }
.pk-item:first-child { border-top: 0; }
.pk-item:hover, .pk-item:focus { background: var(--surface); outline: none; }
.pk-item small { color: var(--ink-soft); white-space: nowrap; }
.pk-empty { padding: .8rem 1rem; color: var(--ink-soft); font-size: .85rem; }

.lines { display: flex; flex-direction: column; gap: .5rem; }
.line { display: grid; grid-template-columns: 1fr auto auto auto; gap: .6rem; align-items: center; background: var(--surface); border-radius: var(--radius-xl); padding: .55rem .75rem; font-size: .88rem; }
.line input { width: 5rem; border: 1px solid var(--hairline); border-radius: .55rem; padding: .35rem .5rem; background: #fff; font-size: .85rem; }

/* scanner */
.scan-box { width: 100%; border-radius: var(--radius-card); overflow: hidden; background: #000; min-height: 16rem; }
.scan-box video { width: 100% !important; height: auto !important; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; padding: .6rem; }
@media (min-width: 640px) { .modal { align-items: center; padding: 1.5rem; } }
.modal-bg { position: absolute; inset: 0; background: rgba(15,47,99,.4); backdrop-filter: blur(6px); opacity: 0; transition: opacity .4s; }
.modal.open .modal-bg { opacity: 1; }
.panel {
  position: relative; width: 100%; max-width: 34rem; max-height: 92svh; overflow-y: auto;
  background: var(--surface-card); color: var(--ink); border-radius: var(--radius-card-lg);
  padding: 1.5rem; box-shadow: 0 30px 90px rgba(15,47,99,.35);
  opacity: 0; transform: translateY(28px) scale(.96);
  transition: opacity .4s var(--ease-soft), transform .6s var(--ease-spring);
}
@media (min-width: 640px) { .panel { padding: 2rem; } }
.panel.wide { max-width: 58rem; }
.modal.open .panel { opacity: 1; transform: none; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.panel-title { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 500; line-height: 1.12; margin-top: .55rem; }
.x-btn { width: 2.5rem; height: 2.5rem; border-radius: var(--radius-pill); background: var(--surface); display: grid; place-items: center; flex: none; transition: background .25s; }
.x-btn svg { width: 1.15rem; height: 1.15rem; transition: transform .45s var(--ease-spring); }
.success { text-align: center; padding: 1rem 0 .5rem; }
.success .ok-dot { width: 3.2rem; height: 3.2rem; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; margin: 0 auto 1rem; }
.success .ok-dot svg { width: 1.5rem; height: 1.5rem; }

/* ---------- Menu overlay ---------- */
.menu { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.menu.open { pointer-events: auto; }
.menu-bg { position: absolute; inset: 0; background: var(--brand-deep); opacity: 0; transition: opacity .45s; }
.menu.open .menu-bg { opacity: 1; }
.menu-panel {
  position: relative; height: 100%; display: flex; flex-direction: column; color: #fff;
  padding: calc(.5rem + 1.25rem) calc(.5rem + 1.25rem) calc(.5rem + 1.25rem);
  opacity: 0; transform: translateY(-24px); transition: opacity .4s var(--ease-soft), transform .6s var(--ease-spring);
}
@media (min-width: 640px) { .menu-panel { padding: calc(.75rem + 1.75rem) calc(.75rem + 2.5rem) calc(.75rem + 2rem); } }
.menu.open .menu-panel { opacity: 1; transform: none; }
.menu-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.menu-close { width: 2.6rem; height: 2.6rem; border-radius: var(--radius-pill); background: rgba(255,255,255,.15); display: grid; place-items: center; transition: background .25s; }
.menu-close svg { width: 1.15rem; height: 1.15rem; transition: transform .45s var(--ease-spring); }
.menu-links { flex: 1; display: grid; align-content: center; gap: .1rem 3rem; overflow-y: auto; padding: 1.5rem 0; }
@media (min-width: 900px) { .menu-links { grid-template-columns: 1fr 1fr; } }
.menu-links a {
  display: flex; align-items: baseline; gap: .9rem; font-size: clamp(1.7rem, 4.2vw, 3.2rem); font-weight: 500; line-height: 1.3;
  opacity: 0; transform: translateY(28px); transition: opacity .6s var(--ease-soft), transform .8s var(--ease-spring), color .25s;
}
.menu-links a small { font-size: .8rem; color: rgba(255,255,255,.45); font-weight: 400; min-width: 1.5rem; }
.menu.open .menu-links a { opacity: 1; transform: none; }
.menu-links a.on { color: var(--brand-light); }
.menu-bottom { border-top: 1px solid rgba(255,255,255,.15); padding-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.menu-bottom .who { font-size: .88rem; color: rgba(255,255,255,.75); }

/* ---------- Auth screens ---------- */
.auth { min-height: calc(100svh - 1rem); display: flex; flex-direction: column; padding-bottom: 2rem; }
@media (min-width: 640px) { .auth { min-height: calc(100svh - 1.5rem); padding-bottom: 2.5rem; } }
.auth .hero-body { flex: 1; display: flex; flex-direction: column; }
.auth-grid { margin-top: auto; display: flex; flex-direction: column; gap: 2rem; }
@media (min-width: 900px) { .auth-grid { flex-direction: row; align-items: flex-end; justify-content: space-between; } }
.auth-title { font-size: clamp(3rem, 10vw, 9rem); font-weight: 500; line-height: 1.3; }
.auth-tag { font-size: clamp(1.3rem, 2.6vw, 2.2rem); font-weight: 500; line-height: 1.2; color: rgba(255,255,255,.85); margin-top: 1rem; }
.auth-card { width: 100%; max-width: 24rem; padding: 1.4rem; }
.auth-card .field > span { color: rgba(255,255,255,.75); }
.auth-card .input { background: rgba(255,255,255,.95); color: var(--ink); caret-color: var(--ink); }
.auth-card .input::placeholder { color: var(--ink-soft); }
.auth-card .input:-webkit-autofill { -webkit-text-fill-color: var(--ink); -webkit-box-shadow: 0 0 0 100px #fff inset; }
.auth-card .note { font-size: .8rem; background: rgba(255,255,255,.12); border-radius: var(--radius-xl); padding: .6rem .8rem; margin-bottom: 1rem; }
.auth-card .note.err { background: rgba(210,63,63,.3); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: .5rem; align-items: center; width: max-content; max-width: calc(100vw - 2rem); pointer-events: none; }
.toast { background: var(--brand-deep); color: #fff; border-radius: var(--radius-pill); padding: .75rem 1.3rem; font-size: .88rem; box-shadow: 0 16px 40px rgba(15,47,99,.3); opacity: 0; transform: translateY(16px) scale(.96); transition: opacity .3s, transform .5s var(--ease-spring); display: flex; align-items: center; gap: .55rem; }
.toast::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--lime); flex: none; }
.toast.err { background: var(--danger); }
.toast.err::before { background: #fff; }
.toast.on { opacity: 1; transform: none; }

/* ---------- Print ---------- */
#print-area { display: none; }
@media print {
  @page { margin: 6mm; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; color: #000; font-size: 12px; }
  .rc { max-width: 80mm; margin: 0 auto; }
  .rc h1 { font-size: 18px; text-align: center; margin-bottom: 2px; }
  .rc .c { text-align: center; }
  .rc table { width: 100%; border-collapse: collapse; margin: 8px 0; }
  .rc th, .rc td { padding: 3px 2px; text-align: right; border-bottom: 1px dashed #999; }
  .rc .t { display: flex; justify-content: space-between; padding: 2px 0; }
  .rc .t.b { font-weight: 700; font-size: 14px; border-top: 1px solid #000; margin-top: 4px; padding-top: 4px; }
  .rc hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
}
