/* ===============================
   RESET & BASE
================================ */
* {
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

html, body {
  margin: 0;
  background: #F8FAFC;
  color: #0F172A;
  touch-action: manipulation;
}
/* ===============================
   TOP BAR
================================ */
.topbar {
  background: linear-gradient(135deg, #0F172A, #1E293B);
  color: #FBBF24;
  padding: 16px;
  font-size: 20px;
  text-align: center;
  font-weight: 800;
  position: sticky;
  top: 0;
  z-index: 2000;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

.menu-btn {
  position: absolute;
  right: 16px;
  top: 14px;
  font-size: 22px;
  background: none;
  border: none;
  color: #FBBF24;
  cursor: pointer;
}

/* ===============================
   LAYOUT
================================ */
.cashier-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 16px;
  padding: 16px;
  min-height: calc(100vh - 80px);
}

/* ===============================
   CARDS
================================ */
.card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
  color: #0F172A;
}

/* ===============================
   CATEGORIES
================================ */
.categories {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.cat {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  border: none;
  background: #E5E7EB;
  font-weight: 700;
  cursor: pointer;
}

.cat.active {
  background: #FBBF24;
  color: #0F172A;
}

/* ===============================
   ITEMS GRID (🔥 مجنون)
================================ */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
}

.item {
  height: 230px;
  background: #FFFFFF;
  border-radius: 16px;
  border: 1px solid #E5E7EB;
  padding: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .15s ease, box-shadow .15s ease;
}

.item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
}

.cashier-item-img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 12px;
}

.item strong {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  min-height: 2.6em;
  text-align: center;
}

.item span {
  font-size: 14px;
  font-weight: 700;
  color: #16A34A;
  text-align: center;
}

/* ===============================
   INVOICE
================================ */
.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}

.invoice-table th,
.invoice-table td {
  padding: 6px;
  border-bottom: 1px solid #E5E7EB;
  font-size: 14px;
}

.total-box,
.change-box {
  font-size: 16px;
  font-weight: 900;
  margin: 10px 0;
}

#paid {
  width: 100%;
  padding: 10px;
  font-size: 15px;
  border-radius: 12px;
  border: 1px solid #CBD5E1;
}

/* ===============================
   BUTTONS
================================ */
.btn {
  padding: 12px;
  border-radius: 14px;
  border: none;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.btn.success {
  background: linear-gradient(135deg, #16A34A, #22C55E);
  color: white;
}

.btn.danger {
  background: linear-gradient(135deg, #DC2626, #EF4444);
  color: white;
}

.btn.secondary {
  background: #1E293B;
  color: #FBBF24;
}

/* ===============================
   ACTIVE ORDERS
================================ */
.card.orders {
  overflow-y: auto;
}

.orders-list {
  display: grid;
  gap: 10px;
}

.order-box {
  background: #FFFFFF;              /* بدون لون */
  border-radius: 14px;
  padding: 12px;
  border: 1px solid #E5E7EB;        /* إطار محايد */
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  transition: all .2s ease;
}


.order-box strong {
  font-size: 14px;
  font-weight: 900;
}

.order-box button {
  margin-top: 6px;
  margin-left: 4px;
}

/* ===============================
   SIDE MENU
================================ */
.side-menu {
  position: fixed;
  top: 0;
  right: -240px;
  width: 240px;
  height: 100%;
  background: #0F172A;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: right .25s ease;
  z-index: 3000;
}

.side-menu.open {
  right: 0;
}

.side-menu button {
  background: #1E293B;
  color: #FBBF24;
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-weight: 800;
}

/* ===============================
   OVERLAY
================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
  z-index: 2500;
}

.overlay.show {
  display: block;
}

/* ===============================
   VARIANT POPUP
================================ */
.variant-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
}

.variant-box {
  background: white;
  padding: 20px;
  border-radius: 16px;
  width: 90%;
  max-width: 320px;
  text-align: center;
}

.variant-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: none;
  margin: 6px 0;
  background: #FBBF24;
  font-weight: 800;
}

.variant-cancel {
  background: #E5E7EB;
  padding: 10px;
  border-radius: 10px;
  border: none;
  margin-top: 10px;
}

/* ===============================
   MOBILE MODE
================================ */
@media (max-width: 768px) {
  .cashier-layout {
    grid-template-columns: 1fr;
  }

  .card.products { order: 1; }
  .card.invoice  { order: 2; }
  .card.orders   { order: 3; }
}

/* ===============================
   SCROLL STYLE
================================ */
.items-grid::-webkit-scrollbar,
.orders-list::-webkit-scrollbar {
  width: 6px;
}

.items-grid::-webkit-scrollbar-thumb,
.orders-list::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 10px;
}

/* ===============================
   REPORT PAGE (FINAL PRO)
================================ */
.report-page {
  background: #F1F5F9;
  min-height: 100vh;
}

/* ===== Header ===== */
.report-header {
  background: linear-gradient(135deg, #0F172A, #1E293B);
  color: #FBBF24;
  padding: 24px 16px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

.report-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
}

.report-header .store-name {
  font-size: 14px;
  opacity: .9;
  margin-top: 4px;
}

.report-header .close-time {
  margin-top: 8px;
  font-size: 13px;
  opacity: .85;
}

/* ===== Container ===== */
.report-container {
  max-width: 900px;
  margin: 20px auto;
  padding: 0 16px;
}

/* ===== Summary Cards ===== */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.summary-cards .card {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.summary-cards span {
  font-size: 14px;
  font-weight: 700;
  color: #475569;
}

.summary-cards strong {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 900;
  color: #0F172A;
}

/* ===== Table ===== */
.table-box {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,.08);
}

.table-box table {
  width: 100%;
  border-collapse: collapse;
}

.table-box thead {
  background: #F1F5F9;
}

.table-box th {
  padding: 10px;
  font-size: 14px;
  font-weight: 900;
  border-bottom: 2px solid #E5E7EB;
}

.table-box td {
  padding: 10px;
  font-size: 14px;
  border-bottom: 1px solid #E5E7EB;
}

/* ===== Actions ===== */
.report-page .actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* ===== Footer ===== */
.report-footer {
  text-align: center;
  font-size: 12px;
  color: #64748B;
  margin: 24px 0;
}


.overlay {
  pointer-events: none;
}

.overlay.show {
  pointer-events: auto;
}
.order-box button {
  pointer-events: auto;
  position: relative;
  z-index: 5;
}
.fixed-back {
  position: fixed;
  bottom: 20px;
  left: 20px;        /* لو تبيه يمين غيّرها right */
  z-index: 9999;
  padding: 12px 18px;
  font-size: 16px;
  border-radius: 10px;
}
/* ===============================
   PROFESSIONAL RECEIPT (POS STYLE)
================================ */
@media print {
  @page {
    size: 80mm auto;
    margin: 0;
  }

  body * {
    visibility: hidden;
  }

  #printArea,
  #printArea * {
    visibility: visible;
  }

  #printArea {
    position: absolute;
    top: 0;
    right: 0;
    width: 80mm;
  }
}

.receipt {
  width: 80mm;
  padding: 6mm 4mm;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  direction: rtl;
  text-align: center;   /* 🔥 هذا يخلي كل شي بالنص */
}

/* اسم المحل */
.title {
  font-size: 28px;      /* 🔥 أكبر */
  font-weight: 900;
  margin-bottom: 6px;
}

/* رقم الفاتورة */
.receipt-no {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}

/* الأصناف */
#printItems {
  text-align: center;
}

/* كل صنف */
.receipt-line {
  font-size: 20px;      /* 🔥 واضح جداً */
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.4;
}

/* الإجمالي */
.total {
  margin-top: 12px;
  font-size: 24px;      /* 🔥 بارز */
  font-weight: 900;
}

/* الخط الفاصل */
hr {
  border: none;
  border-top: 2px dashed #000;
  margin: 10px 0;
}
/* إخفاء الفاتورة في الوضع العادي */
#printArea {
  display: none;
}
/* ===============================
   PRINT – REPORT FIX
================================ */
@media print {

  /* تقرير الإقفال */
  body.report-page * {
    visibility: visible !important;
  }

  body.report-page {
    background: white;
  }

  body.report-page .no-print {
    display: none !important;
  }

}
