/* ============ إضافات الديمو — نظام حسابات الكافيه ============ */

.demo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(200, 121, 28, 0.12);
  color: var(--warn);
  border: 1px solid rgba(200, 121, 28, 0.3);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 11.5px;
  font-weight: 800;
  margin-bottom: 2px;
}

.bill-scroll { max-height: none; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(31, 23, 15, 0.48);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 16px;
  animation: fadeIn .16s ease;
}
.modal-card {
  width: min(560px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: 0 34px 90px -26px rgba(0, 0, 0, 0.5);
  padding: 22px;
  animation: popIn .18s ease;
}
.modal-card h3 { margin: 0 0 4px; font-size: 20px; }
.modal-sub { margin: 0 0 16px; color: var(--muted); font-size: 13px; font-weight: 700; }
.modal-close {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer;
  display: grid; place-items: center; flex: none;
}
.modal-close:hover { background: var(--hover); color: var(--ink); }
.modal-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 18px; }
.modal-actions .btn { flex: 1; justify-content: center; padding: 13px; font-size: 15px; }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.98) } to { opacity: 1; transform: none } }

/* ---------- Toast ---------- */
#toastRoot { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 1400; display: grid; gap: 8px; pointer-events: none; }
.toast {
  background: var(--pill);
  color: var(--pill-ink);
  border-radius: 12px;
  padding: 11px 18px;
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.5);
  animation: toastIn .22s ease;
  pointer-events: auto;
  max-width: 90vw;
  text-align: center;
}
.toast.ok { background: linear-gradient(135deg, #2f7d46, #3f9b59); color: #fff; }
.toast.bad { background: linear-gradient(135deg, #b34444, #cf5f5f); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: none } }

/* ---------- Payment success ---------- */
.pay-done { text-align: center; padding: 8px 4px 2px; }
.pay-done .check {
  width: 74px; height: 74px; border-radius: 50%;
  margin: 0 auto 12px;
  display: grid; place-items: center;
  background: rgba(47, 125, 70, 0.12);
  color: var(--ok);
  animation: popIn .3s ease;
}
.pay-done .check svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pay-done h3 { margin: 0 0 4px; font-size: 22px; }
.pay-done p { margin: 0; color: var(--muted); font-size: 13.5px; font-weight: 700; }
.pay-amount { font-size: 30px; font-weight: 800; color: var(--ink); margin: 12px 0 2px; }
.pay-amount i { font-style: normal; font-size: 14px; color: var(--muted); }

/* ---------- Receipt ---------- */
.receipt {
  background: #fffdf8;
  color: #33291f;
  border: 1px dashed #c9b89f;
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 13px;
  line-height: 1.9;
}
.receipt .r-head { text-align: center; border-bottom: 1px dashed #d8c8b2; padding-bottom: 10px; margin-bottom: 10px; }
.receipt .r-head b { font-size: 17px; display: block; }
.receipt .r-head small { color: #8a7660; font-weight: 700; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt th, .receipt td { padding: 4px 2px; text-align: right; font-size: 12.5px; }
.receipt th { color: #8a7660; font-weight: 700; border-bottom: 1px dashed #e4d8c6; }
.receipt .r-total { display: flex; justify-content: space-between; border-top: 1px dashed #d8c8b2; margin-top: 8px; padding-top: 8px; font-weight: 800; font-size: 15px; }
.receipt .r-foot { text-align: center; color: #8a7660; margin-top: 10px; font-size: 11px; font-weight: 700; border-top: 1px dashed #e4d8c6; padding-top: 8px; }

/* ---------- Charts ---------- */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 190px;
  padding: 8px 2px 0;
}
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; height: 100%; min-width: 0; }
.bar-val { font-size: 11px; font-weight: 800; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-track { width: 100%; max-width: 46px; flex: 1; display: flex; align-items: flex-end; }
.bar {
  width: 100%;
  border-radius: 10px 10px 5px 5px;
  background: linear-gradient(180deg, var(--accent), #a3702f);
  min-height: 6px;
  transition: height .5s ease;
}
.bar-wrap.today .bar { background: linear-gradient(180deg, #3f9b59, #2f7d46); }
.bar-label { font-size: 11px; font-weight: 700; color: var(--muted); }

.split { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut {
  width: 116px; height: 116px; border-radius: 50%;
  flex: none;
  display: grid; place-items: center;
  position: relative;
}
.donut::after {
  content: "";
  position: absolute; inset: 14px;
  background: var(--card);
  border-radius: 50%;
}
.donut b { position: relative; z-index: 1; font-size: 15px; }
.split-legend { display: grid; gap: 9px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.split-legend span { display: inline-flex; align-items: center; gap: 8px; }
.split-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.split-legend b { margin-inline-start: 4px; }

/* ---------- Image picker ---------- */
.img-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 6px;
  max-height: 168px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card-2);
}
.img-opt {
  position: relative;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--card);
  padding: 3px;
  cursor: pointer;
  display: grid;
  place-items: center;
  min-height: 50px;
}
.img-opt input { position: absolute; opacity: 0; pointer-events: none; }
.img-opt img { width: 100%; height: 44px; object-fit: contain; display: block; border-radius: 6px; }
.img-opt.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--glow); }
.no-img-txt { font-size: 10.5px; font-weight: 800; color: var(--muted); }

body.modal-open { overflow: hidden; }

/* ---------- Mobile bill shortcut ---------- */
.mobile-bill {
  display: none;
  position: fixed;
  bottom: 88px;
  inset-inline-start: 14px;
  z-index: 900;
  align-items: center;
  gap: 8px;
  background: var(--pill);
  color: var(--pill-ink);
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: 0 16px 34px -14px rgba(0, 0, 0, 0.55);
  cursor: pointer;
}
.mobile-bill svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mobile-bill b { color: var(--accent); font-size: 13.5px; }
.quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1080px) { .mobile-bill { display: inline-flex; } }
@media (max-width: 900px) { .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .quick-grid { grid-template-columns: 1fr; } }

/* ---------- Order rows / demo ---------- */
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.mini-note { font-size: 12px; color: var(--muted); font-weight: 700; margin: 10px 0 0; }
.tick { color: var(--ok); font-weight: 800; }

.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filters .f { display: grid; gap: 5px; min-width: 150px; }
.filters .f > span { font-size: 12.5px; font-weight: 800; color: var(--muted); }
.filters select, .filters input { width: 100%; }

.stat .n .cur { font-size: 13px; color: var(--muted); font-weight: 700; }

/* ---------- Print receipt window ---------- */
@media print {
  .modal-backdrop { position: static; background: #fff; display: block; padding: 0; }
  .modal-card { box-shadow: none; border: 0; max-height: none; }
  .modal-close, .modal-actions { display: none !important; }
}
