body {
  font-family: sans-serif;
  background: #f0f0f0;
  margin: 20px;
}

h1 {
  text-align: center;
  color: #000000;
}

#table-screen h2 {
  text-align: center;
}

#tables {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  /* LEFT align zone blocks */
  gap: 30px;
  margin-top: 20px;
}


#tables {
  display: flex;
  margin-top: 20px;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.bill-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed #ccc;
}

.delete-icon {
  width: 18px;
  height: 18px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.delete-icon:hover {
  transform: scale(1.2);
}


.zone-block {
  margin-bottom: 10px;
}

.zone-title {
  font-weight: bold;
  font-size: 20px;
  /* 🔼 पहले 16px था */
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;

}

.zone-tables {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Compact table button */
.table-btn {
  width: 90px;
  height: 90px;
  font-size: 14px;
  padding: 10px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;
  box-shadow: none;
  overflow: hidden;

}

/* ===== Table‑status colors ===== */
.table-idle {
  background: #e0e0e0;
  color: #000;
}

/* grey – खाली */
.table-running {
  background: #FDD835;
  color: #000;
}

/* yellow – Saved */
.table-printed {
  background: #42A5F5;
  color: #fff;
}

/* blue   – Printed */
.table-settled {
  background: #4CAF50;
  color: #fff;
}

/* green  – Settled */


/* --- Icon wrapper inside each table button --- */
.icon-box {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 0;
  /* 🔸 padding हटाया */
  background: transparent;
  /* 🔸 कोई अलग‑सा बॉक्स नहीं */
  border-radius: 0;
  /* 🔸 कोना भी नहीं चाहिए */
}

/* --- Individual icon buttons --- */
.icon-btn {
  background: transparent;
  /* ⛔️ सफेद हटाओ */
  border: 1px solid rgba(0, 0, 0, 0.3);
  /* dark mode */
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  /* Hover पर हल्का चमक */
}

.icon-btn img {
  width: 20px;
  height: 20px;
}


/* Billing Layout */


#billing-layout {
  margin-left: -20px;
  margin-top: 0;
  padding: 0;
}

.billing-container {
  display: grid;
  grid-template-columns: 160px 1fr 380px;
  gap: 20px;

  /* full screen se thoda chhota so header fit ho jaye */
  height: calc(100vh - 100px);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}



.left-panel {
  background: #2c3e50;
  color: #fff;
  border-radius: 10px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin: 0;
  padding: 10px;
  overflow-y: auto;
  scrollbar-width: none;
  height: 100%;
  /* ✅ panel ke andar hi limit */
}

.middle-panel::-webkit-scrollbar {
  /* Chrome / Edge / Safari */
  display: none;
}

#category-list button {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: none;
  background: #34495e;
  color: white;
  border-radius: 5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

#category-list button:hover,
#category-list button.active {
  background: #0B7B71;
  color: white;
}

/* ================= Middle panel ================= */
/* ------- Middle panel container (जैसा पहले था) ------- */
.middle-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
  /* left align */
  align-content: flex-start;
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  overflow-y: auto;
  scrollbar-width: none;
  height: 98%;
  /* ✅ panel ke andar hi limit */
}

.middle-panel::-webkit-scrollbar {
  display: none;
}

/* ------- Item‑card: बिल्कुल square, बराबर चौड़ाई ------- */
.menu-item {
  /* ➊  row‑gaps को घटाकर हर row में exactly 6 box */
  flex: 0 0 calc((100% - 5*12px)/6);
  /* basis & max‑width दोनों यही होगा */
  height: 90px;
  /* ➋  square look (चौड़ाई भी यही बनेगी) */
  box-sizing: border-box;
  /* border इसी साइज में गिना जाये */

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  padding: 6px;
  font-size: 13px;
  line-height: 1.2;
  border: 1px solid #bbb;
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s, box-shadow .2s;

  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  min-width: 90px;
  min-height: 90px;
}

.menu-item:hover {
  background: #f3f3f3;
  box-shadow: 0 0 4px rgba(0, 0, 0, .15);
}

/* (अगर किसी नाम पर भी तीन लाइनों से ज़्यादा लिखावट चाहिए,
   height:100px कर लो या font-size:12px कर दो) */



.item-name {
  display: block;
  width: 100%;
  padding: 0 4px;
  font-size: 13px;
  line-height: 1.15;
  text-align: center;

  white-space: nowrap;
  /* एक ही पंक्ति */
  overflow: hidden;
  /* box से बाहर न निकले */
  text-overflow: ellipsis;
  /* ... लगा दे */
}



.menu-item button {
  background: #0B7B71;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
}

.right-panel {
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  margin: 6px 8px 0 0;
  padding: 6px 14px;
  font-size: 14px;
  justify-content: space-between;
  overflow-y: auto;
  /* ✅ sirf billing ke andar scroll */
  height: 100%;
}

.customer-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  width: 100%;
}

.customer-info input {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

#customer-info input {
  width: 100%;
  box-sizing: border-box;
  /* ✅ padding+border भी width में count होगा */
}


#bill-items {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex-grow: 1;
}

#bill-items li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed #ccc;
}

#bill-total {
  font-weight: bold;
  font-size: 18px;
  margin-top: 10px;
}

#save-btn,
#print-btn,
#settle-btn {
  padding: 10px 14px;
  margin-right: 10px;
  border: none;
  border-radius: 5px;
  background: #0B7B71;
  color: white;
  cursor: pointer;
}

#back-btn {
  margin-bottom: 10px;
  background: #ccc;
  padding: 8px 12px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* ---- Screen (default) ---- */
#print-content {
  display: none;
}

/* Print Style */
/* ========================== PRINT STYLES ========================== */
@media print {

  /* ❶ Paper margins (reduce top to kill blank band) */
  @page {
    margin: 5mm 5mm 5mm 5mm;
    /* Top  Right  Bottom  Left */
  }

  /* ❷ Zero‑out the body’s screen margin/padding */
  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
  }

  /* ❸ Hide everything except #print‑content */
  body * {
    visibility: hidden !important;
  }

  #print-content,
  #print-content * {
    visibility: visible !important;
  }

  /* ❹ Pin the bill to the very top‑left and show full size */
  #print-content {
    position: absolute;
    top: 0;
    left: 0;
    display: block !important;
    margin: 0;
    padding: 0;
    font-family: monospace;
    font-size: 14px;
    background: white;
    box-sizing: border-box;
    /* If your bills are still bleeding onto page 2,
       uncomment the next two lines and tweak the scale: */
    /* transform: scale(0.94);
       transform-origin: top left; */
  }

  /* ❺ Keep table rows together */
  #print-content table,
  #print-content tr,
  #print-content td,
  #print-content th {
    page-break-inside: avoid;
  }

  /* ---------- existing table styles (unchanged) ---------- */
  #print-content table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    word-wrap: break-word;
  }

  #print-content th,
  #print-content td {
    border: 1px solid #000;
    padding: 6px;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #print-content th:first-child,
  #print-content td:first-child {
    width: 40px;
    text-align: center;
  }

  #print-content th:nth-child(2),
  #print-content td:nth-child(2) {
    width: 160px;
    text-align: left;
  }

  #print-content th:nth-child(3),
  #print-content td:nth-child(3) {
    width: 50px;
    text-align: center;
  }

  #print-content th:nth-child(4),
  #print-content td:nth-child(4) {
    width: 60px;
  }

  #print-content th:nth-child(5),
  #print-content td:nth-child(5) {
    width: 80px;
  }

  #print-content h2 {
    font-family: sans-serif;
    font-size: 22px;
    line-height: 28px;
    margin: 0 0 6px 0;
  }
}

#discount-section .discount-row {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

#tax-section div {
  font-size: 14px;
  margin: 4px 0;
  color: #333;
}

/* ======================== END PRINT STYLES ======================== */


/* === Billing top bar (Back + Current Table) === */
.billing-header {
  display: flex;
  /* एक ही पंक्ति में */
  align-items: center;
  /* vertical centre */
  gap: 12px;
  /* button‑heading के बीच की दूरी */
  margin-bottom: 10px;
  /* नीचे थोड़ा space */
}

.billing-header h2 {
  flex: 1;
  /* बाकी चौड़ाई भर ले */
  text-align: center;
  /* heading बिलकुल बीच में */
  margin: 0;
  /* default margin हटाओ */
}

.bill-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
  overflow-y: auto;
}

.bill-header,
.bill-row {
  display: grid;
  grid-template-columns: 30px 1fr 40px 80px;
  /* delete | item | qty | rate */
  gap: 8px;
  padding: 6px 0;
  align-items: center;
  border-bottom: 1px dashed #ccc;
  font-size: 14px;
}

/* Chrome, Safari, Edge के लिए */
.bill-row input[type="number"]::-webkit-inner-spin-button,
.bill-row input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox के लिए */
.bill-row input[type="number"] {
  -moz-appearance: textfield;
}


.bill-header {
  font-weight: bold;
  border-bottom: 2px solid #666;
}

.bill-row .delete-icon {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Center align the Qty column */
.bill-header div:nth-child(3),
.bill-row div:nth-child(3) {
  text-align: center;
}


.button-group {
  display: flex;
  gap: 12px;
  /* ✅ sabke beech equal gap */
  justify-content: center;
  /* ✅ center align */
  margin-top: 10px;
}

.button-group button {
  flex: unset;
  /* ✅ sab button apni width le */
  min-width: 0px;
  /* ✅ sab ek size ke ho jaye */
  padding: 6px 10px;
  /* ✅ height thodi kam */
  background-color: teal;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  /* ✅ text thoda chhota */
}


/* 🔹 Discount input से up/down arrows हटाने के लिए (Chrome, Safari, Edge) */
#discount-input::-webkit-outer-spin-button,
#discount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* 🔹 Firefox के लिए */
#discount-input {
  -moz-appearance: textfield;
}

/* 🔹 Discount input को right-align करने के लिए */
.bill-line {
  border: none;
  border-top: 1px solid #ccc;
  margin: 4px 0;
  /* reduce vertical gap */
}

.total-row,
.discount-row,
.grand-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  /* smaller font */
  font-weight: bold;
  margin: 4px 0;
  /* tighter row spacing */
}

.total-row label,
.grand-total-row label {
  flex: 1;
}

#bill-total,
#grand-total {
  flex: 0;
  min-width: 80px;
  text-align: right;
  display: inline-block;
}


.discount-row {
  display: flex;
  justify-content: center;
  /* ✅ अब बीच में होगा */
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  padding: 8px 12px;
  background: #f5f5f5;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.discount-row label {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

#discount-input {
  width: 60px;
  text-align: right;
  padding: 6px 8px;
  border: 1px solid #bbb;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  transition: border 0.2s;
}

#discount-input:focus {
  border-color: #0B7B71;
  outline: none;
  box-shadow: 0 0 0 2px rgba(11, 123, 113, 0.2);
}

#tax-section div {
  font-size: 14px;
  margin: 4px 0;
  color: #333;
}


/* Right aligned numbers */
.total-row span,
.grand-total-row span {
  min-width: 70px;
  text-align: right;
  display: inline-block;
}

/* Remove spinners from number input Chrome/Safari */
#discount-input::-webkit-outer-spin-button,
#discount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.top-bar {
  position: absolute;
  top: 12px;
  left: 20px;
  /* moved from right to left */
  z-index: 2001;
  /* above overlay */
}



.menu-icon {
  width: 30px;
  height: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.menu-icon div {
  height: 4px;
  background: #333;
  border-radius: 2px;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  background: rgb(0, 0, 0);
  box-shadow: 2px 0 6px rgba(248, 0, 0, 0.2);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 2000;
  /* 🔼 Make sure it's above everything else */
  padding: 0;
  display: flex;
  flex-direction: column;
}


.drawer.show {
  transform: translateX(0);
}

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 999;
  display: none;
}

.drawer-overlay.show {
  display: block;
}

.drawer-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
  /* ✅ add scroll in case content grows */
}


.drawer h3 {
  margin-bottom: 10px;
  color: #e0e0e0
}

.drawer ul {
  list-style: none;
  padding-left: 0;
}

.logout-btn {
  background: #fa1a01;
  color: white;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 20px;
  margin-bottom: 10px;
  /* ✅ added to keep it visible */
}

.hidden {
  display: none;
}

.drawer-btn {
  width: 100%;
  padding: 10px;
  margin-top: 20px;
  background-color: gold;
  color: rgb(0, 0, 0);
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}