:root {
  --brown: #176b63;
  --brown2: #0f5b54;
  --cream: #f6f8f7;
  --card: #ffffff;
  --text: #202b28;
  --muted: #66736e;
  --border: #dfe7e3;
  --orange: #f4b544;
  --green: #237a4b;
  --red: #b42318;
  --shadow: 0 4px 14px rgba(28, 65, 57, 0.07);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
}
.app {
  min-height: 100vh;
}
header {
  height: 64px;
  background: var(--brown);
  color: white;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 20;
}
header h1 {
  font-size: 19px;
  margin: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.icon-btn {
  background: transparent;
  color: white;
  font-size: 25px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.layout {
  display: flex;
}
.drawer {
  position: fixed;
  left: 0;
  top: 64px;
  bottom: 0;
  width: 280px;
  background: white;
  border-right: 1px solid var(--border);
  padding: 12px 12px 10px;
  z-index: 15;
  transform: translateX(-100%);
  transition: 0.22s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drawer.open {
  transform: translateX(0);
}
.drawer-nav-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 8px;
}
.drawer-user {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 8px;
  background: #fff;
}
.drawer-user-name {
  font-weight: 800;
  margin-bottom: 8px;
}
.logout-btn {
  width: 100%;
  background: #f7dedd;
  color: #a8342d;
  padding: 11px 12px;
  border-radius: 10px;
  font-weight: 800;
}
.report-bar {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.report-body {
  display: none;
  margin-top: 14px;
}
.report-body.open {
  display: block;
}
.date-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}
.date-nav .date-label {
  font-weight: 800;
  min-width: 170px;
  text-align: center;
}
.review-red {
  border-left: 5px solid var(--red);
  background: #fff8f7;
}
.done-kot {
  opacity: 0.82;
  background: #faf8f5;
}
.order-card {
  cursor: pointer;
}
.order-card:hover {
  border-color: var(--brown2);
}
.drawer .brand {
  font-weight: 800;
  color: var(--brown);
  padding: 10px 12px 18px;
}
.navbtn {
  width: 100%;
  text-align: left;
  background: white;
  padding: 12px;
  border-radius: 10px;
  margin: 3px 0;
  color: var(--text);
}
.navbtn:hover,
.navbtn.active {
  background: #f2e7dc;
  color: var(--brown);
  font-weight: 700;
}
.main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px;
}
.page {
  display: none;
}
.page.active {
  display: block;
}
.page > .sub,
.page > .row .sub {
  display: none !important;
}
h2 {
  margin: 0 0 6px;
  font-size: 25px;
}
.sub {
  color: var(--muted);
  margin-bottom: 18px;
}
.grid {
  display: grid;
  gap: 16px;
}
.g2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.g3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.g4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.stat strong {
  font-size: 28px;
  display: block;
  margin-top: 7px;
}
.stat span {
  color: var(--muted);
  font-size: 13px;
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  color: var(--text);
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--brown2);
  box-shadow: 0 0 0 3px rgba(107, 63, 43, 0.09);
}
.btn {
  padding: 11px 15px;
  border-radius: 10px;
  background: #eee5dd;
  color: var(--text);
  font-weight: 700;
}
.btn.primary {
  background: var(--brown);
  color: white;
}
.btn.success {
  background: #e1f1e7;
  color: var(--green);
}
.btn.danger {
  background: #fae5e2;
  color: var(--red);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.between {
  justify-content: space-between;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 12px 9px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}
th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eee5dd;
  font-size: 12px;
  font-weight: 700;
}
.badge.green {
  background: #e1f1e7;
  color: var(--green);
}
.badge.orange {
  background: #fff0dc;
  color: #9a5c12;
}
.badge.red {
  background: #fae5e2;
  color: var(--red);
}
.section-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.full {
  grid-column: 1/-1;
}
.menu-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 7px 0;
}
.menu-item small {
  color: var(--muted);
  display: block;
}
.bill-line {
  display: grid;
  grid-template-columns: 1fr 75px 90px 30px;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.total-line {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
}
.total-line.final {
  font-size: 19px;
  font-weight: 800;
  padding-top: 12px;
}
.cake-card {
  border-left: 5px solid var(--brown2);
}
.cake-card.upcoming {
  background: #fff9f0;
}
.small-input {
  max-width: 180px;
}
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 10, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 15px;
}
.modal-bg.show {
  display: flex;
}
.modal {
  background: white;
  border-radius: 18px;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 20px;
}
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: min(410px, 100%);
  background: white;
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.logo {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: var(--brown);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 22px;
  margin-bottom: 16px;
}
.notice {
  padding: 12px;
  border-radius: 10px;
  background: #fff5e9;
  color: #7b5128;
  font-size: 13px;
  margin: 12px 0;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 30px;
}
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 64px 0 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 14;
}
.drawer-overlay.show {
  display: block;
}
@media (min-width: 900px) {
  .drawer {
    position: fixed;
  }
  .drawer.open {
    transform: translateX(0);
  }
  .drawer-nav-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 8px;
  }
  .drawer-user {
    flex: 0 0 auto;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 8px;
    background: #fff;
  }
  .drawer-user-name {
    font-weight: 800;
    margin-bottom: 8px;
  }
  .logout-btn {
    width: 100%;
    background: #f7dedd;
    color: #a8342d;
    padding: 11px 12px;
    border-radius: 10px;
    font-weight: 800;
  }
  .report-bar {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .report-body {
    display: none;
    margin-top: 14px;
  }
  .report-body.open {
    display: block;
  }
  .date-nav {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .date-nav .date-label {
    font-weight: 800;
    min-width: 170px;
    text-align: center;
  }
  .review-red {
    border-left: 5px solid var(--red);
    background: #fff8f7;
  }
  .done-kot {
    opacity: 0.82;
    background: #faf8f5;
  }
  .order-card {
    cursor: pointer;
  }
  .order-card:hover {
    border-color: var(--brown2);
  }
  .main {
    padding-left: 24px;
  }
  .drawer-overlay {
    display: none !important;
  }
}
@media (max-width: 650px) {
  .date-nav .date-label {
    min-width: 0;
  }
  .main {
    padding: 14px;
  }
  .g2,
  .g3,
  .g4,
  .form-grid {
    grid-template-columns: 1fr;
  }
  header {
    height: 58px;
  }
  .drawer {
    top: 58px;
    width: 60vw;
    min-width: 250px;
  }
  .drawer-overlay {
    inset: 58px 0 0;
  }
  .bill-line {
    grid-template-columns: 1fr 65px 75px 30px;
  }
  h2 {
    font-size: 22px;
  }
}

.category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.category-btn {
  background: #f0e6dc;
  color: var(--brown);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
}
.category-btn.active {
  background: var(--brown);
  color: #fff;
}
.category-products {
  display: none;
  margin: 8px 0 14px;
  padding: 8px;
  background: #fcfaf7;
  border-radius: 12px;
}
.category-products.open {
  display: block;
}
.ready-dispatch {
  background: #f3d4ad !important;
  color: #6b3f2b !important;
  border: 1px solid #d9a56d !important;
  font-weight: 900;
}
.phone-invalid {
  border: 2px solid #c0392b !important;
  background: #fff4f3 !important;
}
.phone-help {
  color: #c0392b;
  font-size: 12px;
  margin-top: 5px;
}
.calendar-modal {
  max-width: 900px !important;
  width: 94vw !important;
  max-height: 94vh !important;
  overflow: auto;
}
.fullscreen-panel {
  width: 100% !important;
  max-width: none !important;
  height: 100vh !important;
  max-height: none !important;
  border-radius: 0 !important;
  padding: 28px !important;
  overflow: auto;
}
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  background: #292521;
  color: #fff;
  padding: 13px 17px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.attendance-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.legend-chip {
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
}
.legend-present {
  background: #e5f4eb;
  color: #287a4a;
}
.legend-leave {
  background: #f9dce7;
  color: #9b3f62;
}
.legend-absent {
  background: #ffe1c7;
  color: #a65a16;
}
.legend-holiday {
  background: #f4e4cf;
  color: #795548;
}
.attendance-calendar-scroll {
  width: 100%;
  max-height: calc(100vh - 300px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f5eee5;
  -webkit-overflow-scrolling: touch;
}
.attendance-calendar-inner {
  min-width: 720px;
  padding: 8px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(92px, 1fr));
  gap: 6px;
  background: #f5eee5;
  padding: 0;
  border-radius: 14px;
}
.calendar-head {
  font-weight: 800;
  text-align: center;
  padding: 8px;
  color: #6b3f2b;
}
.cal-day {
  background: #fffaf2;
  border: 1px solid #e5d9cb;
  border-radius: 10px;
  min-height: 92px;
  padding: 7px;
  cursor: pointer;
}
.cal-day.present {
  background: #e9f7ef;
}
.cal-day.leave {
  background: #f9dce7;
}
.cal-day.absent {
  background: #ffe1c7;
}
.cal-day.holiday {
  background: #f4e4cf;
  cursor: default;
}
.cal-day.future-absent {
  opacity: 0.9;
}
.cal-day.holiday {
  background: #f4e4cf;
}
.cal-day .num {
  font-weight: 900;
}
.cal-day .status {
  font-size: 11px;
  margin-top: 8px;
  font-weight: 800;
}
.cal-day .status.present {
  color: #26734d;
}
.cal-day .status.absent {
  color: #b53a32;
}
.cal-day .status.leave {
  color: #a66a16;
}
.cal-day .status.holiday {
  color: #795548;
}
.customer-history-card {
  cursor: pointer;
}
.complete-advance-row {
  background: #f2e7dc;
  border-bottom: 1px solid #dfcdbd;
  padding: 13px 10px;
  margin: 0;
  border-radius: 10px;
}
.advance-complete-items {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}
.advance-complete-item {
  background: #fffaf4;
  border: 1px solid #e2d4c6;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 13px;
}
.advance-form-card {
  margin-bottom: 16px;
}
.draft-wa {
  margin-top: 10px;
  width: 100%;
}
.history-unpaid {
  border-left: 4px solid #c0392b;
}
.history-paid {
  border-left: 4px solid #6f9f7a;
}
.pending-highlight {
  background: #fbe4e2;
  color: #b42318;
  padding: 5px 9px;
  border-radius: 8px;
  font-weight: 900;
  display: inline-block;
}
.customer-bills-scroll {
  max-height: calc(100vh - 270px);
  overflow: auto;
  padding-right: 4px;
}
.payment-record-panel {
  max-width: 520px !important;
  width: 94vw !important;
}
.payment-method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.payment-method-btn {
  border: 1px solid var(--border);
  background: #fff;
  padding: 11px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}
.payment-method-btn.active {
  background: #6b3f2b;
  color: #fff;
  border-color: #6b3f2b;
}
.payment-amount-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #faf7f3;
}
.section-label {
  font-weight: 900;
  margin: 14px 0 8px;
}
.database-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.stat-grid-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.stat-cell {
  padding: 18px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat-cell:nth-child(2n) {
  border-right: 0;
}
.stat-cell:nth-child(3),
.stat-cell:nth-child(4) {
  border-bottom: 0;
}
.stat-cell strong {
  font-size: 25px;
  display: block;
  margin-top: 5px;
}
.stat-cell span {
  color: var(--muted);
  font-size: 13px;
}
.day-report-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.day-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.day-report-title {
  font-size: 22px;
  font-weight: 900;
}
.day-report-date {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}
.day-report-nav {
  display: flex;
  gap: 8px;
}
.day-report-nav .btn {
  min-width: 44px;
  padding: 10px 12px;
}
.day-report-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.day-metric {
  padding: 16px;
  border-right: 1px solid var(--border);
  min-height: 96px;
}
.day-metric:last-child {
  border-right: 0;
}
.day-metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}
.day-metric strong {
  font-size: 25px;
}
.dashboard-section {
  margin-bottom: 16px;
}
.dashboard-total-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.dashboard-total-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 18px;
  font-weight: 900;
}
.dashboard-total-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.dashboard-total-cell {
  padding: 18px;
  border-right: 1px solid var(--border);
}
.dashboard-total-cell:last-child {
  border-right: 0;
}
.dashboard-total-cell span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.dashboard-total-cell strong {
  display: block;
  font-size: 24px;
  margin-top: 6px;
}
@media (max-width: 700px) {
  .day-report-metrics,
  .dashboard-total-grid {
    grid-template-columns: 1fr 1fr;
  }
  .day-metric:nth-child(2) {
    border-right: 0;
  }
  .day-metric:nth-child(3),
  .day-metric:nth-child(4) {
    border-top: 1px solid var(--border);
  }
  .day-report-head {
    align-items: flex-start;
  }
  .day-report-title {
    font-size: 19px;
  }
  .dashboard-total-cell:nth-child(2) {
    border-right: 0;
  }
  .dashboard-total-cell:nth-child(3),
  .dashboard-total-cell:nth-child(4) {
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 650px) {
  .stat-cell {
    padding: 14px;
  }
  .stat-cell strong {
    font-size: 21px;
  }
}

.order-card,
.cake-card,
.kot-card {
  box-shadow:
    -6px 0 0 #6b3f2b,
    0 2px 10px rgba(70, 45, 30, 0.08);
}
.complete-order-card {
  background: #fff;
  border-left: 6px solid #6b3f2b;
  padding: 10px 12px;
  margin: 0 0 8px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(70, 45, 30, 0.06);
}
.complete-order-card .menu-item {
  background: transparent;
  border: 0;
  padding: 5px 0;
}
.payment-breakdown {
  display: none;
  margin-top: 12px;
}
.payment-breakdown.show {
  display: block;
}

/* Mintu retail adaptations */
.modal-bg {
  align-items: flex-end;
}
.modal {
  width: min(620px, 100%);
  border-radius: 20px 20px 0 0;
  max-height: 92vh;
  padding: 20px;
}
.variant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.product-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px;
  background: #fff;
  cursor: pointer;
}
.product-card:hover {
  border-color: var(--brown2);
  background: #fcfaf7;
}
.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.category-tab {
  padding: 10px 14px;
  border-radius: 999px;
  background: #f2e7dc;
  color: var(--brown);
  font-weight: 800;
}
.category-tab.active {
  background: var(--brown);
  color: #fff;
}
.bill-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(360px, 0.7fr);
  gap: 16px;
}
.billbox {
  position: sticky;
  top: 78px;
  align-self: start;
}
.voice-row {
  display: flex;
  gap: 10px;
}
.voice-row input {
  flex: 1;
}
.voice-btn {
  white-space: nowrap;
}
.voice-btn.listening {
  background: #fae5e2;
  color: var(--red);
}
.bill-head {
  display: grid;
  grid-template-columns: 1fr 65px 90px 90px 90px 32px;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.mintu-bill-line {
  display: grid;
  grid-template-columns: 1fr 65px 90px 90px 90px 32px;
  gap: 7px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.mintu-bill-line .small-meta {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.paygrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.paybtn {
  border: 1px solid var(--border);
  background: #fff;
  padding: 11px;
  border-radius: 10px;
  font-weight: 800;
}
.paybtn.active {
  background: var(--brown);
  color: #fff;
  border-color: var(--brown);
}
.discountbox {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 10px;
}
.totalrow {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}
.totalrow.final {
  font-size: 20px;
  font-weight: 900;
  padding-top: 12px;
}
.suggestion-card {
  border-left: 5px solid #d79a39;
}
.staff-detail {
  margin-top: 16px;
}
.staff-card {
  cursor: pointer;
}
.staff-card:hover {
  border-color: var(--brown2);
}
.inventory-placeholder {
  border-left: 5px solid #d79a39;
}
.report-range-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.report-range-summary .card {
  padding: 13px;
}
.mini-stat strong {
  display: block;
  font-size: 20px;
  margin-top: 5px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.wrap {
  flex-wrap: wrap;
}
.pill {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eee5dd;
  font-size: 12px;
  font-weight: 800;
}
.pill.green {
  background: #e1f1e7;
  color: var(--green);
}
.pill.amber {
  background: #fff0dc;
  color: #9a5c12;
}
.hidden {
  display: none !important;
}
.draft-add-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}
.bill-qty {
  display: flex;
  align-items: center;
  gap: 4px;
}
.bill-qty button {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
}
.bill-qty input {
  width: 58px;
  text-align: center;
}
.fixed-unit {
  font-weight: 800;
  color: var(--brown);
  text-align: center;
}
.payment-warning {
  border-left: 4px solid var(--red);
  background: #fff1f0;
  color: #9d2d24;
}
.purchase-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.purchase-stat {
  padding: 13px !important;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.purchase-stat span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}
.purchase-stat strong {
  font-size: 21px;
  margin-top: 5px;
}
@media (max-width: 650px) {
  .purchase-stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .purchase-stat {
    min-height: 82px;
  }
  .purchase-stat strong {
    font-size: 18px;
  }
  .mintu-bill-line {
    grid-template-columns: minmax(0, 1fr) 120px 62px 82px 82px 28px;
  }
  .fixed-unit {
    font-size: 12px;
  }
  .bill-qty button {
    width: 28px;
    height: 28px;
  }
  .bill-qty input {
    width: 50px;
  }
}
@media (max-width: 900px) {
  .bill-layout {
    grid-template-columns: 1fr;
  }
  .billbox {
    position: static;
  }
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .report-range-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .variant-grid {
    grid-template-columns: 1fr;
  }
}

/* V52: New Bill visual direction — colourful category navigation, compact text-only products */
#newbill .card {
  background: #fff;
  border-color: #e3e9e6;
  box-shadow: 0 4px 16px rgba(28, 67, 61, 0.07);
}
#newbill .voice-row input {
  background: #fff;
  border-color: #dce5e1;
}
#newbill .btn.primary {
  background: #176b63;
  color: #fff;
}
#newbill .btn.primary:hover {
  background: #125950;
}
#newbill input:focus,
#newbill select:focus {
  border-color: #176b63;
  box-shadow: 0 0 0 3px rgba(23, 107, 99, 0.12);
}
#newbill .main-category-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 3px 2px 10px;
  margin: 0 0 8px;
  border: 0;
  border-bottom: 1px solid #e3e9e6;
  border-radius: 0;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
#newbill .main-category-btn {
  flex: 0 0 86px;
  min-width: 86px;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #e1e8e5 !important;
  border-radius: 13px !important;
  background: #fff !important;
  color: #26332f !important;
  padding: 8px 5px !important;
  font-size: 12px !important;
  line-height: 1.2;
  font-weight: 750;
  white-space: normal;
  box-shadow: 0 2px 5px rgba(24, 55, 49, 0.04) !important;
}
#newbill .main-category-btn .cat-icon {
  font-size: 25px;
  line-height: 1.1;
}
#newbill .main-category-btn.active {
  border: 1.5px solid #176b63 !important;
  background: #eaf5f2 !important;
  color: #125950 !important;
  box-shadow: 0 2px 7px rgba(23, 107, 99, 0.12) !important;
}
#newbill .category-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 8px 0 12px;
  padding: 2px 1px 7px;
  border: 0;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
#newbill .category-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border: 1px solid #dfe7e3;
  border-radius: 10px;
  background: #f8faf9;
  color: #33423d;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
#newbill .category-tab .cat-icon {
  font-size: 16px;
  line-height: 1;
}
#newbill .category-tab.active {
  background: #176b63;
  border-color: #176b63;
  color: #fff;
}
#newbill .product-grid {
  gap: 8px;
}
#newbill .product-card {
  min-width: 0;
  border-color: #e2e8e5;
  border-radius: 12px;
  padding: 11px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(28, 67, 61, 0.045);
}
#newbill .product-card b {
  display: block;
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
#newbill .product-card small {
  display: block;
  margin-top: 5px;
  color: #66736e;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
#newbill .product-card:hover {
  border-color: #176b63;
  background: #f8fcfb;
}
#newbill .paper-add-bottom {
  background: #176b63;
  color: #fff;
}
@media (max-width: 650px) {
  #newbill .main-category-btn {
    flex-basis: 78px;
    min-width: 78px;
    min-height: 72px;
  }
  #newbill .main-category-btn .cat-icon {
    font-size: 23px;
  }
  #newbill .product-card {
    padding: 9px;
  }
  #newbill .product-card b {
    font-size: 13px;
  }
  #newbill .product-card small {
    font-size: 10px;
  }
}

/* Mintu notebook billing UI */
.paper-bill-wrap {
  margin-top: 10px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(55, 44, 100, 0.1);
  background: #f9fbdc;
}
.paper-bill {
  position: relative;
  min-height: 260px;
  padding: 8px 7px 28px 42px;
  color: #111184;
  background-color: #fcfeda;
  background-image: none !important;
  font-family: Calibri, Arial, sans-serif;
  font-weight: 700;
}
.paper-bill:before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: rgba(214, 221, 185, 0.55);
}
.paper-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 4px 10px;
  color: #111184;
}
.paper-title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.2px;
  color: #111184;
}
.paper-hint {
  font-size: 11px;
  opacity: 0.72;
}
.paper-add {
  border: 1px solid rgba(17, 17, 132, 0.35) !important;
  background: rgba(255, 255, 255, 0.45) !important;
  color: #111184 !important;
  font-weight: 700;
}
.paper-table {
  width: 100%;
  overflow-x: auto;
}
.paper-grid {
  display: grid;
  grid-template-columns: 28px minmax(0, 40%) 94px 68px minmax(72px, 1fr) 22px;
  min-width: 0;
  margin-left: -42px;
}
.paper-grid > * {
  min-height: 32px;
  padding: 5px 6px;
  border-right: 1px solid rgba(17, 17, 132, 0.22);
  display: flex;
  align-items: center;
  box-sizing: border-box;
}
.paper-grid > *:last-child {
  border-right: 0;
}
.paper-grid.header {
  font-family: Calibri, Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #111184;
  background: rgba(235, 244, 212, 0.42);
}
.paper-grid.line {
  font-family: Calibri, Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #111184;
  align-items: stretch;
}
.paper-grid.line:hover {
  background: rgba(255, 255, 255, 0.25);
}
.paper-cell {
  width: 100%;
  border: 0 !important;
  outline: 0;
  background: transparent;
  color: #111184;
  font:
    700 14px Calibri,
    Arial,
    sans-serif;
  padding: 2px 3px;
  min-width: 0;
}
.paper-name {
  min-height: 32px;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.18;
  display: block;
}
.paper-cell:focus {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 4px;
  box-shadow: inset 0 -1px 0 rgba(40, 59, 143, 0.35);
}
.paper-name {
  font-weight: 700;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.18;
}
.paper-name-unmatched {
  text-decoration-line: underline;
  text-decoration-color: #e58b26;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
  background-image: none;
}
.paper-unit.locked {
  font-weight: 900;
  text-align: center;
  justify-content: center;
}
.paper-unit select {
  width: 100%;
  border: 0;
  background: transparent;
  color: #283b8f;
  font: inherit;
  font-weight: 800;
  outline: 0;
}
.paper-qty {
  display: grid;
  grid-template-columns: 26px 1fr 26px;
  gap: 2px;
  align-items: center;
}
.paper-step {
  width: 26px;
  height: 26px;
  padding: 0 !important;
  border: 1px solid rgba(40, 59, 143, 0.35) !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.52) !important;
  color: #111184 !important;
  font-weight: 700;
  line-height: 1;
}
.paper-qty-input {
  text-align: center;
  font-weight: 700;
  color: #111184 !important;
}
.paper-rate-input,
.paper-amount {
  font-weight: 700;
  text-align: right;
  color: #111184;
}
.paper-amount {
  justify-content: flex-end;
}
.paper-sn {
  justify-content: center;
  font-weight: 700;
  color: #111184;
  border-right: 0 !important;
  position: relative;
  z-index: 2;
  transform: translateX(-1px);
}
.paper-remove {
  border: 0 !important;
  background: transparent !important;
  color: #9b3b55 !important;
  font-weight: 900;
  font-size: 16px;
  padding: 0 !important;
}
.paper-total {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}
.paper-total-box {
  font-size: 15px;
  font-weight: 700;
  color: #111184;
  padding: 7px 12px;
  border-top: 2px solid rgba(40, 59, 143, 0.42);
  border-bottom: 2px double rgba(40, 59, 143, 0.32);
  min-width: 190px;
  text-align: right;
}
.paper-total-line {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: baseline;
  min-height: 25px;
}
.paper-total-line.main {
  font-size: 27px;
  line-height: 1.05;
  font-weight: 700;
}
.paper-total-line.discount {
  font-size: 14px;
  color: #7a1f1f;
}
.paper-total-line.final {
  font-size: 22px;
  font-weight: 700;
  padding-top: 4px;
  border-top: 1px solid rgba(40, 59, 143, 0.3);
  margin-top: 3px;
  padding-bottom: 2px;
}
.paper-empty {
  padding: 20px 8px;
  text-align: center;
  color: rgba(40, 59, 143, 0.62);
  font-size: 13px;
}
.paper-customer {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr 150px;
  gap: 8px;
}
.paper-small-input {
  border: 1px solid rgba(128, 0, 0, 0.55);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.3);
  color: #7a1f1f;
  padding: 6px 7px;
  font:
    700 13px Calibri,
    Arial,
    sans-serif;
  outline: 0;
}
.paper-small-input::placeholder {
  color: #8b4a4a;
}
.paper-billno {
  border: 1px solid rgba(128, 0, 0, 0.55);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.3);
  color: #7a1f1f;
  padding: 6px 7px;
  font:
    700 13px Calibri,
    Arial,
    sans-serif;
  display: flex;
  align-items: center;
}
.paper-section-label {
  font-size: 11px;
  font-family: Calibri, Arial, sans-serif;
  font-weight: 700;
  color: #111184;
  letter-spacing: 0.4px;
}
.paper-voice-note {
  font-family: Calibri, Arial, sans-serif;
  font-size: 11px;
  color: #111184;
  opacity: 0.75;
  margin: 6px 0 0;
}
@media (max-width: 700px) {
  .paper-bill {
    padding-left: 34px;
  }
  .paper-grid {
    grid-template-columns: 28px minmax(0, 40%) 94px 64px minmax(72px, 1fr) 22px;
    min-width: 0;
    margin-left: -34px;
  }
  .paper-grid > * {
    padding: 4px 4px;
  }
  .paper-qty {
    grid-template-columns: 24px minmax(34px, 1fr) 24px;
  }
  .paper-step {
    width: 24px;
    height: 24px;
  }
  .paper-customer {
    grid-template-columns: 1fr 1fr 105px;
  }
  .paper-title {
    font-size: 14px;
  }
  .paper-total-box {
    min-width: 180px;
  }
  .paper-total-line.main {
    font-size: 25px;
  }
}

@media (max-width: 650px) {
  .main {
    padding: 14px 11px 30px;
  }
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .product-card {
    padding: 11px;
  }
  .voice-row {
    flex-direction: column;
  }
  .paygrid {
    grid-template-columns: 1fr 1fr;
  }
  .bill-head {
    display: none;
  }
  .mintu-bill-line {
    grid-template-columns: minmax(0, 1fr) 58px 72px 82px 82px 28px;
    gap: 5px;
  }
  .mintu-bill-line .item-name {
    min-width: 0;
  }
  .mintu-bill-line .item-name b {
    display: block;
    white-space: normal;
  }
  .mintu-bill-line input {
    padding: 9px 7px;
  }
  .report-range-summary {
    grid-template-columns: 1fr 1fr;
  }
  .day-report-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .day-report-title {
    font-size: 18px;
  }
  .dashboard-total-grid {
    grid-template-columns: 1fr 1fr;
  }
  .drawer {
    width: min(310px, 82vw);
  }
}

/* V7 billing refinements */
.paper-bill {
  overflow: visible;
}
.paper-table {
  overflow: visible;
}
.paper-grid {
  grid-template-columns: 28px minmax(0, 40%) 102px 58px minmax(0, 1fr) 24px;
  margin-left: -42px;
  gap: 0;
}
.paper-grid > * {
  padding: 4px 2px;
}
.paper-sn {
  color: #111184;
  font-weight: 700;
  justify-content: center;
  position: relative;
  z-index: 4;
  transform: translateX(-2px);
}
.paper-grid.header .paper-sn {
  font-size: 10px;
}
.paper-remove {
  border: 1px solid rgba(180, 70, 85, 0.42) !important;
  background: rgba(255, 220, 220, 0.55) !important;
  color: #9b3b55 !important;
  border-radius: 5px !important;
  width: 20px;
  height: 24px;
  display: grid !important;
  place-items: center;
  font-size: 14px !important;
  line-height: 1;
}
.paper-name {
  font-family: Calibri, Arial, sans-serif !important;
  font-weight: 700 !important;
  color: #111184 !important;
}
.paper-rate-input,
.paper-amount {
  padding-left: 2px !important;
  padding-right: 2px !important;
}
.paper-total-box {
  min-width: 210px;
  padding: 8px 4px;
}
.paper-total-line.main {
  font-size: 32px;
  font-weight: 700;
}
.paper-total-line.discount {
  font-size: 15px;
}
.paper-total-line.final {
  font-size: 25px;
}
.paper-billno-top {
  margin-left: auto;
  color: #7a1f1f;
  font:
    700 13px Calibri,
    Arial,
    sans-serif;
  border: 1px solid rgba(128, 0, 0, 0.55);
  border-radius: 5px;
  padding: 5px 7px;
  background: rgba(255, 255, 255, 0.28);
  white-space: nowrap;
}
.paper-customer {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.paper-small-input.name-field {
  grid-column: 1;
}
.paper-small-input.phone-field {
  grid-column: 2;
}
.paper-table .paper-grid.header > div:first-child {
  visibility: hidden;
}
.paper-grid.header {
  grid-template-columns: 28px minmax(0, 40%) 102px 58px minmax(0, 1fr) 24px;
}
.split-auto-note {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
}
.payment-select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-weight: 800;
  font-size: 15px;
}
@media (max-width: 700px) {
  .paper-bill {
    padding-left: 34px;
  }
  .paper-grid,
  .paper-grid.header {
    grid-template-columns: 28px minmax(0, 40%) 100px 56px minmax(0, 1fr) 24px;
    margin-left: -34px;
  }
  .paper-grid > * {
    padding: 4px 2px;
  }
  .paper-qty {
    grid-template-columns: 24px minmax(34px, 1fr) 24px;
  }
  .paper-step {
    width: 24px;
    height: 24px;
  }
  .paper-customer {
    grid-template-columns: 1fr 1fr;
  }
  .paper-billno-top {
    font-size: 11px;
  }
  .paper-total-line.main {
    font-size: 29px;
  }
}

.header-new-bill {
  background: #fff;
  color: var(--brown);
  font-weight: 800;
  border-radius: 10px;
  padding: 9px 13px;
  white-space: nowrap;
}
.header-new-bill:active {
  transform: scale(0.98);
}
.paper-empty-row {
  height: 38px;
  border-bottom: 0 !important;
}
.paper-line-spacer {
  min-height: 190px;
}
.product-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.icon-action {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #f3eee9;
  color: var(--brown);
  font-weight: 900;
}
.icon-action.edit {
  background: #eee9ff;
  color: #4b3d8f;
}
.icon-action.delete {
  background: #fae5e2;
  color: var(--red);
}
.merge-search {
  margin: 10px 0;
}
.merge-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.bottom-sheet {
  align-self: flex-end;
  width: min(680px, 100%);
  max-height: 72vh;
  border-radius: 20px 20px 0 0;
  padding: 20px 20px 26px;
}
.bottom-sheet-bg {
  align-items: flex-end;
}
@media (max-width: 650px) {
  .header-new-bill {
    padding: 8px 10px;
    font-size: 13px;
  }
  .merge-select-grid {
    grid-template-columns: 1fr;
  }
  .paper-empty-row {
    height: 38px;
  }
}
.header-new-bill {
  background: #fff;
  color: var(--brown);
  font-weight: 800;
  border-radius: 10px;
  padding: 9px 13px;
  white-space: nowrap;
}
.header-new-bill:active {
  transform: scale(0.98);
}
.paper-empty-row {
  height: 38px;
  border-bottom: 0 !important;
}
.product-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.icon-action {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #f3eee9;
  color: var(--brown);
  font-weight: 900;
}
.icon-action.edit {
  background: #eee9ff;
  color: #4b3d8f;
}
.icon-action.delete {
  background: #fae5e2;
  color: var(--red);
}
.merge-search {
  margin: 10px 0;
}
.merge-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 650px) {
  .header-new-bill {
    padding: 8px 10px;
    font-size: 13px;
  }
  .merge-select-grid {
    grid-template-columns: 1fr;
  }
  .paper-empty-row {
    height: 38px;
  }
}
.paper-grid.line {
  border-bottom: 0 !important;
}
.paper-empty-row,
.paper-empty-row > * {
  border-bottom: 0 !important;
  border-top: 0 !important;
}
.main-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding: 2px;
}
.main-category-btn {
  border: 1.5px solid #cbb8a6 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #493a2e !important;
  padding: 9px 12px !important;
  font-size: clamp(14px, 1vw + 10px, 17px) !important;
  font-weight: 750;
  box-shadow: none !important;
}
.main-category-btn.active {
  border: 2px solid #75452f !important;
  background: #fffaf5 !important;
  color: #633b28 !important;
  box-shadow: none !important;
}
.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
  padding: 8px 0;
  border-top: 1px solid #e5d7ca;
  border-bottom: 1px solid #e5d7ca;
}
.category-tab {
  padding: 9px 13px;
  border: 1px solid #dfd0c2;
  border-radius: 8px;
  background: #fff;
  color: var(--brown);
  font-weight: 800;
}
.category-tab.active {
  background: var(--brown);
  border-color: var(--brown);
  color: #fff;
}
.cash-denom-row {
  display: grid;
  grid-template-columns: 86px 32px minmax(48px, 72px) 32px;
  gap: 5px;
  align-items: center;
  margin: 5px 0;
}
.cash-denom-row button {
  padding: 3px 0 !important;
  min-width: 30px;
  height: 32px;
}
.cash-denom-row input {
  padding: 7px 10px !important;
  text-align: center;
}
.cash-status {
  font-weight: 900;
}
.cash-status.short {
  color: #b42318;
}
.cash-status.extra,
.cash-status.match {
  color: #16803c;
}
@media (max-width: 650px) {
  .cash-denom-row {
    grid-template-columns: 78px 30px minmax(48px, 1fr) 30px;
    gap: 5px;
  }
  .cash-denom-row input {
    padding: 7px 8px !important;
  }
}

.cash-denom-row {
  display: grid;
  grid-template-columns: minmax(88px, 1fr) 30px minmax(48px, 64px) 30px;
  align-items: center;
  gap: 5px;
  margin: 5px 0;
}
.cash-denom-row .btn {
  min-width: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cash-denom-row input {
  min-width: 0;
  width: 100%;
  text-align: center;
  padding: 7px 9px;
  margin: 0;
}
.cash-denom-row b {
  padding-left: 2px;
}
.cash-status b {
  font-weight: 900;
}
.qty-unit {
  font-size: 10px;
  font-weight: 700;
  color: #333;
  white-space: nowrap;
  align-self: center;
  margin: 0 2px;
}
.paper-qty {
  gap: 2px;
}

/* V14: compact saved-bill product list with notebook continuity */
.saved-paper-list {
  background: #fffedb;
  border: 1px solid #eadfbd;
  border-radius: 18px;
  padding: 8px 12px;
  color: #111184;
  overflow: hidden;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 34px,
    #cfe3b9 35px,
    #cfe3b9 36px
  );
}
.saved-paper-row {
  padding: 5px 0 6px;
  border-bottom: 1px solid #cfe3b9;
  min-width: 0;
}
.saved-paper-row:last-child {
  border-bottom: 0;
}
.saved-paper-name {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  line-height: 1.25;
  color: #111184;
  font-size: 15px;
}
.saved-paper-no {
  flex: 0 0 auto;
  font-weight: 700;
}
.saved-paper-name b {
  min-width: 0;
  overflow-wrap: anywhere;
}
.saved-paper-numbers {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
  font-size: 12px;
  line-height: 1.3;
  color: #111184;
  margin: 3px 0 0 22px;
}
.saved-paper-numbers span {
  min-width: 0;
  white-space: nowrap;
}
.saved-paper-numbers b {
  font-weight: 800;
}
.store-main-card {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.store-main-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  background: linear-gradient(105deg, #f2e4d3, #fff);
}
.store-main-summary::-webkit-details-marker,
.store-category-row summary::-webkit-details-marker {
  display: none;
}
.store-main-summary b {
  font-size: 16px;
}
.store-chevron {
  font-weight: 900;
  color: var(--brown);
}
.store-main-actions {
  padding: 0 12px 10px;
}
.store-category-list {
  padding: 0 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.store-category-row {
  border: 1px solid #eee3d8;
  border-radius: 9px;
  overflow: hidden;
}
.store-category-row > summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 10px;
  cursor: pointer;
  gap: 10px;
}
.store-category-row > summary span:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.store-category-row > summary small {
  color: var(--muted);
  font-size: 11px;
}
.store-category-content {
  padding: 0 10px 10px;
}
.store-product-preview {
  margin: 0 0 8px;
}
.store-product-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #eee7df;
  font-size: 12px;
}
.store-product-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.store-product-row b {
  white-space: nowrap;
}
@media (max-width: 420px) {
  .saved-paper-list {
    padding: 7px 8px;
  }
  .saved-paper-numbers {
    grid-template-columns: 1fr 1fr 1fr;
    font-size: 11px;
    margin-left: 18px;
    gap: 2px;
  }
  .saved-paper-name {
    font-size: 14px;
  }
}

.paper-toolbar-v15 {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 5px 4px 10px;
}
.paper-toolbar-v15 .paper-billno-top {
  align-self: flex-end;
}
.paper-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}
.paper-toolbar-right {
  display: flex;
  gap: 6px;
}
.paper-toolbar-v15 .paper-add {
  min-height: 42px;
  padding: 7px 12px;
}
.paper-toolbar-v15 .customer-action {
  margin-right: auto;
}
@media (max-width: 520px) {
  .paper-toolbar-actions {
    gap: 6px;
  }
  .paper-toolbar-v15 .paper-add {
    padding: 7px 10px;
    font-size: 13px;
  }
}
.pending-order-card {
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
}
.pending-order-card:hover {
  border-color: var(--brown2);
}
.pending-order-card.paid-card {
  background: #e5f5eb;
  border-color: #b7dfc5;
}
.pending-order-card.unpaid-card {
  background: #fde9e7;
  border-color: #efc0bb;
}
.pending-order-card.khata-card {
  background: #fff0dc;
  border-color: #edc48c;
}
.order-status-rect {
  display: inline-block;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

/* V22: clear payment/delivery states and reusable cash-change panel */
.bill-status-checks {
  display: grid;
  gap: 9px;
}
.bill-status-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px;
  background: #fffdf9;
  cursor: pointer;
}
.bill-status-check input {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin: 2px 0 0;
  accent-color: #6b3f2b;
}
.bill-status-check span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bill-status-check small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}
.cash-change-panel {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fffdf9;
  margin-top: 6px;
}
.cash-change-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr) minmax(0, 1fr);
  gap: 7px;
  align-items: stretch;
}
.cash-change-cell {
  min-width: 0;
  padding: 5px 6px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid #eee3d9;
}
.cash-change-label {
  display: block;
  font-size: 11px;
  line-height: 1.15;
  font-weight: 800;
  margin-bottom: 5px;
  white-space: normal;
}
.cash-change-cell input {
  padding: 7px 6px;
  font-size: 14px;
  min-width: 0;
  text-align: center;
}
.cash-change-value {
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  padding: 8px 2px;
  overflow-wrap: anywhere;
}
.cash-change-in {
  color: #187a45;
}
.cash-change-total {
  color: #5846a3;
}
.cash-change-out {
  color: #c7352e;
}
.cash-change-caption {
  display: block;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  margin-top: 3px;
}
.cash-change-panel input[readonly] {
  background: #f5f1ec;
  font-weight: 800;
}
.cash-change-panel .cash-change-result {
  display: none;
}

/* V45: clean cash calculator with clear directional arrows */
.cash-change-panel {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fffdf9;
  margin-top: 6px;
}
.cash-change-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}
.cash-change-cell {
  min-width: 0;
  padding: 9px 8px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #eee3d9;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.cash-change-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  margin-top: auto;
}
.cash-hand-icon {
  width: clamp(32px, 5vw, 48px);
  height: clamp(32px, 5vw, 48px);
  flex: 0 0 auto;
}
.cash-change-arrow {
  width: clamp(28px, 4vw, 40px);
  height: clamp(28px, 4vw, 40px);
  align-self: auto;
  flex: 0 0 auto;
}
.cash-change-cell input[readonly] {
  color: #c7352e;
  background: #fff2f0;
  border: 1px solid #e7aaa5;
}
.cash-change-label {
  display: block;
  font-size: clamp(12px, 1.2vw + 8px, 16px);
  line-height: 1.2;
  font-weight: 800;
  margin: 0;
  white-space: normal;
  color: #292521;
}
.cash-change-cell input {
  padding: 8px 6px;
  font-size: clamp(14px, 1vw + 10px, 18px);
  min-width: 0;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}
.cash-change-value {
  font-size: clamp(15px, 1.3vw + 10px, 20px);
  font-weight: 900;
  text-align: center;
  padding: 8px 2px;
  overflow-wrap: anywhere;
}
.cash-change-in {
  color: #187a45;
}
.cash-change-total {
  color: #5846a3;
}
.cash-change-out {
  color: #c7352e;
}
.cash-change-arrow {
  width: 32px;
  height: 32px;
  align-self: center;
  flex: 0 0 auto;
}
.cash-change-arrow.down {
  color: #188348;
}
.cash-change-arrow.up {
  color: #cf302a;
}
.cash-change-panel input[readonly] {
  background: #f5f1ec;
  font-weight: 800;
}
.cash-change-panel .cash-change-caption {
  display: none;
}
.cash-change-cell #returnCash,
.cash-change-cell #splitReturnCash {
  display: none;
}
@media (max-width: 390px) {
  .cash-change-row {
    gap: 5px;
  }
  .cash-change-cell {
    padding: 7px 5px;
    gap: 6px;
  }
  .cash-change-label {
    font-size: 12px;
  }
  .cash-change-cell input,
  .cash-change-value {
    font-size: 14px;
    padding: 7px 2px;
  }
  .cash-change-arrow {
    width: 28px;
    height: 28px;
  }
}

/* V45: inline catalogue autocomplete for manually entered bill lines */
.paper-name-wrap {
  position: relative;
  min-width: 0;
  width: 100%;
}
.paper-name-wrap .paper-name {
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.product-autocomplete {
  position: fixed;
  z-index: 99999;
  background: #fff;
  border: 2px solid #d8c7b9;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(45, 30, 20, 0.28);
  max-height: min(36vh, 280px);
  overflow: auto;
  overscroll-behavior: contain;
}
.product-autocomplete:empty {
  display: none;
}
.product-autocomplete button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #eee4dc;
  background: #fff;
  padding: 12px 11px;
  color: #292521;
  font-size: 15px;
  line-height: 1.3;
  cursor: pointer;
  touch-action: manipulation;
}
.product-autocomplete button:last-child {
  border-bottom: 0;
}
.product-autocomplete button:active,
.product-autocomplete button:hover {
  background: #fff1df;
}
.product-autocomplete small {
  display: block;
  color: #776f68;
  margin-top: 3px;
  font-size: 11px;
}

/* V16: responsive compact billing and fixed-height saved item list */
.paper-bill-wrap {
  background: #fcfeda !important;
}
.paper-bill {
  background-color: #fcfeda !important;
}
.paper-grid,
.paper-grid.header {
  grid-template-columns:
    24px minmax(0, 1fr) minmax(112px, 1.08fr)
    52px 58px 22px !important;
  min-width: 0 !important;
}
.paper-grid > * {
  padding-left: 2px !important;
  padding-right: 2px !important;
  min-width: 0 !important;
}
.paper-grid.header {
  font-size: 10px !important;
  letter-spacing: 0.25px !important;
}
.paper-grid.header > div:nth-child(5) {
  white-space: nowrap;
}
.paper-name {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  min-width: 0 !important;
  line-height: 1.16 !important;
}
.paper-qty {
  display: grid !important;
  grid-template-columns: 22px minmax(22px, 1fr) auto 22px !important;
  gap: 1px !important;
  min-width: 0 !important;
  align-items: center !important;
}
.paper-qty-input {
  width: 100% !important;
  min-width: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  font-size: 13px !important;
}
.paper-qty .qty-unit {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 10px !important;
  white-space: nowrap !important;
}
.paper-step {
  width: 22px !important;
  height: 24px !important;
  min-width: 22px !important;
}
.paper-rate-input {
  padding: 0 !important;
  text-align: right !important;
  font-size: 13px !important;
}
.paper-amount {
  padding: 0 !important;
  justify-content: flex-end !important;
  white-space: nowrap !important;
  font-size: 13px !important;
}
.saved-paper-list {
  background: #fcfeda !important;
  background-image: none !important;
  border: 1px solid #eadfbd;
  border-radius: 16px;
  padding: 8px 12px;
  color: #111184;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 420px;
  overscroll-behavior: contain;
}
.saved-paper-row {
  background: transparent;
  border-bottom: 2px solid #cfe3b9 !important;
  padding: 6px 0 7px;
  min-width: 0;
}
.saved-paper-row:last-child {
  border-bottom: 0 !important;
}
@media (max-width: 700px) {
  .paper-bill {
    background-color: #fcfeda !important;
  }
  .paper-grid,
  .paper-grid.header {
    grid-template-columns:
      20px minmax(0, 1fr) minmax(108px, 0.95fr)
      45px 53px 20px !important;
    margin-left: -34px !important;
    min-width: 0 !important;
  }
  .paper-grid > * {
    padding-left: 1px !important;
    padding-right: 1px !important;
  }
  .paper-grid.header {
    font-size: 9px !important;
    letter-spacing: 0 !important;
  }
  .paper-qty {
    grid-template-columns: 20px minmax(20px, 1fr) auto 20px !important;
    gap: 0 !important;
  }
  .paper-step {
    width: 20px !important;
    height: 22px !important;
    min-width: 20px !important;
    font-size: 12px !important;
  }
  .paper-qty-input {
    font-size: 12px !important;
  }
  .paper-qty .qty-unit {
    font-size: 9px !important;
    letter-spacing: -0.2px;
  }
  .paper-rate-input,
  .paper-amount {
    font-size: 12px !important;
  }
  .saved-paper-list {
    max-height: 420px;
    padding: 7px 9px;
  }
}

/* V17: tightly packed bill columns for small screens */
.paper-grid,
.paper-grid.header {
  grid-template-columns:
    20px minmax(0, 1.45fr) minmax(88px, 0.78fr)
    42px 50px 19px !important;
  min-width: 0 !important;
}
.paper-grid > * {
  min-width: 0 !important;
  padding-left: 1px !important;
  padding-right: 1px !important;
}
.paper-qty {
  display: grid !important;
  grid-template-columns: 18px minmax(14px, 1fr) auto 18px !important;
  gap: 0 !important;
  min-width: 0 !important;
}
.paper-step {
  width: 18px !important;
  min-width: 18px !important;
  height: 20px !important;
  padding: 0 !important;
  font-size: 11px !important;
}
.paper-qty-input {
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 !important;
  font-size: 12px !important;
}
.paper-qty .qty-unit {
  font-size: 9px !important;
  letter-spacing: -0.25px !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
}
.paper-rate-input {
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: right !important;
  font-size: 12px !important;
}
.paper-amount {
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: right !important;
  justify-content: flex-end !important;
  white-space: nowrap !important;
  font-size: 12px !important;
  letter-spacing: -0.25px !important;
}
.paper-name {
  padding: 1px !important;
  font-size: 13px !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}
.paper-grid.header {
  font-size: 9px !important;
  letter-spacing: 0 !important;
}
@media (max-width: 700px) {
  .paper-grid,
  .paper-grid.header {
    grid-template-columns:
      18px minmax(0, 1.35fr) minmax(84px, 0.82fr)
      39px 48px 18px !important;
    margin-left: -34px !important;
  }
  .paper-grid > * {
    padding-left: 1px !important;
    padding-right: 1px !important;
  }
  .paper-qty {
    grid-template-columns: 17px minmax(12px, 1fr) auto 17px !important;
    gap: 0 !important;
  }
  .paper-step {
    width: 17px !important;
    min-width: 17px !important;
    height: 19px !important;
    font-size: 10px !important;
  }
  .paper-qty-input,
  .paper-rate-input,
  .paper-amount {
    font-size: 11px !important;
  }
  .paper-qty .qty-unit {
    font-size: 8px !important;
    letter-spacing: -0.3px !important;
  }
  .paper-name {
    font-size: 12px !important;
  }
}

/* V18: genuinely narrower quantity/rate columns and scrollable saved bill items */
.paper-grid,
.paper-grid.header {
  grid-template-columns: 20px minmax(0, 1fr) 78px 40px 50px 20px !important;
  min-width: 0 !important;
  gap: 0 !important;
}
.paper-grid > * {
  padding-left: 1px !important;
  padding-right: 1px !important;
  min-width: 0 !important;
}
.paper-qty {
  display: grid !important;
  grid-template-columns: 16px minmax(14px, 1fr) auto 16px !important;
  gap: 0 !important;
  min-width: 0 !important;
  justify-items: stretch !important;
}
.paper-step {
  width: 16px !important;
  min-width: 16px !important;
  height: 22px !important;
  padding: 0 !important;
  font-size: 11px !important;
}
.paper-qty-input {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: center !important;
  font-size: 12px !important;
}
.paper-qty .qty-unit {
  font-size: 9px !important;
  letter-spacing: -0.3px !important;
  margin: 0 !important;
  padding: 0 !important;
}
.paper-rate-input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: right !important;
  font-size: 12px !important;
}
.paper-amount {
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  justify-content: flex-end !important;
  white-space: nowrap !important;
  font-size: 12px !important;
}
.paper-grid.line > div:nth-child(3),
.paper-grid.header > div:nth-child(3),
.paper-grid.line > div:nth-child(4),
.paper-grid.header > div:nth-child(4) {
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.saved-paper-list {
  max-height: 350px !important;
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  display: block !important;
}
@media (max-width: 700px) {
  .paper-grid,
  .paper-grid.header {
    grid-template-columns: 18px minmax(0, 1fr) 76px 38px 48px 19px !important;
    margin-left: -34px !important;
    min-width: 0 !important;
    gap: 0 !important;
  }
  .paper-grid > * {
    padding-left: 1px !important;
    padding-right: 1px !important;
  }
  .paper-qty {
    grid-template-columns: 15px minmax(12px, 1fr) auto 15px !important;
    gap: 0 !important;
  }
  .paper-step {
    width: 15px !important;
    min-width: 15px !important;
    height: 21px !important;
    font-size: 10px !important;
  }
  .paper-qty-input,
  .paper-rate-input,
  .paper-amount {
    font-size: 11px !important;
  }
  .paper-qty .qty-unit {
    font-size: 8px !important;
    letter-spacing: -0.4px !important;
  }
  .saved-paper-list {
    max-height: 350px !important;
  }
}

/* V19: clean paper, compact item editor, explicit ruled rows */
.paper-bill {
  background: #fcfeda !important;
  background-image: none !important;
  position: relative;
}
.paper-bill:after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 54px;
  width: 3px;
  pointer-events: none;
  background: linear-gradient(
    to right,
    #e6b9b1 0 1px,
    transparent 1px 2px,
    #e6b9b1 2px 3px
  );
  z-index: 1;
}
.paper-grid.line {
  border-bottom: 1px solid #cfe3b9 !important;
  position: relative;
  z-index: 2;
}
.paper-grid.paper-empty-row {
  min-height: 34px;
  border-bottom: 1px solid #cfe3b9 !important;
}
.paper-name {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  resize: none !important;
}
.paper-grid,
.paper-grid.header {
  grid-template-columns: 22px minmax(0, 1fr) 78px 38px 48px 20px !important;
  min-width: 0 !important;
}
.paper-grid > div:nth-child(2) {
  min-width: 0 !important;
  overflow: hidden !important;
}
.paper-grid.line > div:nth-child(5),
.paper-grid.header > div:nth-child(5) {
  padding-left: 1px !important;
  padding-right: 1px !important;
  min-width: 0 !important;
}
.paper-amount {
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  text-overflow: clip !important;
}
@media (max-width: 700px) {
  .paper-bill {
    padding-left: 34px !important;
    background: #fcfeda !important;
    background-image: none !important;
  }
  .paper-bill:after {
    left: 43px;
    width: 3px;
  }
  .paper-grid,
  .paper-grid.header {
    grid-template-columns: 18px minmax(0, 1fr) 74px 36px 45px 19px !important;
    margin-left: -34px !important;
    min-width: 0 !important;
  }
  .paper-grid > * {
    padding-left: 1px !important;
    padding-right: 1px !important;
  }
  .paper-name {
    font-size: 12px !important;
    line-height: 1.16 !important;
    padding: 1px !important;
  }
  .paper-qty {
    grid-template-columns: 15px minmax(12px, 1fr) auto 15px !important;
    gap: 0 !important;
  }
  .paper-amount {
    font-size: 11px !important;
    letter-spacing: -0.3px !important;
  }
}

/* V20: 10% serial-number gutter, compact columns, no item input crossing margin */
.paper-bill {
  padding-left: 10% !important;
  padding-right: 5px !important;
  background: #fcfeda !important;
  background-image: none !important;
  position: relative !important;
}
.paper-bill:after {
  left: 10% !important;
  width: 3px !important;
  background: linear-gradient(
    to right,
    #dca8a0 0 1px,
    transparent 1px 2px,
    #dca8a0 2px 3px
  ) !important;
  top: 0 !important;
  bottom: 0 !important;
  z-index: 3 !important;
  pointer-events: none !important;
}
.paper-grid,
.paper-grid.header {
  grid-template-columns: 10% minmax(0, 1fr) 88px 36px 45px 20px !important;
  min-width: 0 !important;
  margin-left: -10% !important;
  gap: 0 !important;
}
.paper-grid > * {
  box-sizing: border-box !important;
  min-width: 0 !important;
  padding-left: 1px !important;
  padding-right: 1px !important;
}
.paper-grid > div:nth-child(2) {
  padding-left: 5px !important;
  min-width: 0 !important;
  overflow: hidden !important;
}
.paper-grid.line {
  position: relative !important;
  z-index: 2 !important;
  border-bottom: 1px solid #cfe3b9 !important;
  align-items: stretch !important;
}
.paper-grid.header .paper-sn,
.paper-grid.line .paper-sn {
  justify-content: center !important;
  padding: 0 !important;
}
.paper-name {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding: 1px !important;
  margin: 0 !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  resize: none !important;
  line-height: 1.16 !important;
}
.paper-qty {
  display: grid !important;
  grid-template-columns: 18px minmax(24px, 1fr) auto 18px !important;
  gap: 0 !important;
  min-width: 0 !important;
  width: 100% !important;
  align-items: center !important;
}
.paper-step {
  width: 18px !important;
  min-width: 18px !important;
  height: 22px !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 11px !important;
}
.paper-qty-input {
  width: 100% !important;
  min-width: 24px !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: center !important;
  font-size: 12px !important;
  box-sizing: border-box !important;
}
.paper-qty .qty-unit {
  margin: 0 !important;
  padding: 0 1px !important;
  font-size: 9px !important;
  white-space: nowrap !important;
  letter-spacing: -0.3px !important;
}
.paper-rate-input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: right !important;
  font-size: 12px !important;
  box-sizing: border-box !important;
}
.paper-amount {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  margin: 0 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  font-size: 12px !important;
}
.paper-grid.line > div:nth-child(5),
.paper-grid.header > div:nth-child(5) {
  padding-left: 1px !important;
  padding-right: 0 !important;
  min-width: 0 !important;
}
.paper-grid.line > div:last-child {
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
}
.paper-remove {
  width: 19px !important;
  min-width: 19px !important;
  height: 22px !important;
  padding: 0 !important;
  margin: 0 !important;
}
.paper-toolbar-v15 .paper-add {
  min-height: 34px !important;
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}
.saved-paper-list {
  max-height: 300px !important;
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
}
@media (max-width: 700px) {
  .paper-bill {
    padding-left: 10% !important;
    padding-right: 4px !important;
  }
  .paper-bill:after {
    left: 10% !important;
  }
  .paper-grid,
  .paper-grid.header {
    grid-template-columns: 10% minmax(0, 1fr) 82px 34px 43px 19px !important;
    margin-left: -10% !important;
  }
  .paper-grid > * {
    padding-left: 1px !important;
    padding-right: 1px !important;
  }
  .paper-grid > div:nth-child(2) {
    padding-left: 4px !important;
  }
  .paper-qty {
    grid-template-columns: 17px minmax(24px, 1fr) auto 17px !important;
  }
  .paper-step {
    width: 17px !important;
    min-width: 17px !important;
    height: 21px !important;
  }
  .paper-name {
    font-size: 12px !important;
  }
  .paper-qty-input,
  .paper-rate-input,
  .paper-amount {
    font-size: 11px !important;
  }
  .paper-qty .qty-unit {
    font-size: 8px !important;
  }
  .paper-remove {
    width: 18px !important;
    min-width: 18px !important;
    height: 21px !important;
  }
}

/* V21: use a true 7% serial margin and 35% item column */
.paper-bill {
  padding-left: 7px !important;
  background-color: #fcfeda !important;
  background-image: none !important;
}
.paper-grid,
.paper-grid.header,
.paper-grid.line {
  grid-template-columns: 7% 35% 24% 10% 17% 7% !important;
  margin-left: 0 !important;
  gap: 0 !important;
  width: 100%;
}
.paper-grid > * {
  min-width: 0 !important;
  padding: 4px 2px !important;
  box-sizing: border-box !important;
  overflow: hidden;
}
.paper-grid .paper-sn {
  grid-column: 1;
  justify-content: center !important;
  padding: 0 !important;
  border-right: 0 !important;
  transform: none !important;
}
.paper-grid.line > div:nth-child(2) {
  padding-left: 5px !important;
  padding-right: 3px !important;
  min-width: 0 !important;
}
.paper-name {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  resize: none !important;
}
.paper-grid.line > div:nth-child(3) {
  padding-left: 1px !important;
  padding-right: 1px !important;
  min-width: 0 !important;
}
.paper-qty {
  grid-template-columns: 20px minmax(0, 1fr) 22px 20px !important;
  gap: 1px !important;
  min-width: 0 !important;
  width: 100% !important;
}
.paper-step {
  width: 20px !important;
  height: 22px !important;
  min-width: 0 !important;
  font-size: 13px !important;
}
.paper-qty-input {
  width: 100% !important;
  min-width: 0 !important;
  padding: 1px 0 !important;
  font-size: 13px !important;
}
.paper-qty .qty-unit {
  font-size: 10px !important;
  white-space: nowrap !important;
  letter-spacing: -0.2px;
}
.paper-grid.line > div:nth-child(4) {
  padding-left: 1px !important;
  padding-right: 1px !important;
  min-width: 0 !important;
}
.paper-rate-input {
  width: 100% !important;
  min-width: 0 !important;
  padding: 1px 0 !important;
  text-align: left !important;
  font-size: 13px !important;
}
.paper-grid.line > div:nth-child(5) {
  justify-content: flex-start !important;
  padding-left: 2px !important;
  padding-right: 0 !important;
  min-width: 0 !important;
}
.paper-amount {
  width: 100%;
  justify-content: flex-start !important;
  text-align: left !important;
  white-space: nowrap;
  font-size: 13px !important;
  overflow: hidden;
}
.paper-grid.line > div:last-child {
  justify-content: center !important;
  padding: 0 !important;
  min-width: 0 !important;
}
.paper-remove {
  width: 18px !important;
  height: 22px !important;
  font-size: 12px !important;
}
.paper-bill:after {
  left: 7% !important;
  width: 3px !important;
  top: 0 !important;
  bottom: 0 !important;
  background: linear-gradient(
    to right,
    #dca8a0 0 1px,
    transparent 1px 2px,
    #dca8a0 2px 3px
  ) !important;
  z-index: 3 !important;
  pointer-events: none !important;
}
.paper-table {
  overflow: visible !important;
}
@media (max-width: 700px) {
  .paper-bill {
    padding-left: 5px !important;
    padding-right: 5px !important;
  }
  .paper-grid,
  .paper-grid.header,
  .paper-grid.line {
    grid-template-columns: 7% 35% 24% 10% 17% 7% !important;
    margin-left: 0 !important;
  }
  .paper-grid > * {
    padding: 3px 1px !important;
  }
  .paper-grid.line > div:nth-child(2) {
    padding-left: 4px !important;
    padding-right: 2px !important;
  }
  .paper-qty {
    grid-template-columns: 18px minmax(0, 1fr) 19px 18px !important;
    gap: 0 !important;
  }
  .paper-step {
    width: 18px !important;
    height: 20px !important;
    font-size: 12px !important;
  }
  .paper-qty-input,
  .paper-rate-input,
  .paper-amount {
    font-size: 12px !important;
  }
  .paper-qty .qty-unit {
    font-size: 9px !important;
  }
  .paper-remove {
    width: 16px !important;
    height: 20px !important;
    font-size: 11px !important;
  }
  .paper-bill:after {
    left: 7% !important;
  }
}

/* V25: unified product manager and Khata history */
.product-main-accordion,
.product-category-accordion {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  margin: 9px 0;
  overflow: hidden;
}
.product-main-accordion > summary,
.product-category-accordion > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  font-weight: 800;
}
.product-main-accordion > summary::-webkit-details-marker,
.product-category-accordion > summary::-webkit-details-marker {
  display: none;
}
.product-main-accordion > summary {
  background: #f7efe6;
  color: var(--brown);
}
.product-category-accordion > summary {
  background: #fcfaf7;
  font-weight: 700;
  padding: 10px 12px;
}
.product-main-inner {
  padding: 0 10px 10px;
}
.product-category-accordion {
  margin: 8px 0;
}
.product-hierarchy-products {
  padding: 4px 8px 8px;
}
.product-hierarchy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid #eee7e0;
}
.product-hierarchy-row:last-child {
  border-bottom: 0;
}
.product-hierarchy-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.hierarchy-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.icon-action {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #fff;
}
.icon-action svg {
  width: 16px;
  height: 16px;
}
.icon-action.edit {
  color: var(--brown);
}
.icon-action.delete {
  color: var(--red);
  background: #fff8f7;
}
.khata-customer-row {
  cursor: pointer;
  align-items: center;
}
.khata-customer-row:hover {
  border-color: var(--brown2);
  background: #fffdfb;
}
.khata-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.khata-stat {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px;
  background: #fff;
}
.khata-stat small {
  display: block;
  color: var(--muted);
}
.khata-stat strong {
  display: block;
  font-size: 21px;
  margin-top: 4px;
}
.khata-bill-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
  cursor: pointer;
  background: #fff;
}
.khata-bill-row:hover {
  border-color: var(--brown2);
}
.customer-phone-list {
  display: grid;
  gap: 8px;
  margin: 8px 0;
}
.customer-phone-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.customer-phone-option input {
  width: auto !important;
}
.customer-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.khata-bill-row.unpaid {
  border-left: 5px solid var(--red);
}
.khata-bill-row.cleared {
  border-left: 5px solid var(--green);
}
@media (max-width: 650px) {
  .khata-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .product-hierarchy-row {
    align-items: flex-start;
  }
  .product-hierarchy-meta {
    overflow-wrap: anywhere;
  }
}

.inventory-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.inventory-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  text-align: left;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: linear-gradient(135deg, #f4e5d5, #fff);
  color: var(--text);
  cursor: pointer;
  min-height: 100px;
}
.inventory-tab > span {
  font-size: 23px;
  color: var(--brown);
}
.inventory-tab b {
  font-size: 16px;
}
.inventory-tab small {
  color: var(--muted);
}
.inventory-tab.active {
  border: 2px solid var(--brown);
  background: linear-gradient(135deg, #ead3bd, #fffaf5);
  box-shadow: 0 3px 12px #5d3b1b16;
}
.inventory-panel {
  min-width: 0;
}
.purchase-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 30%) minmax(0, 70%);
  gap: 12px;
  align-items: start;
}
.vendor-sidebar {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: #fff;
  min-width: 0;
}
.vendor-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 9px;
}
.vendor-sidebar input {
  width: 100%;
  min-width: 0;
}
.vendor-row {
  padding: 10px 7px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  gap: 5px;
  align-items: flex-start;
  justify-content: space-between;
  border-radius: 9px;
  min-width: 0;
}
.vendor-row.selected,
.vendor-row:hover {
  background: #fcf5ed;
}
.vendor-row > div:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.vendor-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}
.vendor-row .vendor-due {
  color: #a33a2b;
  font-weight: 800;
}
.vendor-actions {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.btn.compact {
  padding: 5px 7px;
  font-size: 11px;
  min-height: 28px;
}
.purchase-main {
  min-width: 0;
}
.purchase-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px;
  margin-bottom: 8px;
  min-width: 0;
}
.purchase-row > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.purchase-row small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.vendor-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.vendor-detail-stats > div {
  padding: 10px;
  border-radius: 10px;
  background: #faf5ef;
  min-width: 0;
}
.vendor-detail-stats small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.vendor-detail-stats b {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .purchase-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .vendor-sidebar {
    width: 100%;
  }
  .vendor-row {
    padding: 10px;
  }
  .vendor-actions .btn {
    padding: 5px;
  }
  .inventory-tab {
    padding: 12px;
    min-height: 90px;
  }
  .purchase-row {
    align-items: flex-start;
  }
  .vendor-detail-stats {
    gap: 5px;
  }
  .vendor-detail-stats > div {
    padding: 8px;
  }
}

.home-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.home-page-heading h2 {
  margin: 0;
}
.home-page-heading .sub {
  margin-bottom: 0;
}
.home-settings-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px 14px;
  font-weight: 800;
}
.home-settings-button svg {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .home-page-heading {
    align-items: center;
  }
  .home-settings-button {
    padding: 9px 10px;
    gap: 6px;
  }
  .home-settings-button span {
    font-size: 13px;
  }
}

/* V29: consistent compact navigation SVG icons */
.navbtn {
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
}
.navbtn .nav-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  display: inline-block;
  color: currentColor;
}
.navbtn .nav-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
.home-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}
.home-staff-button,
.home-settings-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
}
.home-action-icon {
  width: 21px;
  height: 21px;
  display: block;
  flex: 0 0 21px;
}
.home-action-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
@media (max-width: 520px) {
  .home-page-heading {
    align-items: flex-start;
  }
  .home-action-buttons {
    gap: 6px;
  }
  .home-staff-button,
  .home-settings-button {
    padding: 8px 10px;
    font-size: 13px;
    gap: 6px;
  }
  .home-action-icon {
    width: 19px;
    height: 19px;
    flex-basis: 19px;
  }
}

/* V31: app-like bottom navigation */
@media (min-width: 0px) {
  .drawer {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    height: 76px;
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--border);
    transform: none;
    transition: none;
    display: block;
    overflow: visible;
    z-index: 30;
    background: #fff;
  }
  .drawer.open {
    transform: none;
  }
  .drawer-nav-scroll {
    height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 3px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    scrollbar-width: none;
  }
  .drawer-nav-scroll::-webkit-scrollbar {
    display: none;
  }
  .drawer .brand,
  .drawer-user {
    display: none !important;
  }
  .navbtn {
    flex: 1 0 72px;
    width: auto;
    min-width: 0;
    max-width: 150px;
    margin: 0;
    padding: 5px 3px 3px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-align: center;
    font-size: 10px;
    line-height: 1.1;
    white-space: normal;
  }
  .navbtn .nav-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
  }
  .navbtn .badge {
    font-size: 9px;
    padding: 2px 4px;
    position: absolute;
    transform: translate(16px, -7px);
  }
  .main {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
  .drawer-overlay {
    display: none !important;
  }
  .header-menu-hidden {
    display: none !important;
  }
  .logout-header {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    padding: 7px 9px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
  }
  .suggestion-card {
    padding: 14px 16px !important;
    margin-bottom: 10px;
  }
  .suggestion-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 12px;
  }
  .suggestion-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
  }
  .suggestion-action svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .suggestion-action.add {
    background: var(--brand);
    color: #fff;
  }
  .suggestion-action.merge {
    background: #f0e5dc;
    color: var(--text);
    border: 1px solid var(--border);
  }
  .suggestion-action.ignore {
    background: #fff;
    color: var(--red);
    border: 1px solid #f1c7c2;
  }
  .suggestion-action.delete {
    background: #fff0ef;
    color: #b42318;
    border: 1px solid #f1c7c2;
  }
  .suggestion-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 18px 0 9px;
  }
  .suggestion-section-title h3 {
    margin: 0;
    font-size: 17px;
  }
  .suggestion-ignored {
    border-left-color: #9ca3af;
    background: #fbfbfa;
  }
  .suggestion-ignored details > summary {
    cursor: pointer;
    list-style: none;
  }
  .suggestion-ignored details > summary::-webkit-details-marker {
    display: none;
  }
  .suggestion-ignored-list {
    padding-top: 10px;
  }
  .suggestion-card .suggestion-sub {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
    line-height: 1.35;
  }
  @media (max-width: 520px) {
    .suggestion-card {
      padding: 12px !important;
    }
    .suggestion-action {
      min-height: 32px;
      padding: 7px 9px;
      font-size: 12px;
    }
    .suggestion-actions {
      gap: 6px;
    }
    .logout-header {
      padding: 7px 8px;
      font-size: 12px;
    }
    header h1 {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
}
@media (max-width: 420px) {
  .drawer {
    height: 70px;
  }
  .navbtn {
    flex-basis: 61px;
    font-size: 9px;
  }
  .navbtn .nav-icon {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }
  .main {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }
}

/* V32: Home lives in the brown header; other sections remain in bottom navigation */
.header-home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  padding: 8px 11px;
  font-weight: 800;
  flex: 0 0 auto;
}
.header-home-button svg {
  width: 20px;
  height: 20px;
  fill: #fff;
  display: block;
}
header h1 {
  flex: 1;
  min-width: 0;
}
.home-logout-footer {
  margin-top: 28px;
  padding: 18px 0 8px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.home-logout-footer .sub {
  margin: 0;
  font-size: 13px;
}
.home-logout-footer .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.home-logout-footer svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (min-width: 0px) {
  .header-menu-hidden {
    display: none !important;
  }
  .logout-header {
    display: inline-flex;
  }
  .drawer {
    height: 76px;
  }
  .drawer-user {
    display: none !important;
  }
  .navbtn[data-page='dashboard'] {
    display: none !important;
  }
  .main {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 520px) {
  header {
    gap: 8px;
    padding: 0 10px;
  }
  .header-home-button {
    padding: 7px 8px;
    gap: 5px;
  }
  .header-home-button span {
    font-size: 12px;
  }
  .header-home-button svg {
    width: 18px;
    height: 18px;
  }
  header h1 {
    font-size: 16px;
  }
  .header-new-bill {
    padding: 8px 9px;
    font-size: 12px;
  }
  .home-logout-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .home-logout-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

/* V35: compact customer fields after the red margin and remove redundant delete column */
.paper-customer {
  margin-left: 10px !important;
  grid-template-columns: minmax(0, 1fr) 102px !important;
  gap: 7px !important;
  max-width: 100%;
}
.paper-small-input.phone-field {
  grid-column: auto !important;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 6px 5px !important;
  font-size: 12px !important;
}
.paper-small-input.name-field {
  grid-column: auto !important;
  min-width: 0;
}
.paper-small-input.phone-field.phone-invalid {
  border: 2px solid #c0392b !important;
  background: #fff0ef !important;
  color: #b42318 !important;
  box-shadow: 0 0 0 1px rgba(192, 57, 43, 0.08);
}
.paper-grid,
.paper-grid.header {
  grid-template-columns: 28px minmax(0, 35%) 102px 58px minmax(0, 1fr) !important;
  margin-left: -42px !important;
}
.paper-grid > *:last-child {
  border-right: 0;
}
@media (max-width: 700px) {
  .paper-customer {
    margin-left: 10px !important;
    grid-template-columns: minmax(0, 1fr) 96px !important;
    gap: 5px !important;
  }
  .paper-grid,
  .paper-grid.header {
    grid-template-columns: 25px minmax(0, 35%) 91px 51px minmax(0, 1fr) !important;
    margin-left: -34px !important;
  }
  .paper-grid > * {
    padding: 4px 2px !important;
  }
  .paper-qty {
    grid-template-columns: 22px minmax(24px, 1fr) 22px !important;
    gap: 1px !important;
  }
  .paper-step {
    width: 22px !important;
    height: 22px !important;
  }
  .qty-unit {
    font-size: 9px !important;
    margin: 0 !important;
  }
  .paper-billno-top {
    font-size: 11px !important;
  }
}

/* V46: clearer outlined category selectors and compact cash-flow cards */
.main-category-tabs {
  border: 1px solid #e5d7ca;
  border-radius: 10px;
  padding: 8px;
  background: transparent;
}
.category-tabs {
  border-top: 1px solid #d9c8b8;
  border-bottom: 1px solid #d9c8b8;
  padding: 8px 0;
}
.paper-name-unmatched {
  text-decoration-thickness: 1.5px !important;
  text-underline-offset: 2px !important;
  background-image: none !important;
}
.cash-change-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1fr) !important;
  gap: 8px !important;
}
.cash-change-cell {
  padding: 10px 9px !important;
  gap: 8px !important;
}
.cash-change-cell.cash-change-center {
  background: #f1efff;
  border-color: #dcd6fa;
  justify-content: center;
  text-align: center;
}
.cash-change-center .cash-change-label,
.cash-change-center .cash-change-value {
  color: #51439a;
  text-align: center;
}
.cash-change-center .cash-change-value {
  font-size: clamp(19px, 2vw + 10px, 28px);
  padding: 12px 3px;
}
.cash-change-label {
  font-size: clamp(14px, 1.15vw + 10px, 17px) !important;
  line-height: 1.2 !important;
  text-align: left;
}
.cash-change-cell input {
  font-size: clamp(16px, 1vw + 12px, 20px) !important;
  padding: 10px 8px !important;
  min-height: 44px;
}
.cash-change-cell input[readonly] {
  background: #fff0ee !important;
  border-color: #efb8b2 !important;
  color: #bf3029 !important;
}
.cash-change-visual {
  justify-content: flex-start !important;
  gap: 7px !important;
  min-height: 46px;
  margin-top: 2px;
}
.cash-hand-icon {
  width: clamp(38px, 5vw, 52px) !important;
  height: clamp(38px, 5vw, 52px) !important;
}
.cash-change-arrow {
  width: 23px !important;
  height: 23px !important;
  stroke-width: 4 !important;
}
.cash-change-arrow.down {
  color: #126d39 !important;
}
.cash-change-arrow.up {
  color: #b92320 !important;
}
.cash-hand-icon.in {
  color: #168247 !important;
}
.cash-hand-icon.out {
  color: #c7352e !important;
}
@media (max-width: 430px) {
  .cash-change-panel {
    padding: 6px;
  }
  .cash-change-row {
    gap: 5px !important;
  }
  .cash-change-cell {
    padding: 8px 6px !important;
    gap: 7px !important;
  }
  .cash-change-label {
    font-size: 13px !important;
  }
  .cash-change-cell input {
    font-size: 15px !important;
    min-height: 40px;
    padding: 8px 4px !important;
  }
  .cash-change-visual {
    gap: 4px !important;
  }
  .cash-hand-icon {
    width: 34px !important;
    height: 34px !important;
  }
  .cash-change-arrow {
    width: 19px !important;
    height: 19px !important;
  }
  .cash-change-center .cash-change-value {
    font-size: 20px !important;
  }
}

/* V51: keep Add Item visible beside the bill total, centered under the item list */
.paper-total-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
}
.paper-total-actions > .paper-total {
  margin-top: 0;
  justify-self: end;
  grid-column: 3;
  grid-row: 1;
}
.paper-add-bottom {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  align-self: start;
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50% !important;
  font-size: 28px !important;
  line-height: 1;
  padding: 0 !important;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.12);
}
@media (max-width: 700px) {
  .paper-total-actions {
    gap: 4px;
  }
  .paper-add-bottom {
    width: 38px;
    height: 38px;
    min-width: 38px;
    font-size: 25px !important;
  }
  .paper-total-box {
    min-width: 0 !important;
    max-width: 100%;
  }
}

/* V54: fix mobile width containment and make category strips truly swipeable */
#newbill,
#newbill .bill-layout,
#newbill .bill-layout > div,
#newbill .bill-layout > div > .card,
#newbill .bill-layout > div > .card > #mainCategoryTabs,
#newbill .bill-layout > div > .card > #categoryTabs {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
#newbill .bill-layout {
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100% !important;
}
#newbill .main-category-tabs,
#newbill .category-tabs {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: scroll !important;
  overflow-y: hidden !important;
  box-sizing: border-box !important;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: auto;
  gap: 8px !important;
}
#newbill .main-category-tabs > .main-category-btn {
  flex: 0 0 78px !important;
  width: 78px !important;
  min-width: 78px !important;
  max-width: 78px !important;
}
#newbill .category-tabs > .category-tab {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: max-content !important;
  white-space: nowrap !important;
}
#newbill #billProducts {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
@media (min-width: 901px) {
  #newbill .bill-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr) !important;
  }
}

/* V55 Mintu design system: teal brand, warm-white surfaces, subtle depth */
:root {
  --brand: #176b63;
  --brand-dark: #0f5b54;
  --brand-soft: #eaf5f2;
  --surface: #ffffff;
  --canvas: #f6f8f7;
  --success: #237a4b;
  --success-soft: #e7f5ec;
  --warning: #9a6200;
  --warning-soft: #fff3d8;
  --danger: #b42318;
  --danger-soft: #fdebe9;
}
body {
  background: var(--canvas);
  color: var(--text);
}
header {
  background: var(--brand);
  box-shadow: 0 2px 10px rgba(20, 65, 58, 0.14);
}
.card,
.day-report-card,
.dashboard-total-card,
.order-card,
.product-card,
.cash-counter-card {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 3px 12px rgba(28, 65, 57, 0.055);
}
.card {
  border-radius: 16px;
}
.drawer {
  background: #fff;
  border-color: var(--border);
  box-shadow: 4px 0 18px rgba(25, 50, 44, 0.07);
}
.drawer .brand {
  color: var(--brand);
}
.navbtn {
  border-radius: 12px;
  transition:
    background 0.15s,
    color 0.15s;
}
.navbtn:hover,
.navbtn.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
}
.btn {
  border-radius: 11px;
  border: 1px solid transparent;
  transition:
    transform 0.12s,
    box-shadow 0.12s,
    background 0.12s;
}
.btn:active {
  transform: scale(0.985);
}
.btn.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 5px rgba(23, 107, 99, 0.16);
}
.btn.primary:hover {
  background: var(--brand-dark);
}
.btn.success {
  background: var(--success-soft);
  color: var(--success);
  border-color: #cde8d7;
}
.btn.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #f5d1cd;
}
input,
select,
textarea {
  border-color: var(--border);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 107, 99, 0.12);
}
.badge {
  background: #eef2f0;
  color: #46534e;
}
.badge.green {
  background: var(--success-soft);
  color: var(--success);
}
.badge.orange,
.badge.amber {
  background: var(--warning-soft);
  color: var(--warning);
}
.badge.red {
  background: var(--danger-soft);
  color: var(--danger);
}
.section-title,
.day-report-title {
  color: #20332e;
}
.day-report-card {
  border-radius: 18px;
}
.day-report-head {
  padding-bottom: 12px;
}
.day-report-metrics {
  border-color: var(--border);
  background: #fff;
}
.day-metric {
  position: relative;
  background: #fff;
}
.day-metric span {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 650;
}

.dashboard-total-cell,
.dashboard-total-head {
  border-color: var(--border);
}
.totalrow.final {
  background: #eaf5f2;
  border-radius: 12px;
  padding: 12px;
  color: #174d46;
}
.home-staff-button,
.home-settings-button {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 2px 7px rgba(28, 65, 57, 0.04);
}
.home-staff-button:hover,
.home-settings-button:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

/* Consistent payment option tiles and compact category navigation */
.paygrid button,
.payment-option,
.pay-option {
  border-radius: 13px !important;
  border: 1px solid var(--border) !important;
  background: #fff !important;
  box-shadow: 0 2px 7px rgba(28, 65, 57, 0.04);
}
.paygrid button:focus,
.paygrid button.active,
.payment-option.active,
.pay-option.active {
  border-color: var(--brand) !important;
  background: var(--brand-soft) !important;
  color: var(--brand) !important;
  box-shadow: 0 0 0 2px rgba(23, 107, 99, 0.1) !important;
}
.main-category-btn,
.category-tab {
  border-radius: 12px !important;
}
.main-category-btn.active,
.category-tab.active,
.main-category-btn[aria-selected='true'],
.category-tab[aria-selected='true'] {
  background: var(--brand-soft) !important;
  color: var(--brand) !important;
  border-color: #b8dcd4 !important;
}
.product-card {
  border-radius: 13px;
}
.product-card:hover {
  border-color: #b8dcd4;
  box-shadow: 0 5px 15px rgba(28, 65, 57, 0.08);
}

/* Keep the New Bill viewport contained on narrow devices */
#newbill,
#newbill * {
  min-width: 0;
}
#newbill .main-category-tabs,
#newbill .category-tabs {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}
#newbill .main-category-tabs > * {
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .main {
    padding: 15px 11px 100px;
  }
  .card {
    padding: 14px;
  }
  .day-metric {
    padding: 12px;
  }
  .day-metric strong {
    font-size: 22px;
  }
  .btn {
    min-height: 42px;
  }
}

/* V58: recognizable, proportionate payment marks */
.payment-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  line-height: 1;
}
.payment-icon svg {
  display: block;
  width: 28px;
  height: 28px;
}
.cash-icon {
  background: #e9f6ec;
  border: 1px solid #d3ead9;
}
.upi-icon {
  background: #fff;
  border: 1px solid #e7ece9;
}
.metric-label {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}
.metric-label .label-text {
  display: none;
}
#paymentModeSelect {
  font-size: 15px;
  line-height: 1.35;
}
#paymentModeSelect option {
  padding: 8px;
}
.payment-mode-mark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.payment-mode-mark svg {
  width: 25px;
  height: 25px;
  vertical-align: middle;
}
.payment-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}
.payment-mini svg {
  width: 17px;
  height: 17px;
  vertical-align: middle;
}
@media (max-width: 390px) {
  .payment-icon {
    width: 32px;
    height: 32px;
  }
  .payment-icon svg {
    width: 27px;
    height: 27px;
  }
  .metric-label {
    font-size: 12px;
  }
}

/* V64: main-category icon and two-line title/count layout */
#productList .product-main-accordion,
#productList .product-category-accordion {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
#productList .product-main-accordion > summary,
#productList .product-category-accordion > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 12px clamp(9px, 2.5vw, 14px);
}
#productList .product-main-accordion > summary {
  background: #f7efe6;
  color: #202b28;
}
#productList .product-category-accordion > summary {
  background: #fff;
  font-weight: 600;
  padding: 10px clamp(8px, 2vw, 12px);
}
#productList .hierarchy-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
}
#productList .hierarchy-title .hierarchy-category-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: #e8f4f1;
  color: #176b63;
  font-size: 23px;
  line-height: 1;
}
#productList .hierarchy-title .hierarchy-labels {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}
#productList .hierarchy-title strong {
  font-size: clamp(14px, 1.1vw + 10px, 17px);
  line-height: 1.25;
  font-weight: 800;
  overflow-wrap: anywhere;
}
#productList .hierarchy-title .badge {
  flex: 0 1 auto;
  font-size: 11px;
  line-height: 1.2;
  white-space: normal;
  padding: 0;
  background: transparent;
  color: #687671;
  border: 0;
}
#productList .hierarchy-actions {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
  align-items: center;
}
#productList .icon-action {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 8px;
}
#productList .icon-action svg {
  width: 16px;
  height: 16px;
}
#productList .hierarchy-chevron {
  flex: 0 0 12px;
  text-align: center;
  color: #176b63;
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
  transition: transform 0.15s ease;
}
#productList details[open] > summary .hierarchy-chevron {
  transform: rotate(180deg);
}
#productList .product-main-inner {
  padding: 0 8px 8px;
}
#productList .product-category-accordion {
  margin: 7px 0;
  border-radius: 10px;
}
#productList .product-hierarchy-row {
  min-width: 0;
}
@media (max-width: 420px) {
  #productList .product-main-accordion > summary,
  #productList .product-category-accordion > summary {
    gap: 5px;
    padding: 10px 7px;
  }
  #productList .hierarchy-title {
    gap: 7px;
  }
  #productList .hierarchy-title .hierarchy-category-icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    border-radius: 9px;
    font-size: 20px;
  }
  #productList .hierarchy-title .hierarchy-labels {
    gap: 2px;
  }
  #productList .hierarchy-title strong {
    font-size: 14px;
  }
  #productList .hierarchy-title .badge {
    font-size: 10px;
    padding: 0;
  }
  #productList .hierarchy-actions {
    gap: 3px;
  }
  #productList .icon-action {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }
  #productList .icon-action svg {
    width: 14px;
    height: 14px;
  }
  #productList .hierarchy-chevron {
    flex-basis: 10px;
    font-size: 16px;
  }
}

/* V69 contact import controls */
.contact-import-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.contact-import-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-weight: 800;
  background: #eef7f4;
  color: #176b63;
}
.contact-import-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 8px;
}
.contact-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 7px;
  background: #fff;
}
.contact-result > div {
  min-width: 0;
}
.contact-result small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  overflow-wrap: anywhere;
}
@media (max-width: 520px) {
  .contact-import-actions > * {
    flex: 1 1 100%;
  }
  .contact-import-btn {
    width: 100%;
  }
}

/* V72: consistent icon-only back navigation and saved-customer name suggestions */
.icon-back-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0 !important;
  border: 1px solid #d5e0e4 !important;
  border-radius: 13px !important;
  background: #fff !important;
  color: #234b58 !important;
  box-shadow: 0 2px 7px rgba(20, 55, 65, 0.08);
  font-size: 25px !important;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.15s;
}
.icon-back-button:active {
  transform: scale(0.96);
  background: #edf7f7 !important;
}
.icon-back-button svg {
  width: 22px;
  height: 22px;
  display: block;
}
.customer-name-autocomplete-wrap {
  position: relative;
  min-width: 0;
}
.customer-name-suggestions {
  position: absolute;
  z-index: 100;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid #cbdadd;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}
.customer-name-suggestions:empty {
  display: none;
}
.customer-name-suggestion {
  display: flex;
  width: 100%;
  text-align: left;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 11px;
  border: 0;
  border-bottom: 1px solid #edf1f2;
  background: #fff;
  color: #20363b;
  font: inherit;
  cursor: pointer;
}
.customer-name-suggestion:last-child {
  border-bottom: 0;
}
.customer-name-suggestion:active {
  background: #e9f6f3;
}
.customer-name-suggestion small {
  display: block;
  color: #6a7a7f;
  font-size: 11px;
  margin-top: 2px;
}
.customer-name-suggestion .suggestion-arrow {
  font-size: 18px;
  color: #168b82;
}
input::placeholder {
  color: #a8a8a8;
  opacity: 1;
}
