/* ═══════════════════════════════════════════════════════════
   AVORA — أفورا
   One stylesheet for the customer site and the admin dashboard.
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Brand palette (approved) */
  --dark: #4E342E;
  --brown: #8D6E63;
  --beige: #D7B899;
  --cream: #F5EEE6;
  --gold: #C9A96A;

  /* Derived */
  --ink: #2E201B;
  --ink-soft: #6B5A52;
  --paper: #FBF8F4;
  --line: rgba(78, 52, 46, .14);
  --line-strong: rgba(78, 52, 46, .26);
  --gold-deep: #A8873F;
  --ok: #4E7D5B;
  --warn: #B7791F;
  --danger: #A23B3B;

  --font-body: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --font-display: 'Amiri', 'Cormorant Garamond', Georgia, serif;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(46, 32, 27, .05), 0 8px 24px rgba(46, 32, 27, .07);
  --shadow-lg: 0 24px 60px rgba(46, 32, 27, .18);
  --header-h: 68px;
  --maxw: 1180px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* Omani pointed arch used as an image mask */
  --arch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 120' preserveAspectRatio='none'%3E%3Cpath d='M0 120V52C0 26 22 12 50 0C78 12 100 26 100 52V120Z'/%3E%3C/svg%3E");
}

html[lang="en"] { --font-display: 'Cormorant Garamond', 'Amiri', Georgia, serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; unicode-bidi: isolate; }
span.num, b.num, strong.num, a.num, em.num, small.num, output.num, s.num { direction: ltr; display: inline-block; }
.money { font-variant-numeric: tabular-nums; unicode-bidi: isolate; white-space: nowrap; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 760px) { .container { padding-inline: 28px; } }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 46px; padding: 0 22px;
  border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 600; font-size: .98rem; text-decoration: none; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s, transform .15s var(--ease), box-shadow .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--dark); color: var(--cream); }
.btn-primary:hover { background: #3c2723; box-shadow: 0 6px 18px rgba(78, 52, 46, .25); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #d4b67b; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--dark); }
.btn-ghost:hover { border-color: var(--dark); background: rgba(78, 52, 46, .04); }
.btn-light { background: transparent; border-color: rgba(245, 238, 230, .45); color: var(--cream); }
.btn-light:hover { border-color: var(--cream); }
.btn-danger { background: transparent; border-color: rgba(162, 59, 59, .4); color: var(--danger); }
.btn-danger:hover { background: rgba(162, 59, 59, .07); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .88rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn .spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px;
  border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--dark);
  transition: background .2s;
}
.icon-btn:hover { background: rgba(78, 52, 46, .06); }
.icon-btn svg { width: 20px; height: 20px; }

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 248, 244, .86);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.site-header.scrolled { border-color: var(--line); box-shadow: 0 6px 20px rgba(46, 32, 27, .05); }
.site-header .bar { height: var(--header-h); display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.brand { gap: 10px; }
.brand .emblem { height: 50px; width: auto; }
@media (max-width: 480px) { .brand .emblem { height: 38px; } .brand { gap: 6px; } .brand-text { font-size: 1.15rem; } .brand-text small { letter-spacing: .3em; } }
.brand-text { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; color: var(--dark); font-size: 1.32rem; letter-spacing: .08em; line-height: 1; direction: ltr; display: flex; flex-direction: column; align-items: center; }
.brand-text small { font-size: .62rem; letter-spacing: .42em; font-weight: 600; color: var(--brown); margin-top: 3px; padding-left: .42em; }
@media (max-width: 380px) { .brand-text { display: none; } }
.nav { display: none; gap: 4px; margin-inline-start: 28px; }
.nav a {
  position: relative; padding: 8px 14px; border-radius: 999px;
  text-decoration: none; color: var(--ink-soft); font-weight: 500; font-size: .96rem;
  transition: color .2s, background .2s;
}
.nav a:hover { color: var(--dark); background: rgba(78, 52, 46, .05); }
.nav a[aria-current="page"] { color: var(--dark); }
.nav a[aria-current="page"]::after {
  content: ''; position: absolute; inset-inline: 40%; bottom: 2px; height: 2px; border-radius: 2px; background: var(--gold);
}
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.lang-btn {
  min-height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--dark);
  font-weight: 600; font-size: .88rem;
}
html[lang="ar"] .lang-btn { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1rem; letter-spacing: .02em; }
.lang-btn:hover { border-color: var(--dark); }
.cart-btn { position: relative; }
.cart-count {
  position: absolute; top: -4px; inset-inline-end: -4px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--gold); color: var(--ink); font-size: .72rem; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}
.menu-toggle { display: inline-grid; }
.mobile-nav {
  display: grid; gap: 2px; padding: 8px 16px 16px;
  border-top: 1px solid var(--line); background: var(--paper);
}
.mobile-nav a { padding: 12px 8px; text-decoration: none; font-weight: 500; border-radius: 10px; }
.mobile-nav a[aria-current="page"] { color: var(--gold-deep); }
@media (min-width: 860px) {
  .nav { display: flex; }
  .menu-toggle, .mobile-nav { display: none !important; }
}

/* ── Section scaffolding ─────────────────────────────────── */
.section { padding-block: 72px; }
@media (min-width: 900px) { .section { padding-block: 104px; } }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 44px; }
.ornament { display: inline-flex; align-items: center; gap: 10px; color: var(--gold); margin-bottom: 10px; }
.ornament::before, .ornament::after { content: ''; width: 38px; height: 1px; background: currentColor; }
.ornament i { width: 7px; height: 7px; background: currentColor; transform: rotate(45deg); display: block; }
.h-display {
  font-family: var(--font-display); font-weight: 700; color: var(--dark);
  font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.25; margin: 0;
}
html[lang="en"] .h-display { font-weight: 600; letter-spacing: -.01em; }
.lead { color: var(--ink-soft); font-size: 1.06rem; margin: 10px 0 0; }
.kicker { font-size: .86rem; font-weight: 600; letter-spacing: .04em; color: var(--gold-deep); }
html[lang="en"] .kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .76rem; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ── Hero ────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; padding-block: 40px 88px; }
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 85% 20%, rgba(215, 184, 153, .35), transparent 70%),
    radial-gradient(50% 40% at 10% 90%, rgba(201, 169, 106, .14), transparent 70%);
  pointer-events: none;
}
.hero .container { position: relative; display: grid; gap: 40px; align-items: center; }
.hero h1 {
  font-family: var(--font-display); color: var(--dark); font-weight: 700;
  font-size: clamp(2.3rem, 6vw, 3.9rem); line-height: 1.25; margin: 14px 0 18px;
}
html[lang="en"] .hero h1 { font-weight: 600; line-height: 1.05; letter-spacing: -.015em; }
.hero p { color: var(--ink-soft); font-size: 1.08rem; max-width: 34em; margin: 0 0 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-visual { position: relative; justify-self: center; width: min(100%, 440px); }
.arch-frame {
  position: relative; aspect-ratio: 5 / 6;
  -webkit-mask: var(--arch) center / 100% 100% no-repeat; mask: var(--arch) center / 100% 100% no-repeat;
  background:
    radial-gradient(70% 55% at 50% 60%, #fff8ee 0%, transparent 70%),
    linear-gradient(180deg, #e8d4bc 0%, var(--beige) 100%);
}
.arch-frame img { position: absolute; inset: auto 6% 10% 6%; width: 88%; filter: drop-shadow(0 18px 24px rgba(78, 52, 46, .2)); }
.arch-outline { position: absolute; inset: -14px; pointer-events: none; color: var(--gold); }
.arch-outline svg { width: 100%; height: 100%; }
.hero-badge {
  position: absolute; bottom: -22px; inset-inline-end: 4%;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; font-size: .88rem;
}
.hero-badge img { width: 56px; height: auto; }
.hero-badge strong { display: block; color: var(--dark); font-size: .95rem; }
.hero-steam { position: absolute; top: 18%; inset-inline-end: 12%; width: 40px; opacity: .6; color: var(--gold); }
@media (min-width: 900px) {
  .hero { padding-block: 56px 110px; }
  .hero .container { grid-template-columns: 1.1fr .9fr; gap: 56px; }
}

/* ── Product cards ───────────────────────────────────────── */
.grid-products { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
@media (min-width: 900px) { .grid-featured { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .grid-products.compact { grid-template-columns: 1fr 1fr; gap: 12px; } }
.p-card {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s;
}
.p-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.p-media {
  position: relative; margin: 10px 10px 0; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden;
  background: radial-gradient(80% 70% at 50% 65%, #fffaf3, var(--cream));
  border: 0; padding: 0; cursor: pointer;
}
.p-media img { width: 100%; height: 100%; object-fit: contain; transition: transform .5s var(--ease); }
.p-media img.photo { object-fit: cover; }
.p-card:hover .p-media img { transform: scale(1.04); }
.p-badge {
  position: absolute; top: 10px; inset-inline-start: 10px;
  background: var(--dark); color: var(--cream); font-size: .74rem; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
}
.p-badge.gold { background: var(--gold); color: var(--ink); }
.p-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.p-name { font-weight: 700; font-size: 1.06rem; color: var(--dark); margin: 0; line-height: 1.4; }
.p-name small { display: block; font-weight: 400; font-size: .78rem; color: var(--brown); letter-spacing: .02em; }
.p-desc { color: var(--ink-soft); font-size: .88rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-weight: 700; color: var(--dark); }
.price .from { font-weight: 400; font-size: .78rem; color: var(--ink-soft); margin-inline-end: 4px; }
.price s { color: var(--ink-soft); font-weight: 400; font-size: .82rem; margin-inline-start: 6px; }
.add-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px;
  border-radius: 999px; border: 0; background: var(--dark); color: var(--cream); font-weight: 600; font-size: .88rem;
  transition: background .2s, transform .15s;
}
.add-btn:hover { background: #3c2723; }
.add-btn:active { transform: scale(.95); }
.add-btn svg { width: 16px; height: 16px; }
.p-card.is-off { opacity: .62; }
.p-card.is-off .add-btn { background: var(--line); color: var(--ink-soft); pointer-events: none; }
@media (max-width: 520px) {
  .compact .p-body { padding: 10px 12px 12px; }
  .compact .p-desc { display: none; }
  .compact .p-name { font-size: .95rem; }
  .compact .p-foot { flex-direction: column; align-items: stretch; }
  .compact .add-btn { justify-content: center; }
}

/* ── Offers, about, services ─────────────────────────────── */
.section-tint { background: var(--cream); }
.about { display: grid; gap: 36px; align-items: center; }
.about-art { position: relative; max-width: 380px; justify-self: center; width: 100%; }
.about-art .arch-frame { aspect-ratio: 5 / 6; background: linear-gradient(180deg, #fcf3e7, #f4e7d7); }
.about-art .arch-frame .logo-full { position: absolute; inset: auto 0 0; width: 100%; height: auto; filter: none; }
.about-art .arch-frame img { inset: auto 8% 12% 8%; width: 84%; }
.about-art .logo-stamp { position: absolute; top: 20%; inset-inline: 0; margin: auto; width: 60%; opacity: .95; }
.about p { color: var(--ink-soft); font-size: 1.08rem; }
@media (min-width: 900px) { .about { grid-template-columns: .8fr 1.2fr; gap: 72px; } }

.services { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.svc {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px;
  transition: border-color .3s, transform .3s var(--ease);
}
.svc:hover { border-color: var(--gold); transform: translateY(-3px); }
.svc-icon {
  width: 52px; height: 60px; display: grid; place-items: center; margin-bottom: 16px; color: var(--dark);
  background: rgba(201, 169, 106, .18);
  -webkit-mask: var(--arch) center / 100% 100% no-repeat; mask: var(--arch) center / 100% 100% no-repeat;
}
.svc-icon svg { width: 24px; height: 24px; margin-top: 8px; }
.svc h3 { margin: 0 0 6px; font-size: 1.08rem; color: var(--dark); }
.svc p { margin: 0; color: var(--ink-soft); font-size: .93rem; }

.contact { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.contact-item { padding: 22px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.contact-item .label { font-size: .82rem; color: var(--brown); font-weight: 600; }
.contact-item .value { color: var(--dark); font-weight: 600; margin-top: 4px; word-break: break-word; }
.contact-item a { text-decoration: none; }
.contact-item a:hover { color: var(--gold-deep); }
.empty-note { text-align: center; color: var(--ink-soft); }

/* ── CTA band ───────────────────────────────────────────── */
.cta-band { background: var(--dark); color: var(--cream); border-radius: 28px; padding: 44px 28px; text-align: center; position: relative; overflow: hidden; }
.cta-band::before { content: ''; position: absolute; inset: 0; background: radial-gradient(60% 80% at 50% 0%, rgba(201, 169, 106, .22), transparent 70%); }
.cta-band > * { position: relative; }
.cta-band h2 { font-family: var(--font-display); font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0 0 8px; color: var(--cream); }
.cta-band p { color: rgba(245, 238, 230, .78); margin: 0 0 24px; }
.cta-band .btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer { background: #2E201B; color: rgba(245, 238, 230, .75); padding: 56px 0 28px; margin-top: 0; }
.site-footer .top { display: grid; gap: 28px; align-items: start; }
.site-footer .logo-card { display: inline-block; background: #f8ecdd; border-radius: 22px; padding: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.site-footer img.logo { width: 180px; height: auto; border-radius: 18px; display: block; }
.site-footer .tagline { font-family: var(--font-display); color: var(--beige); font-size: 1.2rem; margin: 14px 0 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { color: var(--gold); }
.site-footer .bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(245, 238, 230, .12); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: .85rem; }
@media (min-width: 760px) { .site-footer .top { grid-template-columns: 1fr auto; } }

/* ── Menu page ──────────────────────────────────────────── */
.page-head { padding: 40px 0 18px; text-align: center; }
.cat-tabs {
  position: sticky; top: var(--header-h); z-index: 30;
  background: rgba(251, 248, 244, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.cat-tabs .scroller { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; }
.cat-tabs .scroller::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0; height: 40px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink-soft); font-weight: 600; font-size: .92rem;
  transition: all .2s;
}
.cat-tab:hover { color: var(--dark); border-color: var(--dark); }
.cat-tab[aria-pressed="true"] { background: var(--dark); color: var(--cream); border-color: var(--dark); }
.menu-section { padding-top: 34px; scroll-margin-top: calc(var(--header-h) + 70px); }
.menu-section h2 { font-family: var(--font-display); color: var(--dark); font-size: 1.7rem; margin: 0 0 18px; display: flex; align-items: center; gap: 14px; }
.menu-section h2::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to var(--to-end, left), var(--line-strong), transparent); }
html[dir="ltr"] .menu-section h2::after { --to-end: right; }
.state-box { padding: 60px 16px; text-align: center; color: var(--ink-soft); }
.skeleton { background: linear-gradient(90deg, #f1e9df 25%, #f8f3ec 50%, #f1e9df 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); height: 300px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Floating cart bar ───────────────────────────────────── */
.cart-bar {
  position: fixed; inset-inline: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 45;
  max-width: 560px; margin-inline: auto;
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px;
  background: var(--dark); color: var(--cream); border-radius: 999px; box-shadow: var(--shadow-lg);
  transform: translateY(140%); visibility: hidden; transition: transform .45s var(--ease), visibility 0s .45s;
}
html[dir="rtl"] .cart-bar { padding: 10px 18px 10px 10px; }
.cart-bar.show:not(.tucked) { transform: none; visibility: visible; transition: transform .45s var(--ease); }
.cart-bar .info { flex: 1; min-width: 0; line-height: 1.3; }
.cart-bar .info small { display: block; color: rgba(245, 238, 230, .7); font-size: .78rem; }
.cart-bar .info strong { font-size: 1.02rem; }
.cart-bar .btn { min-height: 44px; }
.has-cart-bar { padding-bottom: 96px; }

/* ── Dialog / bottom sheet ───────────────────────────────── */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92vh;
  border-radius: 24px 24px 0 0; background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheet-in .38s var(--ease); }
dialog.sheet::backdrop { background: rgba(46, 32, 27, .45); backdrop-filter: blur(2px); animation: fade-in .3s; }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@media (min-width: 700px) {
  dialog.sheet { margin: auto; border-radius: 24px; max-height: 88vh; }
}
.sheet-head { position: relative; flex-shrink: 0; }
.sheet-media { aspect-ratio: 16 / 10; background: radial-gradient(70% 70% at 50% 60%, #fffaf3, var(--cream)); }
.sheet-media img { width: 100%; height: 100%; object-fit: contain; padding: 10px 40px 0; }
.sheet-media img.photo { object-fit: cover; padding: 0; }
.sheet-close { position: absolute; top: 12px; inset-inline-end: 12px; background: rgba(251, 248, 244, .9); border: 0; }
.sheet-body { padding: 18px 20px 8px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.sheet-body h3 { margin: 0; font-size: 1.35rem; color: var(--dark); }
.sheet-body .sub { color: var(--brown); font-size: .9rem; }
.sheet-body .desc { color: var(--ink-soft); margin: 8px 0 0; }
.sheet-foot { padding: 12px 20px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; background: var(--paper); flex-shrink: 0; }
.sheet-foot .btn { flex: 1; }

fieldset.opt { border: 0; padding: 0; margin: 20px 0 0; }
fieldset.opt legend { font-weight: 700; color: var(--dark); margin-bottom: 8px; font-size: .98rem; }
fieldset.opt legend small { font-weight: 400; color: var(--ink-soft); margin-inline-start: 6px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 16px;
  border: 1.5px solid var(--line-strong); border-radius: 999px; background: #fff; font-size: .92rem; font-weight: 500;
  transition: all .15s;
}
.choice span em { font-style: normal; color: var(--brown); font-size: .8rem; }
.choice input:checked + span { border-color: var(--dark); background: var(--dark); color: var(--cream); }
.choice input:checked + span em { color: var(--beige); }
.choice input:focus-visible + span { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.choice input:disabled + span { opacity: .4; text-decoration: line-through; }

.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line-strong); border-radius: 999px; height: 46px; flex-shrink: 0; }
.qty button { width: 42px; height: 100%; border: 0; background: transparent; font-size: 1.3rem; color: var(--dark); border-radius: 999px; }
.qty button:hover { background: rgba(78, 52, 46, .06); }
.qty output { min-width: 28px; text-align: center; font-weight: 700; }
.qty.sm { height: 36px; }
.qty.sm button { width: 34px; font-size: 1.1rem; }

/* ── Forms ──────────────────────────────────────────────── */
.field { display: grid; gap: 6px; margin-top: 16px; }
.field label, .field .label { font-weight: 600; font-size: .92rem; color: var(--dark); }
.input, textarea.input, select.input {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { outline: none; border-color: var(--dark); box-shadow: 0 0 0 4px rgba(201, 169, 106, .25); }
.input[dir="ltr"] { text-align: start; }
html[dir="rtl"] .input[dir="ltr"] { text-align: right; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--ink-soft); margin-top: 10px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--dark); flex-shrink: 0; margin-top: 3px; }
.form-error { color: var(--danger); font-size: .9rem; margin-top: 10px; }
.hint { font-size: .84rem; color: var(--ink-soft); }

/* ── Order page ─────────────────────────────────────────── */
.order-wrap { display: grid; gap: 24px; padding-block: 24px 40px; }
@media (min-width: 980px) { .order-wrap { grid-template-columns: 1fr 400px; align-items: start; } .order-side { position: sticky; top: calc(var(--header-h) + 16px); } }
.table-chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px;
  background: var(--dark); color: var(--cream); border-radius: 999px; font-weight: 600;
}
html[dir="rtl"] .table-chip { padding: 8px 8px 8px 16px; }
.table-chip .n { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--ink); display: grid; place-items: center; font-weight: 700; }
.table-chip small { display: block; font-weight: 400; font-size: .76rem; color: rgba(245, 238, 230, .72); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h2 { margin: 0 0 4px; font-size: 1.2rem; color: var(--dark); }
.cart-lines { list-style: none; margin: 12px 0 0; padding: 0; }
.cart-line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.cart-line:last-child { border-bottom: 0; }
.cart-line img { width: 56px; height: 56px; border-radius: 12px; object-fit: contain; background: var(--cream); }
.cart-line .t { font-weight: 700; color: var(--dark); line-height: 1.4; }
.cart-line .o { font-size: .82rem; color: var(--ink-soft); }
.cart-line .row { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.cart-line .rm { border: 0; background: none; color: var(--danger); font-size: .82rem; padding: 4px; }
.cart-line .lp { font-weight: 700; color: var(--dark); white-space: nowrap; }
.totals { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; margin-top: 6px; border-top: 1px dashed var(--line-strong); }
.totals strong { font-size: 1.3rem; color: var(--dark); }

.notice { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--radius); background: var(--cream); border: 1px solid var(--line); }
.notice svg { width: 28px; height: 28px; flex-shrink: 0; color: var(--gold-deep); }
.notice h3 { margin: 0 0 4px; color: var(--dark); font-size: 1.05rem; }
.notice p { margin: 0; color: var(--ink-soft); font-size: .93rem; }
.notice.warn { background: #fbf1e0; border-color: rgba(183, 121, 31, .3); }

/* tracking */
.track { max-width: 620px; margin: 0 auto; padding-block: 28px 56px; }
.track-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.track-top { background: var(--dark); color: var(--cream); padding: 26px 22px 22px; text-align: center; position: relative; overflow: hidden; }
.track-top::before { content: ''; position: absolute; inset: 0; background: radial-gradient(70% 90% at 50% 0%, rgba(201, 169, 106, .25), transparent 70%); }
.track-top > * { position: relative; }
.track-top .no { font-variant-numeric: lining-nums; font-family: 'Cormorant Garamond', Georgia, serif; font-size: 3.4rem; font-weight: 600; line-height: 1; color: var(--gold); margin: 6px 0; }
.track-top .meta { display: flex; justify-content: center; gap: 18px; font-size: .9rem; color: rgba(245, 238, 230, .8); flex-wrap: wrap; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); padding: 24px 14px 8px; position: relative; }
.step { text-align: center; position: relative; font-size: .8rem; color: var(--ink-soft); }
.step .dot { width: 34px; height: 34px; margin: 0 auto 8px; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; display: grid; place-items: center; position: relative; z-index: 1; transition: all .4s var(--ease); }
.step .dot svg { width: 16px; height: 16px; opacity: 0; }
.step::before { content: ''; position: absolute; top: 17px; inset-inline-start: -50%; width: 100%; height: 2px; background: var(--line-strong); }
.step:first-child::before { display: none; }
.step.done .dot { background: var(--dark); border-color: var(--dark); color: var(--cream); }
.step.done .dot svg { opacity: 1; }
.step.done::before, .step.current::before { background: var(--dark); }
.step.current .dot { border-color: var(--gold); background: var(--gold); color: var(--ink); box-shadow: 0 0 0 6px rgba(201, 169, 106, .25); animation: pulse 2s infinite; }
.step.current .dot svg { opacity: 1; }
.step.current { color: var(--dark); font-weight: 700; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(201, 169, 106, .08); } }
.track-hint { text-align: center; padding: 6px 22px 18px; color: var(--ink-soft); }
.track-cancelled { margin: 18px; }
.track-items { padding: 4px 22px 22px; }
.track-items h3 { font-size: 1rem; color: var(--dark); margin: 0 0 6px; }
.track-items ul { list-style: none; margin: 0; padding: 0; }
.track-items li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.track-items li .o { color: var(--ink-soft); font-size: .8rem; }
.my-orders { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.my-orders a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); text-decoration: none; font-size: .88rem; }
.my-orders a[aria-current="true"] { background: var(--dark); color: var(--cream); border-color: var(--dark); }

.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.status-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-new { background: #f6ead2; color: #8a6420; }
.st-preparing { background: #e9e0f3; color: #5c3f86; }
.st-ready { background: #dcefe1; color: #2f6b40; }
.st-completed { background: #ece6e1; color: var(--ink-soft); }
.st-cancelled { background: #f6dede; color: var(--danger); }

/* ── Toast ──────────────────────────────────────────────── */
.toast-wrap { position: fixed; top: calc(var(--header-h) + 10px); inset-inline: 0; display: grid; justify-items: center; gap: 8px; z-index: 100; pointer-events: none; padding-inline: 16px; }
.toast { background: var(--ink); color: var(--cream); padding: 10px 18px; border-radius: 999px; font-size: .92rem; box-shadow: var(--shadow-lg); animation: toast-in .35s var(--ease); max-width: 100%; }
.toast.error { background: var(--danger); }
@keyframes toast-in { from { transform: translateY(-10px); opacity: 0; } }

/* ═══════════════════════════════════════════════════════════
   ADMIN DASHBOARD
   ═══════════════════════════════════════════════════════════ */
body.admin { background: #F3ECE3; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(70% 60% at 50% 0%, rgba(201, 169, 106, .2), transparent), #2E201B; }
.login-card { width: 100%; max-width: 400px; background: var(--paper); border-radius: 24px; padding: 32px 26px; box-shadow: var(--shadow-lg); }
.login-card img.login-logo { width: 210px; height: auto; margin: -8px auto 4px; border-radius: 20px;
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, #000 70%, transparent 100%);
          mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, #000 70%, transparent 100%); }
.login-card h1 { text-align: center; font-size: 1.1rem; color: var(--ink-soft); font-weight: 500; margin: 0 0 8px; }
.login-card .lang-btn { display: block; margin: 18px auto 0; }

.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.sidebar {
  background: #2E201B; color: rgba(245, 238, 230, .78);
  position: fixed; inset-block: 0; inset-inline-start: 0; width: 264px; z-index: 60;
  display: flex; flex-direction: column; transform: translateX(var(--side-off, -100%)); transition: transform .35s var(--ease);
}
html[dir="rtl"] .sidebar { --side-off: 100%; }
.sidebar.open { transform: none; }
.side-brand { padding: 22px 20px 14px; border-bottom: 1px solid rgba(245, 238, 230, .1); }
.side-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.side-emblem { background: #f8ecdd; border-radius: 14px; padding: 3px 6px; display: inline-flex; }
.side-emblem img { height: 44px; width: auto; }
.side-name { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; color: var(--cream); letter-spacing: .08em; font-size: 1.05rem; direction: ltr; }
.side-brand .sub { flex-basis: 100%; }
.side-brand .sub { font-size: .68rem; letter-spacing: .16em; color: var(--gold); margin-top: 8px; font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; direction: ltr; text-align: start; }
.side-nav { flex: 1; overflow-y: auto; padding: 12px 10px; display: grid; gap: 2px; align-content: start; }
.side-nav button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 12px;
  border: 0; background: transparent; color: inherit; text-align: start; font-size: .94rem; font-weight: 500;
}
.side-nav button svg { width: 20px; height: 20px; flex-shrink: 0; opacity: .8; }
.side-nav button:hover:not([disabled]) { background: rgba(245, 238, 230, .06); color: var(--cream); }
.side-nav button[aria-current="page"] { background: rgba(201, 169, 106, .16); color: var(--cream); }
.side-nav button[aria-current="page"] svg { color: var(--gold); opacity: 1; }
.side-nav button[disabled] { opacity: .45; cursor: default; }
.side-nav .soon { margin-inline-start: auto; font-size: .66rem; padding: 2px 8px; border-radius: 999px; border: 1px solid rgba(245, 238, 230, .25); white-space: nowrap; }
.side-user { padding: 14px 16px; border-top: 1px solid rgba(245, 238, 230, .1); font-size: .86rem; display: grid; gap: 10px; }
.side-user .who strong { color: var(--cream); display: block; font-weight: 600; }
.side-user .row { display: flex; gap: 8px; }
.side-user .row button { flex: 1; }
.scrim { position: fixed; inset: 0; background: rgba(46, 32, 27, .45); z-index: 55; }

.admin-main { min-width: 0; }
.admin-top { position: sticky; top: 0; z-index: 30; background: rgba(243, 236, 227, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.admin-top .bar { height: 62px; display: flex; align-items: center; gap: 12px; padding-inline: 16px; }
.admin-top h1 { font-size: 1.1rem; margin: 0; color: var(--dark); }
.admin-top .tools { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.admin-content { padding: 20px 16px 48px; max-width: 1500px; }
@media (min-width: 1100px) {
  .admin-shell { grid-template-columns: 264px 1fr; }
  .sidebar { position: sticky; top: 0; height: 100vh; transform: none; }
  .admin-top .menu-toggle, .scrim { display: none !important; }
  .admin-content { padding: 28px 32px 56px; }
}

.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--ok); font-weight: 600; }
.live-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: blink 1.6s infinite; }
.live-dot.off { color: var(--danger); }
.live-dot.off::before { animation: none; }
@keyframes blink { 50% { opacity: .35; } }

.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat .k { font-size: .84rem; color: var(--ink-soft); }
.stat .v { font-size: 1.9rem; font-weight: 700; color: var(--dark); line-height: 1.2; margin-top: 4px; }
.stat.accent { background: var(--dark); color: var(--cream); border-color: var(--dark); }
.stat.accent .k { color: rgba(245, 238, 230, .7); }
.stat.accent .v { color: var(--gold); }

/* orders board */
.board { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .board { grid-template-columns: repeat(3, 1fr); align-items: start; } }
.col { background: rgba(255, 255, 255, .5); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-height: 160px; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 12px; }
.col-head h2 { margin: 0; font-size: 1rem; color: var(--dark); display: flex; align-items: center; gap: 8px; }
.col-head .count { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px; background: var(--dark); color: var(--cream); display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.col-list { display: grid; gap: 12px; }
.col-empty { text-align: center; color: var(--ink-soft); font-size: .9rem; padding: 24px 0; }
.o-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: 0 1px 2px rgba(46, 32, 27, .04); border-inline-start: 4px solid var(--gold); }
.o-card.st-col-preparing { border-inline-start-color: #7d5ba6; }
.o-card.st-col-ready { border-inline-start-color: var(--ok); }
.o-card.flash { animation: flash 1.2s ease 3; }
@keyframes flash { 50% { box-shadow: 0 0 0 4px rgba(201, 169, 106, .55); } }
.o-head { display: flex; align-items: center; gap: 10px; }
.o-no { font-variant-numeric: lining-nums; font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.9rem; font-weight: 700; color: var(--dark); line-height: 1; }
.o-table { background: var(--dark); color: var(--cream); padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: .88rem; }
.o-time { margin-inline-start: auto; text-align: end; font-size: .8rem; color: var(--ink-soft); line-height: 1.3; }
.o-time .late { color: var(--danger); font-weight: 700; }
.o-items { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.o-items li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.o-items .q { min-width: 30px; height: 30px; border-radius: 8px; background: var(--cream); color: var(--dark); display: grid; place-items: center; font-weight: 700; }
.o-items .n { font-weight: 600; line-height: 1.35; }
.o-items .m { font-size: .82rem; color: var(--ink-soft); }
.o-items .note { font-size: .82rem; color: var(--warn); }
.o-note { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: #fbf1e0; color: #7a5212; font-size: .88rem; }
.o-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.o-actions .btn { flex: 1; }
.o-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: .82rem; color: var(--ink-soft); }
.history { margin-top: 24px; }
.history table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); font-size: .9rem; }
.history th, .history td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); }
.history th { background: var(--cream); font-weight: 600; color: var(--dark); font-size: .82rem; }
.table-scroll { overflow-x: auto; }

/* barista full-screen mode */
body.kds .admin-shell { grid-template-columns: 1fr; }
body.kds .sidebar, body.kds .scrim, body.kds .admin-top .menu-toggle { display: none !important; }
body.kds .admin-content { max-width: none; }
body.kds .o-items .n { font-size: 1.08rem; }

/* tables / QR */
.qr-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); margin-top: 18px; }
.qr-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; }
.qr-card.off { opacity: .55; }
.qr-card .logo { width: 140px; height: auto; margin: 0 auto 2px; border-radius: 12px; }
.qr-card .tn { font-family: var(--font-display); font-size: 1.5rem; color: var(--dark); font-weight: 700; margin: 0; }
.qr-card .qr { width: 170px; height: 170px; margin: 10px auto; }
.qr-card .qr svg, .qr-card .qr img { width: 100%; height: 100%; }
.qr-card .scan { font-size: .82rem; color: var(--ink-soft); }
.qr-card .actions { display: flex; gap: 6px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.toolbar .field { margin-top: 0; }

.form-grid { display: grid; gap: 0 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { width: 44px; height: 24px; appearance: none; -webkit-appearance: none; background: var(--line-strong); border-radius: 12px; position: relative; transition: background .2s; cursor: pointer; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(20px); }
html[dir="rtl"] .switch input:checked::after { transform: translateX(-20px); }
.badge-off { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #f6dede; color: var(--danger); font-size: .8rem; font-weight: 600; }
.badge-on { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #dcefe1; color: var(--ok); font-size: .8rem; font-weight: 600; }
.view-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.view-title h2 { margin: 0; font-size: 1.4rem; color: var(--dark); font-family: var(--font-display); }
.stack { display: grid; gap: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════════════════
   PACKAGE 2 — dashboard modules, cashier, invoices, reservations
   ═══════════════════════════════════════════════════════════ */
.spinner-lg { display: inline-block; width: 30px; height: 30px; border: 3px solid var(--gold); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.sub-h { font-size: 1.02rem; color: var(--dark); margin: 22px 0 10px; }
.hint.inline { display: inline; }
.warn-text { color: var(--warn); font-weight: 700; }
.neg { color: var(--danger); }
.pos { color: var(--ok); }
a.stat { text-decoration: none; color: inherit; transition: transform .2s var(--ease), box-shadow .2s; }
a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat.warn { border-color: rgba(183, 121, 31, .45); background: #fdf6ea; }
.stat.warn .v { color: var(--warn); }

/* tabs & chips */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex-shrink: 0; border: 0; background: none; padding: 12px 16px; font-weight: 600; color: var(--ink-soft); border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--dark); }
.tabs button[aria-selected="true"] { color: var(--dark); border-bottom-color: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; font-size: .86rem; font-weight: 600; color: var(--ink-soft); }
.chip[aria-pressed="true"] { background: var(--dark); color: var(--cream); border-color: var(--dark); }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--cream); color: var(--dark); font-size: .76rem; font-weight: 600; white-space: nowrap; }
.tag.mv-purchase, .tag.mv-opening, .tag.mv-production { background: #dcefe1; color: #2f6b40; }
.tag.mv-consume { background: #e9e0f3; color: #5c3f86; }
.tag.mv-waste { background: #f6dede; color: var(--danger); }

/* data tables */
.data-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; font-size: .9rem; }
.data-table th, .data-table td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table thead th { background: var(--cream); color: var(--dark); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tr.muted td { opacity: .55; }
.data-table tr.low td { background: #fdf6ea; }
.data-table.compact th, .data-table.compact td { padding: 7px 10px; }
.data-table .row-actions, .data-table td.nowrap { white-space: nowrap; }
.data-table .row-actions .btn { margin-inline-end: 4px; }
.thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: contain; background: var(--cream); }
.star { border: 0; background: none; font-size: 1.3rem; color: var(--line-strong); line-height: 1; padding: 4px; }
.star.on { color: var(--gold); }
td .switch input { transform: scale(.9); }

/* dialogs */
dialog.dlg { max-width: 620px; }
dialog.dlg.wide { max-width: 920px; }
@media (min-width: 700px) { dialog.dlg { width: calc(100% - 32px); } }
.dlg-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.dlg-head h3 { margin: 0; font-size: 1.08rem; color: var(--dark); flex: 1; }
.dlg-body { padding: 16px 18px max(18px, env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.ask-msg { color: var(--ink); }
fieldset.box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin: 16px 0 0; background: rgba(255, 255, 255, .6); }
fieldset.box legend, details.box summary { font-weight: 700; color: var(--dark); padding: 0 6px; }
details.box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; margin-top: 12px; background: #fff; }
details.box summary { cursor: pointer; padding: 2px 0; }
.opt-list, .rl-list { display: grid; gap: 8px; margin: 8px 0; }
.opt-row { display: grid; grid-template-columns: 1.3fr 1.3fr .8fr auto auto; gap: 8px; align-items: center; }
.cat-row { grid-template-columns: 1.3fr 1.3fr .6fr auto; }
.rl-row { grid-template-columns: 2.4fr 1fr auto auto; }
.opt-row .input { min-height: 42px; padding: 8px 10px; }
.check.mini { margin: 0; font-size: .82rem; white-space: nowrap; gap: 6px; }
.unit-tag { font-size: .8rem; color: var(--ink-soft); min-width: 32px; }
@media (max-width: 640px) {
  .opt-row { grid-template-columns: 1fr 1fr; }
  .opt-row .input.num { grid-column: 1; }
  .rl-row { grid-template-columns: 1fr 90px auto; }
  .rl-row .unit-tag { display: none; }
}
.img-edit { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.img-preview { width: 160px; height: 120px; object-fit: contain; border-radius: 12px; background: var(--cream); border: 1px solid var(--line); }
.cost-summary { margin-bottom: 6px; }
.cards-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.warn-panel { border-color: rgba(183, 121, 31, .4); background: #fffaf2; }

/* cashier */
.pos-grid { display: grid; gap: 18px; margin-top: 16px; }
@media (min-width: 980px) { .pos-grid { grid-template-columns: 1fr 420px; align-items: start; } .pay-panel { position: sticky; top: 80px; } }
.open-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.open-card { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; text-align: start; padding: 14px; border-radius: 16px; border: 1.5px solid var(--line); background: #fff; transition: border-color .2s, box-shadow .2s; }
.open-card:hover { border-color: var(--gold); }
.open-card.sel { border-color: var(--dark); box-shadow: 0 0 0 3px rgba(201, 169, 106, .35); }
.open-card .o-table { justify-self: start; }
.open-card .total { font-weight: 700; color: var(--dark); font-size: 1.05rem; }
.pay-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.inv-lines td { font-size: .88rem; }
.sum-row { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 2px; }
.sum-row.big { border-top: 1px dashed var(--line-strong); margin-top: 8px; padding-top: 12px; }
.sum-row.big strong { font-size: 1.4rem; color: var(--dark); }
.disc-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.disc-row .input { flex: 1; min-width: 110px; }
.disc-row select.input { flex: 0 0 150px; }
.box .input[name=dreason] { margin-top: 8px; }
.choices.method { margin: 12px 0 4px; }
.quick { display: flex; gap: 4px; flex-wrap: wrap; }
.paid-chip { background: var(--ok); color: #fff; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: .8rem; }

/* receipt (80 mm) */
.receipt-wrap { display: flex; justify-content: center; background: #eee6dc; padding: 16px; border-radius: 12px; }
.receipt { width: 302px; background: #fff; color: #111; padding: 18px 16px; font-size: 12.5px; line-height: 1.55; font-family: var(--font-body); box-shadow: 0 6px 18px rgba(0, 0, 0, .1); }
.receipt .r-logo { width: 120px; margin: 0 auto 6px; }
.receipt .r-center { text-align: center; color: #333; }
.receipt .r-title { text-align: center; font-weight: 700; font-size: 14px; margin: 10px 0 8px; padding: 6px 0; border-block: 1px dashed #999; }
.receipt .r-meta div, .receipt .r-sum div { display: flex; justify-content: space-between; gap: 8px; }
.receipt .r-meta span, .receipt .r-sum span { color: #444; }
.receipt .r-items { width: 100%; border-collapse: collapse; margin: 10px 0; }
.receipt .r-items th { font-size: 11px; color: #444; border-bottom: 1px solid #999; padding: 4px 0; text-align: start; }
.receipt .r-items th:not(:first-child), .receipt .r-items td:not(:first-child) { text-align: end; white-space: nowrap; padding-inline-start: 8px; }
.receipt .r-items td { padding: 5px 0; border-bottom: 1px dotted #ccc; vertical-align: top; }
.receipt .r-items small { display: block; color: #666; font-size: 10.5px; }
.receipt .r-total { font-size: 15px; font-weight: 700; border-block: 1px solid #111; padding: 6px 0; margin: 6px 0; }
.receipt .r-total span { color: #111 !important; }
.receipt .r-void { text-align: center; color: #b00; font-weight: 800; font-size: 18px; border: 2px solid #b00; margin: 10px 0; padding: 4px; letter-spacing: .1em; }
.receipt .r-foot { text-align: center; color: #555; margin-top: 12px; font-size: 11.5px; }

.report-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.report-head h2 { margin: 0; color: var(--dark); font-size: 1.2rem; }

/* reservations (admin) */
.day-nav { display: flex; gap: 6px; align-self: end; flex-wrap: wrap; }
.status-pill.rs-pending { background: #f6ead2; color: #8a6420; }
.status-pill.rs-confirmed { background: #dcefe1; color: #2f6b40; }
.status-pill.rs-rejected, .status-pill.rs-cancelled { background: #f6dede; color: var(--danger); }
tr.res-rejected td, tr.res-cancelled td { opacity: .55; }
.table-opts { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.table-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--line-strong); border-radius: 12px; cursor: pointer; background: #fff; }
.table-opt input { accent-color: var(--dark); margin-top: 4px; }
.table-opt small { display: block; color: var(--ink-soft); font-size: .76rem; }
.table-opt:has(input:checked) { border-color: var(--dark); box-shadow: 0 0 0 3px rgba(201, 169, 106, .3); }
.table-opt.disabled { opacity: .5; cursor: not-allowed; }
.table-res { align-items: center; }
.mini-field { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--ink-soft); }
.mini-field .input { width: 70px; min-height: 36px; padding: 4px 8px; }

/* reservation page (customer) */
.reserve-wrap { display: grid; gap: 28px; padding-block: 8px 64px; align-items: start; }
.reserve-art { display: none; }
@media (min-width: 980px) {
  .reserve-wrap { grid-template-columns: 1fr 360px; }
  .reserve-art { display: block; position: sticky; top: calc(var(--header-h) + 20px); }
  .reserve-art .arch-frame { aspect-ratio: 4 / 5; }
}
.reserve-form .form-grid { gap: 0 16px; }
.rsv-card .track-top .no { font-size: 2.6rem; letter-spacing: .04em; }
.rsv-status { padding: 22px; text-align: center; }
.rsv-status p { margin: 10px 0 0; color: var(--ink); }

/* printing: only the element marked .printing */
@media print {
  @page { margin: 8mm; }
  body.print-mode * { visibility: hidden !important; }
  body.print-mode .printing, body.print-mode .printing * { visibility: visible !important; }
  body.print-mode .printing { position: absolute; inset: 0 auto auto 0; width: 100%; }
  body.print-mode dialog { position: static; max-height: none; box-shadow: none; overflow: visible; }
  #qr-print.printing { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12mm; padding: 4mm; }
  #qr-print.printing .qr-card { break-inside: avoid; border: 1px solid #ccc; }
  #qr-print.printing .actions, #qr-print.printing .qr-card.off { display: none !important; }
  body.print-receipt .receipt-wrap { background: none; padding: 0; justify-content: flex-start; }
  body.print-receipt .receipt { box-shadow: none; width: 72mm; padding: 0; }
  .report .stat.accent { background: #fff !important; color: #000 !important; border: 1px solid #000; }
  .report .stat.accent .v, .report .stat.accent .k { color: #000 !important; }
}
/* grid children must be allowed to shrink so wide tables scroll inside .table-scroll */
.stack > *, .pos-grid > *, .board > * { min-width: 0; }
.table-scroll { max-width: 100%; }

/* ═══════════════════════════════════════════════════════════
   PACKAGE 3 — finance, reports, staff, WhatsApp
   ═══════════════════════════════════════════════════════════ */
.range-bar { margin-bottom: 16px; align-items: end; }
.range-bar .chips { align-self: end; }
.fin-grid { display: grid; gap: 16px; }
@media (min-width: 980px) { .fin-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.fin-grid > * { min-width: 0; }
.stat.neg-stat { border-color: rgba(162, 59, 59, .4); background: #fbefef; }
.stat.neg-stat .v { color: var(--danger); }
.sum-row.info-row { color: var(--ink-soft); border-top: 1px dotted var(--line-strong); margin-top: 6px; }
#fin-body.loading { opacity: .5; }

/* bar chart: single series, brand hue, recessive grid, hover tooltip */
.chart-wrap { position: relative; }
.bar-chart { width: 100%; height: auto; display: block; overflow: visible; }
.bar-chart .grid { stroke: var(--line); stroke-width: 1; }
.bar-chart .axis { fill: var(--ink-soft); font-size: 11px; font-family: var(--font-body); }
.bar-chart .bar path { fill: var(--brown); transition: fill .15s; }
.bar-chart .bar.on path { fill: var(--dark); }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--cream); padding: 6px 10px; border-radius: 8px; font-size: .82rem; white-space: nowrap; box-shadow: var(--shadow); }

/* staff */
.role-sel { min-height: 38px; padding: 4px 10px; width: auto; }
.perm-table td.yes { color: var(--ok); font-weight: 700; text-align: center; }
.perm-table td.no { color: var(--ink-soft); text-align: center; }
.perm-table th:not(:first-child) { text-align: center; }

/* WhatsApp */
.wa-state { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 12px 0; }
.checklist { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist .mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; flex-shrink: 0; font-weight: 700; }
.checklist li.ok .mark { background: #dcefe1; color: var(--ok); }
.checklist li.no .mark { background: #f6dede; color: var(--danger); }
.checklist small { display: block; }
form.box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 16px; background: rgba(255, 255, 255, .6); }
.wa-st { font-weight: 600; font-size: .82rem; }
.wa-st.st-sent { color: var(--ok); }
.wa-st.st-failed { color: var(--danger); }
.wa-st.st-not-configured, .wa-st.st-sending { color: var(--warn); }

.print-only { display: none; }
@media print {
  body.print-mode .printing .print-only { display: flex; }
  body.print-mode .printing .no-print { display: none !important; }
}
@media (max-width: 640px) {
  .admin-top .bar { flex-wrap: wrap; height: auto; min-height: 62px; padding-block: 10px; row-gap: 8px; }
  .admin-top .tools { flex-wrap: wrap; justify-content: flex-start; margin-inline-start: 0; width: 100%; }
  .admin-top .tools:empty { display: none; }
}

.stats .stat .v.money { font-size: 1.45rem; white-space: nowrap; }
@media (max-width: 420px) { .stats .stat .v.money { font-size: 1.25rem; } }

.report-logo { height: 54px; width: auto; border-radius: 10px; }

.setup-offer { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line-strong); text-align: center; }
.setup-offer p { color: var(--ink-soft); font-size: .9rem; margin: 0 0 10px; }
#setup .hint { text-align: center; margin: 0 0 6px; }
.notice-line { margin: 8px 0 4px; padding: 10px 12px; border-radius: 12px; background: #F3E7D3; border: 1px solid #E5CFA5; color: var(--ink); font-size: .86rem; line-height: 1.6; }
.free-banner { margin: 0 0 16px; }
.free-banner p { margin: 4px 0 0; font-size: .9rem; }
#st-table { min-width: 680px; }
.role-sel { min-width: 130px; }

/* ── Smart management ── */
.smart .stat .sub { font-size: .82rem; color: var(--ink-soft); margin-top: 4px; }
.smart .stat.accent .sub { color: rgba(245, 238, 230, .75); }
.alert-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.alert-list .al { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.alert-list .al > span:nth-child(2) { flex: 1; min-width: 0; }
.alert-list .al.critical { border-color: rgba(162, 59, 59, .45); background: #fbefef; }
.alert-list .al.warning { border-color: rgba(183, 121, 31, .45); background: #fdf6ea; }
.alert-list .al .ic { font-size: 1.05rem; }
.smart-chart .bar.actual path { fill: #8B4A22; }
.smart-chart .bar.forecast path { fill: url(#fc-hatch); stroke: #8C6418; stroke-width: 1; }
.smart-chart .bar.on path { filter: brightness(.85); }
.smart-chart .split { stroke: var(--ink-soft); stroke-dasharray: 3 4; stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 8px 0 4px; font-size: .84rem; color: var(--ink-soft); }
.legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-inline-end: 6px; vertical-align: -2px; }
.legend .sw.actual { background: #8B4A22; }
.legend .sw.forecast { background: repeating-linear-gradient(45deg, #B8862B 0 4px, #dcc08a 4px 6px); border: 1px solid #8C6418; }
.legend.ramp { gap: 4px; }
.legend.ramp .sw { margin: 0; border: 1px solid var(--line); }
.tbl-toggle summary { cursor: pointer; font-size: .86rem; color: var(--gold-deep); margin: 6px 0; }
.heat { border-collapse: separate; border-spacing: 2px; font-size: .74rem; min-width: max(100%, calc(var(--cols) * 30px + 60px)); }
.heat th { font-weight: 600; color: var(--ink-soft); padding: 2px 4px; text-align: center; white-space: nowrap; }
.heat tbody th { text-align: start; }
.heat td { height: 28px; min-width: 26px; text-align: center; border-radius: 4px; color: var(--ink); cursor: default; }
.heat td.dark { color: #fff; }
.heat td:focus-visible { outline: 2px solid var(--gold-deep); }
.tag.st-out { background: #f6dede; color: var(--danger); }
.tag.st-low, .tag.st-soon { background: #fbf1e0; color: #8a5a12; }
.tag.fl-lowMargin, .tag.fl-noRecipe { background: #fbf1e0; color: #8a5a12; }
.tag.fl-slow, .tag.fl-costUnknown { background: #eee8e3; color: var(--ink-soft); }
td.neg { color: var(--danger); font-weight: 600; }
.smart #ai-buy table:not(.show-all) tr.more-row { display: none; }
#ai-more { margin-top: 10px; }

/* ── Product card (descriptive sheet) ── */
.chips-row { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.p-sheet { display: grid; gap: 16px; }
.ps-head { display: flex; gap: 16px; align-items: center; }
.ps-head img { width: 132px; height: 132px; object-fit: cover; border-radius: 16px; background: var(--cream); flex-shrink: 0; }
.ps-head h2 { margin: 2px 0 0; font-size: 1.35rem; color: var(--dark); }
.ps-code { font-size: .8rem; color: var(--gold-deep); font-weight: 700; letter-spacing: .06em; }
.ps-en { color: var(--ink-soft); font-size: .92rem; }
.ps-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ps-desc { margin: 0; color: var(--ink-soft); }
.ps-money { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 10px; }
.ps-money > div { background: var(--cream); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.ps-money span { font-size: .8rem; color: var(--ink-soft); }
.ps-money strong { font-size: 1.15rem; color: var(--dark); }
.ps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 8px 16px; margin: 0; }
.kv { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.kv dt { font-size: .8rem; color: var(--ink-soft); }
.kv dd { margin: 0; font-weight: 600; }
.p-sheet h3 { font-size: 1rem; margin: 0 0 8px; color: var(--dark); }
.ps-pre { white-space: pre-line; margin: 0 0 6px; }
.ps-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.ps-opts h4 { margin: 0 0 4px; font-size: .9rem; }
.ps-opts ul { margin: 0; padding-inline-start: 18px; }
.tag.allergen { background: #fbf1e0; color: #8a5a12; }
@media (max-width: 520px) { .ps-head { flex-direction: column; align-items: flex-start; } }
@media print { body.print-mode .p-sheet.printing { padding: 8mm; } body.print-mode .p-sheet .ps-head img { width: 34mm; height: 34mm; } }
/* ── Inventory additions ── */
.linkish { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: start; text-decoration: underline dotted var(--gold); text-underline-offset: 4px; }
.linkish:hover { color: var(--gold-deep); }
td.supply { font-size: .82rem; line-height: 1.6; min-width: 170px; }
.pending-counts { margin: 0 0 16px; border-color: rgba(183, 121, 31, .45); background: #fdf6ea; }
.short-list { margin: 6px 0 0; padding-inline-start: 18px; }
/* ── Recipes (read-only) ── */
.rc-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin-top: 12px; }
.rc-card header { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.rc-card header img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--cream); }
.rc-card h3 { margin: 0; font-size: 1.02rem; color: var(--dark); }
.rc-parts { display: grid; gap: 10px; }
.rc-parts h4 { margin: 0 0 4px; font-size: .85rem; color: var(--gold-deep); }
.rc-lines { list-style: none; margin: 0; padding: 0; }
.rc-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.rc-card details { margin-top: 8px; }
.rc-card summary { cursor: pointer; color: var(--gold-deep); font-size: .88rem; }
/* ── Fixed assets ── */
.tag.as-active { background: #dcefe1; color: #2f6b40; }
.tag.as-maintenance { background: #fbf1e0; color: #8a5a12; }
.tag.as-stopped { background: #f6dede; color: var(--danger); }
.tag.as-disposed { background: #eee8e3; color: var(--ink-soft); }
#as-table td { vertical-align: middle; }
.sum-row.neg strong { color: var(--danger); }
#fin-position .panel h2 { font-size: 1.02rem; }

/* ── Manage recipe (package 5) ── */
.rx-top { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.rx-top img { width: 84px; height: 84px; border-radius: 14px; object-fit: cover; background: var(--cream); }
.rx-top h3 { margin: 2px 0 0; color: var(--dark); }
.rx-head, .rx-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(70px, .9fr) minmax(76px, .8fr) minmax(70px, .9fr) 34px; gap: 8px; align-items: center; }
.rx-head { font-size: .78rem; color: var(--ink-soft); padding: 4px 2px; }
.rx-row { margin-bottom: 6px; }
.rx-cost { font-size: .86rem; color: var(--ink-soft); text-align: end; }
.rx-row input.bad { border-color: var(--danger); background: #fbefef; }
@media (max-width: 560px) {
  .rx-head { display: none; }
  .rx-row { grid-template-columns: 1fr 1fr 34px; }
  .rx-row [data-k="itemId"] { grid-column: 1 / -1; }
  .rx-row .rx-cost { grid-column: 1 / 3; text-align: start; }
}
#rx-sum td, #rx-sum th { white-space: nowrap; }
/* order edit / cancellation */
.oe-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper input { width: 56px; text-align: center; }
.oe-total { margin: 12px 0 0; }
.disp-opts { display: grid; gap: 10px; margin: 12px 0; }
.disp-opts .check { align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.low-banner { margin: 0 0 12px; align-items: center; }
.low-banner p { margin: 2px 0 0; }
.rep-h4 { margin: 14px 0 6px; font-size: .92rem; color: var(--dark); }
.tag.mv-return { background: #dcefe1; color: #2f6b40; }
.tag.mv-order-waste { background: #f6dede; color: var(--danger); }
li.sub{color:var(--ink-soft)}
.rc-lines li.sub { font-style: italic; }

/* P5: products table on phones — each product is a card, buttons always visible */
@media (max-width: 760px) {
  #p-table thead { display: none; }
  #p-table, #p-table tbody { display: block; }
  #p-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 4px; border-bottom: 1px solid var(--line, #e7dccf); }
  #p-table td { display: block; border: 0; padding: 2px 4px; }
  #p-table td:nth-child(2) { flex: 1 1 60%; }
  #p-table td.row-actions { flex: 1 1 100%; white-space: normal; display: flex; flex-wrap: wrap; gap: 6px; }
}
.rc-actions { margin-top: 10px; }

/* ── Phase 1: production, expiry & waste, profitability, suppliers ── */
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head h2 { margin: 0; }
.inline-field { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-2, #6b5a50); }
.hbars { display: grid; gap: 8px; margin-top: 8px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; gap: 10px; align-items: center; font-size: .9rem; }
.hbar > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .bar { height: 12px; border-radius: 999px; background: #efe5d8; overflow: hidden; }
.hbar .bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8D6E63, #C9A96A); }
.hbars.low .bar i, .hbar .bar i.neg { background: linear-gradient(90deg, #c46a5a, #e0a48f); }
.cmp-list, .po-lines, .sup-items { margin: 0; padding-inline-start: 18px; }
.cmp-list li.best { font-weight: 700; color: #2f6b40; }
.sup-row { grid-template-columns: 1.6fr .7fr .7fr .9fr auto; }
.po-row { display: grid; grid-template-columns: 1.6fr .7fr .7fr .9fr .7fr auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.po-row .input { min-height: 42px; padding: 8px 10px; }
.po-head { display: grid; grid-template-columns: 1.6fr .7fr .7fr .9fr .7fr auto; gap: 8px; font-size: .8rem; margin-top: 8px; }
.pf-change p { margin: 6px 0 2px; }
.pf-change ul { margin: 0 0 8px; }
@media (max-width: 760px) {
  .sup-row, .po-row { grid-template-columns: 1fr 1fr; }
  .po-head { display: none; }
  .hbar { grid-template-columns: 1fr auto; }
  .hbar .bar { grid-column: 1 / -1; grid-row: 2; }
}
.tabs .nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-inline-start: 4px; border-radius: 999px; background: #c46a5a; color: #fff; font-size: .72rem; }

/* ── Table cards: QR + products (printable) ── */
.tc-pick { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); margin: 8px 0; }
.tc-pick .box { margin: 0; }
.tc-pick .check { display: flex; gap: 6px; align-items: center; padding: 3px 0; font-size: .9rem; }
.tc-sheet { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); margin-top: 14px; }
.tc-card { background: #fffaf4; border: 1px solid #e7d6c2; border-radius: 22px; padding: 16px 16px 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tc-card header { display: flex; align-items: center; justify-content: center; gap: 12px; }
.tc-logo { width: 104px; height: auto; }
.tc-table { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--dark); }
.tc-qr { width: 172px; height: 172px; background: #fff; border-radius: 14px; padding: 6px; border: 1px solid #ead9c5; }
.tc-qr svg { width: 100%; height: 100%; display: block; }
.tc-scan { margin: 2px 0 6px; font-size: .86rem; color: var(--brown); line-height: 1.5; }
.tc-items { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px dashed #d9c3a7; padding-top: 10px; }
.tc-item { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: .78rem; line-height: 1.25; }
.tc-item img { width: 100%; max-width: 92px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #f5eee6; }
.tc-item strong { color: var(--dark); font-size: .82rem; }
.tc-item small { color: var(--ink-soft); font-size: .66rem; }
.tc-item .money { color: #8a5a12; font-weight: 700; }
@media print {
  body.print-cards .tc-sheet.printing { display: grid; grid-template-columns: 1fr 1fr; gap: 8mm; padding: 0; margin: 0; }
  body.print-cards .tc-card { break-inside: avoid; page-break-inside: avoid; border: .4mm solid #c9a96a; border-radius: 6mm; padding: 6mm; background: #fff; }
  body.print-cards .tc-qr { width: 52mm; height: 52mm; }
  body.print-cards .tc-logo { width: 30mm; }
  body.print-cards .tc-item img { max-width: 24mm; }
}

/* ── Home: full menu & prices ── */
.hm-tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 22px; }
.hm-list { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); align-items: start; }
.hm-cat { background: #fffaf4; border: 1px solid var(--line); border-radius: 22px; padding: 18px 18px 8px; }
.hm-cat h3 { font-family: var(--font-display); color: var(--dark); font-size: 1.35rem; margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid #ead9c5; }
.hm-cat ul { list-style: none; margin: 0; padding: 0; }
.hm-item { display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed #e7d6c2; }
.hm-item:last-child { border-bottom: 0; }
.hm-item.is-off { opacity: .55; }
.hm-img { border: 0; padding: 0; background: #f5eee6; border-radius: 14px; overflow: hidden; width: 76px; height: 57px; cursor: pointer; }
.hm-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hm-name strong { color: var(--dark); }
.hm-body p { margin: 2px 0 4px; font-size: .85rem; color: var(--ink-soft); line-height: 1.5; }
.hm-prices { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .88rem; }
.hm-size { color: var(--brown); }
.hm-size .money { color: #8a5a12; font-weight: 700; }
.hm-size s { color: var(--ink-soft); font-size: .8rem; }
.tag.hm-offer { background: #f6e3c2; color: #8a5a12; }
.tag.hm-out { background: #f6dede; color: var(--danger); }
@media (max-width: 520px) { .hm-item { grid-template-columns: 64px 1fr; } .hm-item .add-btn { grid-column: 1 / -1; justify-self: end; } .hm-img { width: 64px; height: 48px; } }
.hm-list:has(> .hm-cat:only-child) { grid-template-columns: 1fr; }
.hm-list:has(> .hm-cat:only-child) .hm-cat ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); column-gap: 28px; }

/* ── Phase 2: drawer shifts & split payment ── */
.notice-line.shift-on { background: #e7f2e6; border-color: #b9d8b4; }
.notice-line.shift-off { background: #fbefe0; }
.notice-line .btn { margin-inline-start: 8px; }
.split-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.split-grid .mini-field { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; }
@media (max-width: 520px) { .split-grid { grid-template-columns: 1fr; } }

/* ── Phase 3: my day, team, checklists, maintenance ── */
.md-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 10px; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }
.md-tasks, .mt-list, .pn-list, .cl-list { list-style: none; margin: 0; padding: 0; }
.md-tasks li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed #e7d6c2; }
.md-tasks li.done strong { text-decoration: line-through; color: var(--ink-soft); }
.md-tasks li.pr-high { border-inline-start: 4px solid #c46a5a; padding-inline-start: 8px; }
.data-table tr.sel td { background: #fbf3e6; }
.tm-week th.today { background: #f3e2c6; }
.tm-cell { width: 100%; min-height: 44px; border: 1px dashed #d9c3a7; background: #fffaf4; border-radius: 10px; cursor: pointer; color: var(--ink-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .82rem; }
.tm-cell.on { border-style: solid; background: #efe2cf; color: var(--dark); font-weight: 600; }
.tm-cell small { font-weight: 400; color: var(--brown); }
.tag.lv-approved, .tag.tk-done { background: #dcefe1; color: #2f6b40; }
.tag.lv-rejected { background: #f6dede; color: var(--danger); }
.tag.lv-pending, .tag.tk-doing { background: #fbf1e0; color: #8a5a12; }
.pn-list li { padding: 8px 0; border-bottom: 1px dashed #e7d6c2; }
.pn-list li.pn-warning { border-inline-start: 4px solid #c46a5a; padding-inline-start: 8px; }
.pn-list li.pn-praise { border-inline-start: 4px solid #7cae4f; padding-inline-start: 8px; }
.cl-bar { height: 10px; background: #efe5d8; border-radius: 999px; overflow: hidden; margin: 6px 0 12px; }
.cl-bar i { display: block; height: 100%; background: linear-gradient(90deg, #8D6E63, #7cae4f); }
.cl-list li { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px dashed #e7d6c2; }
.cl-list li.done .cl-body strong { color: #2f6b40; }
.cl-list li.done .cl-body strong::before { content: '✓ '; }
.cl-time { color: var(--brown); font-weight: 600; }
.cl-edit-row { display: grid; grid-template-columns: 1.4fr 1.2fr .9fr .7fr auto auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.mt-list li { padding: 6px 0; border-bottom: 1px dashed #e7d6c2; }
.mt-list li.sev-high strong { color: var(--danger); }
@media (max-width: 760px) { .cl-edit-row { grid-template-columns: 1fr 1fr; } .cl-list li { grid-template-columns: 44px 1fr; } .cl-list li .btn { grid-column: 1 / -1; justify-self: end; } }

/* ── Counter POS «طلب جديد» ─────────────────────────────── */
.ctr { display: grid; gap: 18px; margin-top: 12px; }
@media (min-width: 1000px) { .ctr { grid-template-columns: 1fr 400px; align-items: start; } .ctr-cart { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; } }
.ctr > * { min-width: 0; }
.ctr-search { position: relative; }
.ctr-search .input { padding-inline-end: 44px; height: 48px; font-size: 1rem; }
.ctr-search kbd { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 7px; font-size: .8rem; color: var(--ink-soft); background: var(--paper); }
.ctr-cats { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 10px; scrollbar-width: thin; }
.ctr-cats .cat-tab { flex: 0 0 auto; }
.ctr-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.ctr-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 104px; padding: 12px; text-align: start; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); transition: border-color .15s, transform .08s, box-shadow .15s; }
.ctr-tile:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.ctr-tile:active { transform: scale(.97); }
.ctr-tile .n { font-weight: 700; color: var(--dark); line-height: 1.35; }
.ctr-tile .p { margin-top: auto; font-weight: 600; color: var(--brown); }
.ctr-tile .p small { color: var(--ink-soft); }
.ctr-tile .tags { display: flex; gap: 4px; flex-wrap: wrap; }
.ctr-tile.off { opacity: .5; background: var(--paper); cursor: not-allowed; }
.ctr-in { position: absolute; top: -8px; inset-inline-end: -6px; min-width: 26px; height: 26px; border-radius: 999px; background: var(--dark); color: var(--cream); font-size: .82rem; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.tag.t-off { background: #f6dede; color: var(--danger); }
.tag.t-low { background: #fbf1e0; color: #8a5a12; }
.tag.t-hot { background: #f3ead8; color: var(--gold-deep); }
.ctr-cart { display: flex; flex-direction: column; gap: 10px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg .choice span { width: 100%; justify-content: center; }
.ctr-row.two { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .ctr-row.two { grid-template-columns: 1fr 1fr; } }
.ctr-phone { display: flex; gap: 6px; }
.ctr-phone .input { flex: 1; min-width: 0; }
.ctr-lines { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 0; }
.ctr-line { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; }
.ctr-line.bad .ctr-ln { color: var(--danger); }
.ctr-ln { background: none; border: 0; padding: 0; text-align: start; font-weight: 600; color: var(--dark); cursor: pointer; }
.ctr-ln small { display: block; font-weight: 400; color: var(--ink-soft); font-size: .8rem; }
.qty.sm { height: 34px; }
.qty.sm button { width: 30px; font-size: 1.05rem; }
.qty.sm output { min-width: 22px; }
.icon-x { width: 30px; height: 30px; border-radius: 999px; border: 0; background: transparent; color: var(--ink-soft); font-size: 1.2rem; line-height: 1; }
.icon-x:hover { background: #f6dede; color: var(--danger); }
.ctr-smart { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px; border-radius: 12px; background: #faf5ec; border: 1px dashed rgba(168, 135, 63, .45); }
.ctr-smart .lbl { font-size: .85rem; color: var(--ink-soft); width: 100%; }
.ctr-smart.cust .lbl:first-child { color: var(--ink); }
.ctr-smart .chip small { color: var(--gold-deep); }
.ctr-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ctr-actions.small { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ctr-heldrow { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.tab-count:not(:empty) { display: inline-block; min-width: 20px; padding: 0 6px; margin-inline-start: 4px; border-radius: 999px; background: var(--gold); color: #fff; font-size: .75rem; line-height: 20px; }
.ot { display: inline-block; padding: 1px 10px; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.ot-takeaway { background: #e7eef8; color: #2d4e78; }
.ot-counter { background: #efe7f4; color: #5c3f86; }
.call-name { color: var(--dark); }
.receipt.ticket .r-items td { font-size: 1rem; padding: 4px 0; }

/* ── Pickup screen «شاشة النداء» ───────────────────────── */
.dp { display: grid; gap: 18px; grid-template-columns: 1fr; margin-top: 8px; }
@media (min-width: 800px) { .dp { grid-template-columns: 1fr 1fr; } }
.dp-col { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); padding: 18px; min-height: 60vh; }
.dp-col h2 { margin: 0 0 14px; font-family: var(--font-display); font-size: 2rem; color: var(--dark); display: flex; justify-content: space-between; }
.dp-col.ready { background: #f2f7f2; border-color: rgba(78, 125, 91, .35); }
.dp-col.ready h2 { color: var(--ok); }
.dp-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.dp-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 10px; border-radius: 16px; background: var(--paper); border: 1.5px solid var(--line); }
.dp-col.ready .dp-card { background: #fff; border-color: var(--ok); }
.dp-no { font-size: 3rem; font-weight: 800; line-height: 1.1; color: var(--dark); }
.dp-name { font-size: 1.25rem; font-weight: 700; color: var(--brown); min-height: 1.6em; }
.dp-place { font-size: .9rem; color: var(--ink-soft); }
.dp-empty { color: var(--ink-soft); font-size: 2rem; text-align: center; }
.dp-card.flash { animation: dpFlash 1s ease-in-out 6; }
@keyframes dpFlash { 50% { background: #fff3c9; box-shadow: 0 0 0 6px rgba(201, 169, 106, .45); } }
@media (prefers-reduced-motion: reduce) { .dp-card.flash { animation: none; background: #fff3c9; } }
@media screen { .ticket-host { position: fixed; inset-inline-start: -9999px; top: 0; } }
.ctr-foot { position: sticky; bottom: -18px; z-index: 2; display: flex; flex-direction: column; gap: 8px; margin: 0 -4px; padding: 10px 4px 4px; background: linear-gradient(to bottom, rgba(255,255,255,.85), #fff 18%); }
@media (max-width: 999px) { .ctr-foot { position: static; background: none; } .ctr { padding-bottom: 70px; } }
.ctr-jump { position: fixed; bottom: max(14px, env(safe-area-inset-bottom)); inset-inline: 16px; z-index: 30; height: 52px; border: 0; border-radius: 999px; background: var(--dark); color: var(--cream); font-weight: 700; font-size: 1rem; box-shadow: var(--shadow-lg); }
@media (min-width: 1000px) { .ctr-jump { display: none; } }
/* invoice: actions stay visible at the bottom of the dialog */
.inv-actions { position: sticky; bottom: calc(-1 * max(18px, env(safe-area-inset-bottom))); z-index: 3; margin: 12px -18px 0; padding: 12px 18px max(14px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 18px -12px rgba(46, 32, 27, .3); }
.dlg-head #r-print-top { margin-inline-start: auto; margin-inline-end: 8px; }
@media print { .inv-actions, #r-print-top { display: none !important; } }
/* products: data health check */
.panel.health { border-width: 1.5px; }
.panel.health.bad { border-color: rgba(162, 59, 59, .45); background: #fff8f7; }
.panel.health.warn { border-color: rgba(183, 121, 31, .45); background: #fffaf1; }
.panel.health h2 { margin: 0 0 6px; font-size: 1.1rem; color: var(--danger); }
.health-list { margin: 8px 0 14px; padding-inline-start: 18px; display: grid; gap: 8px; }
.health-list ul { margin: 4px 0 0; padding-inline-start: 18px; font-size: .9rem; }
.health-list li.error { color: var(--danger); }
.health-list li.warn { color: #8a5a12; }
.db-bad { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: #fff1ef; border: 1px solid rgba(162, 59, 59, .35); }
.db-bad a { color: var(--danger); font-weight: 700; display: block; }
.db-bad small { color: var(--ink-soft); }

/* ═══ Invoice (80 mm thermal receipt) — professional bilingual layout ═══ */
.receipt.rx { width: 310px; padding: 22px 16px 26px; font-size: 12px; line-height: 1.45; color: #141414; position: relative;
  --rx-line: #1a1a1a; --rx-soft: #5c5c5c;
  -webkit-mask: radial-gradient(circle 6px at 50% 0, #0000 98%, #000) 0 0 / 14px 51% repeat-x, radial-gradient(circle 6px at 50% 100%, #0000 98%, #000) 0 100% / 14px 51% repeat-x;
          mask: radial-gradient(circle 6px at 50% 0, #0000 98%, #000) 0 0 / 14px 51% repeat-x, radial-gradient(circle 6px at 50% 100%, #0000 98%, #000) 0 100% / 14px 51% repeat-x; }
.rx .bl { display: inline-flex; flex-direction: column; line-height: 1.2; }
.rx .bl b { font-weight: 600; }
.rx .bl i, .rx i { font-style: normal; font-size: 9.5px; color: var(--rx-soft); letter-spacing: .02em; font-family: 'Segoe UI', system-ui, sans-serif; }
.rx .num { font-variant-numeric: tabular-nums; }
.rx-head { text-align: center; }
.rx .r-logo { width: 96px; margin: 0 auto 2px; display: block; }
.rx-brand { font-family: var(--font-display); font-size: 25px; font-weight: 700; letter-spacing: .14em; line-height: 1.1; }
.rx-brand span { display: block; font-size: 17px; letter-spacing: 0; margin-top: 1px; }
.rx-tag { font-size: 9.5px; letter-spacing: .32em; text-transform: uppercase; color: var(--rx-soft); margin: 3px 0 8px; }
.rx-contact { font-size: 10.5px; color: #333; display: grid; gap: 1px; }
.rx-ids { margin-top: 3px; font-size: 10px; }
.rx-title { margin: 12px -16px 10px; padding: 7px 10px 6px; background: #141414; color: #fff; text-align: center; display: flex; flex-direction: column; }
.rx-title b { font-size: 14px; letter-spacing: .04em; }
.rx-title i { color: #d9d9d9 !important; font-size: 9.5px !important; letter-spacing: .25em !important; text-transform: uppercase; }
.rx-order { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: stretch; margin-bottom: 10px; }
.rx-no { border: 2px solid var(--rx-line); border-radius: 8px; padding: 4px 10px; text-align: center; display: flex; flex-direction: column; justify-content: center; }
.rx-no small { font-size: 9px; color: var(--rx-soft); }
.rx-no b { font-size: 24px; font-weight: 800; line-height: 1.05; }
.rx-place { border: 1px dashed var(--rx-line); border-radius: 8px; padding: 5px 10px; display: flex; flex-direction: column; justify-content: center; }
.rx-place b { font-size: 14px; }
.rx-place strong { font-size: 13px; margin-top: 2px; }
.rx-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 8px 0; border-block: 1px dashed #8a8a8a; }
.rx-meta > div { display: flex; flex-direction: column; gap: 1px; }
.rx-meta > div > b { font-size: 12px; font-weight: 700; }
.rx-items { margin: 8px 0 4px !important; }
.rx-items thead th { border-bottom: 1.5px solid var(--rx-line) !important; padding: 4px 0 5px !important; vertical-align: bottom; }
.rx-items thead .bl b { font-size: 10.5px; }
.rx-items td { border-bottom: 1px dotted #b5b5b5 !important; padding: 6px 0 !important; }
.rx-items td:first-child { width: 100%; }
.rx-items .it-n { display: block; font-size: 12.5px; }
.rx-items .it-en { display: block; }
.rx-items small { color: #3d3d3d !important; font-size: 10.5px !important; }
.rx-items .it-note { font-style: italic; }
.rx-count { text-align: center; font-size: 10px; color: var(--rx-soft); margin: 2px 0 6px; }
.rx-sum { display: grid; gap: 3px; }
.rx .r-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rx .r-row > b { font-size: 12.5px; white-space: nowrap; }
.rx .r-row.minus > b { font-weight: 600; }
.rx .r-row.sub { padding-inline-start: 10px; }
.rx .r-row small { font-size: 9.5px; color: var(--rx-soft); font-weight: 400; }
.rx-note { font-size: 10px; color: var(--rx-soft); margin: -2px 0 2px; }
.rx-total { display: flex !important; justify-content: space-between; align-items: center; margin: 10px -16px !important; padding: 9px 16px !important; background: #141414; color: #fff; border: 0 !important; }
.rx-total .bl b { font-size: 14px; color: #fff; }
.rx-total .bl i { color: #cfcfcf !important; }
.rx-total > b { font-size: 21px; font-weight: 800; }
.rx-total > b small { font-size: 10px; font-weight: 600; letter-spacing: .1em; }
.rx-sum.vat { padding-bottom: 6px; border-bottom: 1px dashed #8a8a8a; margin-bottom: 4px; }
.rx-sec { margin: 10px 0 5px; padding-bottom: 3px; border-bottom: 1px solid var(--rx-line); }
.rx-sec .bl b { font-size: 11.5px; font-weight: 800; letter-spacing: .03em; }
.rx-saved { margin: 10px 0 0; padding: 7px 10px; border: 1.5px dashed var(--rx-line); border-radius: 8px; text-align: center; font-weight: 600; display: flex; flex-direction: column; }
.rx-saved b { font-size: 14px; }
.rx-loyal { margin-top: 10px; padding: 2px 10px 8px; border: 1px solid var(--rx-line); border-radius: 8px; display: grid; gap: 3px; }
.rx-loyal .rx-sec.in { margin: 6px 0 3px; }
.rx .r-void { margin: 12px 0; font-size: 17px; transform: rotate(-4deg); border-radius: 6px; }
.rx-qr { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; padding-top: 10px; border-top: 1px dashed #8a8a8a; }
.rx-qr svg { width: 84px; height: 84px; flex-shrink: 0; }
.rx-qr span { display: flex; flex-direction: column; font-size: 11px; font-weight: 600; }
.rx-foot { margin-top: 10px !important; color: #333 !important; font-size: 10.5px !important; }
.rx-foot p { margin: 0 0 4px; }
.rx-thanks { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: #141414; display: flex; flex-direction: column; margin-top: 6px !important; }
.rx-thanks i { font-family: var(--font-display) !important; font-size: 11px !important; font-style: italic !important; }
.rx-code { font-size: 9.5px; color: var(--rx-soft); letter-spacing: .08em; margin-top: 6px !important; }
@media print {
  body.print-receipt .receipt.rx { width: 72mm; padding: 0 0 4mm; -webkit-mask: none; mask: none; }
  .rx-title, .rx-total { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.rx-head { display: block; }
.rx .bl i, .rx-place i, .rx-saved i { unicode-bidi: plaintext; text-align: right; }
.rx-title i, .rx-saved i, .rx-thanks i { text-align: center; }
.rx-items th, .rx-items td { white-space: nowrap; }
.rx-items th:first-child, .rx-items td:first-child { white-space: normal; }
.rx-items th:not(:first-child), .rx-items td:not(:first-child) { padding-inline-start: 9px !important; text-align: end; }
.rx-items th:nth-child(2), .rx-items td:nth-child(2) { text-align: center; }
.rx-items th:not(:first-child) .bl { align-items: flex-end; }
.rx-items th:nth-child(2) .bl { align-items: center; }
.rx-meta > div > b, .rx .r-row > b[dir="ltr"] { text-align: right; unicode-bidi: plaintext; }
.rx-loyal .r-row:first-of-type { padding-bottom: 3px; border-bottom: 1px dotted #b5b5b5; }

/* ── offline / sync badge ── */
.net-badge { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; font-size: .82rem; font-weight: 700; color: var(--ink); cursor: pointer; white-space: nowrap; margin-inline-start: 8px; }
.net-badge .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); }
.net-badge.off { background: #fbe9e7; border-color: rgba(162, 59, 59, .45); color: var(--danger); }
.net-badge.off .dot { background: var(--danger); animation: netPulse 1.4s ease-in-out infinite; }
.net-badge.att { background: #fff4e0; border-color: rgba(183, 121, 31, .5); color: #8a5a12; }
.net-badge.sync .dot { background: var(--ok); }
@keyframes netPulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .net-badge.off .dot { animation: none; } }
#sc-table tr.attention td { background: #fff8f0; }
.offline-note { padding: 10px 12px; border-radius: 12px; background: #fbe9e7; color: var(--danger); font-weight: 600; font-size: .9rem; }
.rx-prov { margin: 0 -16px 10px; padding: 7px 12px; border: 2px dashed #141414; text-align: center; font-weight: 800; font-size: 12px; display: flex; flex-direction: column; }
.rx-prov i { font-weight: 600; }
/* hero: real photo filling the arch */
.arch-frame.photo { background: #e9d6bf; }
.arch-frame.photo img { inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 64% 55%; filter: none; }
