/* ═══════════════════════════════════════════
   TOKENS & THEMES
   ═══════════════════════════════════════════ */
:root {
  --maroon: #6B1A1A;
  --maroon-deep: #4A1010;
  --maroon-mid: #8B2525;
  --maroon-soft: #A84040;
  --gold: #E8A020;
  --gold-light: #F5C050;
  --gold-pale: #FDF3DC;
  --gold-border: #C8881A;
  --cream: #FBF7F0;
  --cream-dark: #F2EAD8;
  --white: #FFFFFF;
  --ink: #1C0A0A;
  --ink-mid: #4A2020;
  --ink-soft: #8A6060;
  --divider: rgba(107, 26, 26, 0.12);
  --card-shadow: 0 8px 22px rgba(107, 26, 26, 0.12);
  --card-hover: 0 14px 34px rgba(107, 26, 26, 0.2);
  --gold-glow: 0 0 24px rgba(232, 160, 32, 0.25);
  --r: 12px;
  --r-sm: 7px;
  --theme-shadow-rgb: 74, 16, 16;
  --grand-start: #3d0808;
  --grand-end: #962f2f;
  --hover-start: #3A0808;
}

.theme-blue {
  --maroon: #1B4965;
  --maroon-deep: #0F2C3F;
  --maroon-mid: #226F9E;
  --maroon-soft: #3F8EBF;
  --divider: rgba(27, 73, 101, 0.12);
  --card-shadow: 0 8px 22px rgba(27, 73, 101, 0.12);
  --card-hover: 0 14px 34px rgba(27, 73, 101, 0.2);
  --cream: #F2F6F8;
  --cream-dark: #E2EAF0;
  --ink: #0C1821;
  --ink-mid: #1F384D;
  --ink-soft: #506E86;
  --theme-shadow-rgb: 15, 44, 63;
  --grand-start: #0B2230;
  --grand-end: #226F9E;
  --hover-start: #0D2635;
}

.theme-green {
  --maroon: #1A5F35;
  --maroon-deep: #0D3A1F;
  --maroon-mid: #2C854E;
  --maroon-soft: #4EAB72;
  --divider: rgba(26, 95, 53, 0.12);
  --card-shadow: 0 8px 22px rgba(26, 95, 53, 0.12);
  --card-hover: 0 14px 34px rgba(26, 95, 53, 0.2);
  --cream: #F3F8F5;
  --cream-dark: #E4EDE7;
  --ink: #091A10;
  --ink-mid: #1D3B27;
  --ink-soft: #4D6D58;
  --theme-shadow-rgb: 13, 58, 31;
  --grand-start: #082613;
  --grand-end: #2C854E;
  --hover-start: #0A3018;
}

/* ═══════════════════════════════════════════
   RESET + BASE
   ═══════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  height: 100dvh;
}

body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  background: var(--cream);
  color: var(--ink);
}

.app-layout {
  display: flex;
  height: 100%;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

.app-sidebar {
  width: 220px;
  height: 100%;
  height: 100dvh;
  background: linear-gradient(160deg, var(--maroon-deep) 0%, var(--maroon) 55%, var(--maroon-mid) 100%);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 4px 0 24px rgba(var(--theme-shadow-rgb), 0.35);
  position: relative;
  z-index: 10;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 16px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
  overflow: hidden;
}

.sidebar-brand-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.sidebar-brand h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: 0.5px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--gold-light);
  background: linear-gradient(135deg, #FFF3D6 0%, var(--gold-light) 45%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.35));
}

.shop-title-prefix {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(245, 192, 80, 0.85);
  line-height: 1;
}

.sidebar-brand p {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(245, 192, 80, 0.6);
}

.app-main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

/* ═══════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════ */
header {
  flex-shrink: 0;
  background: var(--white);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  border-bottom: 1px solid var(--divider);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.today-pill {
  background: var(--maroon-deep);
  border: 1px solid var(--gold-border);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold-light);
  white-space: nowrap;
}

.printer-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--divider);
  border-radius: 20px;
  padding: 7px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-mid);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s;
}

.printer-status-pill:hover {
  border-color: var(--gold-border);
}

.printer-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.printer-status-dot.connected {
  background: #2e9e4f;
  box-shadow: 0 0 0 2px rgba(46, 158, 79, 0.25);
}

.printer-status-dot.disconnected {
  background: #c0392b;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.2);
}

.datetime-box {
  background: var(--cream);
  border: 1px solid var(--divider);
  border-radius: var(--r-sm);
  padding: 6px 14px;
  text-align: right;
}

.datetime-box .d-date {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.5px;
}

.datetime-box .d-time {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--maroon);
  line-height: 1.1;
}

/* ═══════════════════════════════════════════
   NAV TABS (SIDEBAR)
   ═══════════════════════════════════════════ */
.nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.nav-tab svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.nav-tab.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--gold-light);
}

.nav-tab.active svg {
  color: var(--gold-light);
  opacity: 1;
}

/* ═══════════════════════════════════════════
   APP MAIN / VIEWS
   ═══════════════════════════════════════════ */
.app-main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
}

.view {
  display: flex;
  width: 100%;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.view-toolbar {
  flex-shrink: 0;
  padding: 14px 24px;
  background: var(--white);
  border-bottom: 1.5px solid var(--divider);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.view-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 26px 24px;
  background: var(--cream);
}

.view-scroll::-webkit-scrollbar {
  width: 6px;
}

.view-scroll::-webkit-scrollbar-thumb {
  background: rgba(var(--theme-shadow-rgb), 0.25);
  border-radius: 3px;
}

.toolbar-spacer {
  flex: 1;
}

.view-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--maroon-deep);
  margin: 0 0 12px;
}

/* ═══════════════════════════════════════════
   BILLING — LEFT PANEL
   ═══════════════════════════════════════════ */
/* ═══════════════════════════════════════════
   BILLING — LEFT PANEL
   ═══════════════════════════════════════════ */
.layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  min-height: 0;
}

.left-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--cream);
  border-right: none;
}

.search-bar {
  flex-shrink: 0;
  padding: 14px 20px 12px;
  background: var(--white);
  border-bottom: 1.5px solid var(--divider);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.search-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-input-wrap {
  flex: 0 1 450px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--ink-soft);
  pointer-events: none;
}

#searchInput,
#invSearchInput {
  width: 100%;
  padding: 14px 18px 14px 44px;
  border: 1.5px solid var(--divider);
  border-radius: var(--r-sm);
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  background: var(--cream);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

#searchInput:focus,
#invSearchInput:focus {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(232, 160, 32, 0.12);
}

.count-pill {
  flex-shrink: 0;
  background: var(--maroon);
  color: var(--gold-light);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.filter-row,
.quick-picks-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  flex-wrap: nowrap;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  width: 100%;
}

.filter-row::-webkit-scrollbar,
.quick-picks-row::-webkit-scrollbar {
  height: 3px;
}

.filter-row::-webkit-scrollbar-thumb,
.quick-picks-row::-webkit-scrollbar-thumb {
  background: rgba(var(--theme-shadow-rgb), 0.2);
  border-radius: 2px;
}

.filter-btn,
.qp-btn {
  flex-shrink: 0;
  white-space: nowrap;
  border: 1px solid var(--divider);
  background: var(--cream);
  color: var(--ink-mid);
  border-radius: 20px;
  padding: 6px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.filter-btn:hover,
.qp-btn:hover {
  border-color: var(--gold-border);
  background: var(--gold-pale);
  color: var(--maroon);
}

.filter-btn.active {
  background: var(--maroon);
  border-color: var(--maroon);
  color: var(--gold-light);
  box-shadow: 0 4px 10px rgba(var(--theme-shadow-rgb), 0.2);
}

.low-only-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-mid);
  cursor: pointer;
  white-space: nowrap;
}

.low-only-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--maroon);
  cursor: pointer;
}

.btn-clear-top {
  flex-shrink: 0;
  background: #fff5f5;
  color: #c0392b;
  border: 1.5px solid #fcd2d2;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.16s ease;
}

.btn-clear-top:hover {
  background: #c0392b;
  color: #ffffff;
  border-color: #c0392b;
  box-shadow: 0 4px 12px rgba(192, 57, 43, 0.25);
}

/* ── PRODUCTS GRID ── */
.products-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 24px;
  scroll-behavior: smooth;
}

.products-scroll::-webkit-scrollbar {
  width: 5px;
}

.products-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.products-scroll::-webkit-scrollbar-thumb {
  background: rgba(var(--theme-shadow-rgb), 0.25);
  border-radius: 3px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--white);
  border-radius: var(--r);
  box-shadow: var(--card-shadow);
  border: 1.5px solid transparent;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(.34, 1.56, .64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  animation: cardFadeIn 0.35s ease both;
  position: relative;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-hover);
  border-color: var(--gold);
}



.card-qty-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--maroon-deep);
  color: var(--gold-light);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1.5px solid var(--gold);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  animation: badgePop 0.3s cubic-bezier(.34, 1.56, .64, 1);
  z-index: 3;
}

@keyframes badgePop {
  from {
    transform: scale(0);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes rowFlash {
  0% {
    background: rgba(232, 160, 32, 0.25);
  }

  100% {
    background: transparent;
  }
}

.add-btn.in-cart {
  background: var(--gold);
  color: var(--maroon-deep);
}

.add-btn.in-cart:hover {
  background: var(--gold-light);
  box-shadow: 0 4px 14px rgba(232, 160, 32, 0.3);
}

.card-body {
  padding: 38px 12px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-name {
  font-family: 'Inter', sans-serif;
  font-size: 0.91rem;
  font-weight: 700;
  color: var(--maroon-deep);
  line-height: 1.2;
}

.card-price {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}

.card-price .per {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--ink-soft);
  margin-left: 2px;
}

.weight-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 6px;
}

.weight-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 4px;
  margin-bottom: 6px;
  width: 100%;
}

.weight-btn {
  border: 1.5px solid var(--divider);
  border-radius: 6px;
  background: var(--cream);
  color: var(--ink-mid);
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 4px;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}

.weight-btn:nth-child(5) {
  grid-column: span 2;
}

.weight-btn:hover {
  border-color: var(--gold-border);
  background: var(--gold-pale);
}

.weight-btn.active {
  background: var(--maroon);
  border-color: var(--maroon);
  color: var(--gold-light);
  box-shadow: 0 2px 7px rgba(var(--theme-shadow-rgb), 0.22);
}

.weight-current {
  font-size: 0.7rem;
  color: var(--maroon-soft);
  font-weight: 700;
  margin-bottom: 4px;
}

.card-quick-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #f3b4b4;
  background: rgba(255, 244, 244, 0.96);
  color: #b33737;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  z-index: 4;
}

.card-quick-remove:hover {
  background: #ffe7e7;
  color: #8f1f1f;
  border-color: #d98b8b;
}

.add-btn {
  margin-top: auto;
  background: var(--maroon);
  color: var(--gold-light);
  border: none;
  border-radius: var(--r-sm);
  padding: 9px 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  width: 100%;
  transition: background 0.18s, box-shadow 0.18s;
}

.add-btn:hover {
  background: var(--maroon-deep);
  box-shadow: 0 4px 14px rgba(var(--theme-shadow-rgb), 0.3);
}

.add-btn:active {
  transform: scale(0.97);
}

.no-results,
.inv-empty {
  grid-column: 1/-1;
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-soft);
  animation: fadeInUp .24s ease;
}

.no-results .nr-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  margin-bottom: 6px;
  color: var(--maroon-soft);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════
   BILLING — RIGHT PANEL
   ═══════════════════════════════════════════ */
.right-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--white);
  overflow: hidden;
  min-height: 0;
  height: 100%;
}

.bill-header {
  flex-shrink: 0;
  background: linear-gradient(110deg, var(--maroon-deep), var(--maroon));
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.bill-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.bill-header h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.3px;
}

.bill-no-tag {
  background: rgba(232, 160, 32, 0.15);
  border: 1px solid rgba(232, 160, 32, 0.35);
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.5px;
}

.bill-scroll {
  overflow-y: auto;
  min-height: 0;
  padding: 8px 10px 10px;
}

.bill-scroll::-webkit-scrollbar {
  width: 4px;
}

.bill-scroll::-webkit-scrollbar-thumb {
  background: var(--divider);
  border-radius: 2px;
}

.bill-table-head {
  position: sticky;
  top: -8px;
  z-index: 5;
  display: grid;
  grid-template-columns: 1.7fr .7fr .9fr 1.6fr 1.1fr .7fr;
  gap: 8px;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--divider);
  background: #fff9ec;
  border-radius: 10px 10px 0 0;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: .7px;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.bill-table-head span:last-child {
  text-align: center;
}

.empty-state {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink-soft);
  padding: 56px 24px;
}

.empty-icon {
  width: 52px;
  height: 52px;
  background: var(--cream-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-icon svg {
  width: 26px;
  height: 26px;
  color: var(--ink-soft);
}

.empty-state p {
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
  max-width: 250px;
}

.bill-item {
  display: grid;
  grid-template-columns: 1.7fr .7fr .9fr 1.6fr 1.1fr .7fr;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--divider);
  gap: 8px;
  transition: background 0.15s;
  animation: itemSlideIn 0.22s ease both;
}

@keyframes itemSlideIn {
  from {
    opacity: 0;
    transform: translateX(14px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.bill-item:hover {
  background: var(--cream);
}

.bill-item.row-flash {
  animation: rowFlash 0.65s ease forwards;
}

.bi-name-wrap {
  min-width: 0;
}

.bi-name {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--maroon-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bi-unit {
  font-size: 0.63rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

.bi-weight,
.bi-total {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-mid);
}

.bi-price-wrap {
  display: flex;
  align-items: center;
  gap: 1px;
}

.rupee-sign {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink);
}

.bi-price-input {
  width: 52px;
  border: 1.5px solid transparent;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink);
  padding: 2px 3px;
  border-radius: 5px;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.bi-price-input::-webkit-outer-spin-button,
.bi-price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.bi-price-input:hover {
  border-color: var(--divider);
  background: var(--cream);
}

.bi-price-input:focus {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 2px rgba(232, 160, 32, .15);
}

.qty-ctrl {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.qty-btn.minus {
  background: var(--cream-dark);
  color: var(--maroon);
  border: 1.5px solid var(--divider);
}

.qty-btn.minus:hover {
  background: #e8d0c0;
}

.qty-btn.plus {
  background: var(--maroon);
  color: var(--gold-light);
}

.qty-btn.plus:hover {
  background: var(--maroon-deep);
}

.qty-btn:active {
  transform: scale(0.88);
}

.qty-input {
  width: 30px;
  height: 28px;
  text-align: center;
  border: 1.5px solid var(--divider);
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink);
  padding: 2px 0;
  outline: none;
  background: var(--white);
  -moz-appearance: textfield;
  appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.qty-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(232, 160, 32, .15);
}

.bi-del {
  background: #fff7f7;
  border: 1px solid #f3d3d3;
  cursor: pointer;
  color: #bf5f5f;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  margin: 0 auto;
}

.bi-del:hover {
  color: #c0392b;
  background: #ffecec;
  border-color: #eab0b0;
}

/* ── SUMMARY ── */
.summary {
  flex-shrink: 0;
  border-top: 1.5px solid var(--divider);
  padding: 13px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: var(--white);
}

.sum-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}

.sum-label {
  font-weight: 500;
  color: var(--ink-mid);
}

.sum-val {
  font-weight: 700;
  color: var(--ink);
}

.gst-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gst-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle {
  position: relative;
  width: 38px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle input {
  display: none;
}

.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: var(--cream-dark);
  border: 1.5px solid var(--divider);
  transition: background 0.2s, border-color 0.2s;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.toggle input:checked+.toggle-track {
  background: var(--maroon);
  border-color: var(--maroon);
}

.toggle input:checked~.toggle-thumb {
  transform: translateX(18px);
}

.gst-label-text {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ink-mid);
}

.gst-rate-input {
  width: 40px;
  padding: 3px 4px;
  border: 1.5px solid var(--divider);
  border-radius: 5px;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  color: var(--ink);
  background: var(--cream);
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.gst-rate-input::-webkit-outer-spin-button,
.gst-rate-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.gst-rate-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(232, 160, 32, 0.12);
}

.gst-pct {
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.disc-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.disc-row label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ink-mid);
  flex-shrink: 0;
}

#discountInput {
  width: 64px;
  padding: 6px 8px;
  border: 1.5px solid var(--divider);
  border-radius: var(--r-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
  color: var(--ink);
  background: var(--cream);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#discountInput:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 160, 32, 0.12);
}

.disc-rupee-badge {
  padding: 4px 10px;
  border: 1.5px solid var(--maroon);
  border-radius: var(--r-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  background: var(--maroon);
  color: var(--gold-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.disc-spacer {
  flex: 1;
}

.disc-val {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
}

.grand-box {
  background: linear-gradient(120deg, var(--grand-start), var(--maroon), var(--grand-end));
  border-radius: var(--r);
  padding: 11px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(var(--theme-shadow-rgb), 0.35);
  text-align: center;
}

.grand-box::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 80px;
  height: 80px;
  background: rgba(232, 160, 32, 0.08);
  border-radius: 50%;
}

.grand-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.7px;
  color: rgba(255, 225, 150, 0.9);
}

.grand-val {
  font-family: 'Inter', sans-serif;
  font-size: 1.75rem;
  font-weight: 900;
  color: #ffeeb7;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pay-section-label {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-soft);
  margin-bottom: -2px;
}

.pay-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.pay-btn {
  padding: 7px 4px;
  border: 1.5px solid var(--divider);
  border-radius: var(--r-sm);
  background: var(--cream);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-mid);
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.pay-btn svg {
  width: 17px;
  height: 17px;
}

.pay-btn:hover {
  border-color: var(--gold);
  background: var(--gold-pale);
  color: var(--maroon);
}

.pay-btn.selected {
  background: var(--maroon);
  border-color: var(--maroon);
  color: var(--gold-light);
  box-shadow: 0 4px 14px rgba(var(--theme-shadow-rgb), 0.25);
}

.pay-btn.selected svg {
  color: var(--gold-light);
}

.action-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.act-btn {
  padding: 9px 8px;
  border: none;
  border-radius: var(--r-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-generate {
  background: linear-gradient(110deg, var(--maroon-deep), var(--maroon-mid));
  color: var(--gold-light);
  padding: 11px;
  font-size: 0.88rem;
  border-radius: var(--r);
  box-shadow: 0 4px 18px rgba(var(--theme-shadow-rgb), 0.3);
  letter-spacing: 0.5px;
}

.btn-generate:hover {
  background: linear-gradient(110deg, var(--hover-start), var(--maroon));
  box-shadow: 0 6px 24px rgba(var(--theme-shadow-rgb), 0.4);
  transform: translateY(-1px);
}

.btn-print {
  background: var(--gold-pale);
  color: var(--maroon-deep);
  border: 1.5px solid var(--gold-border);
}

.btn-print:hover {
  background: var(--gold-light);
  border-color: var(--gold);
}

.btn-clear {
  background: #fff5f5;
  color: #c0392b;
  border: 1.5px solid #fcd2d2;
}

.btn-clear:hover {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}

/* ═══════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════ */
#toastContainer {
  position: fixed;
  top: 76px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--maroon-deep);
  color: var(--gold-light);
  padding: 11px 18px;
  border-radius: var(--r-sm);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 8px 28px rgba(var(--theme-shadow-rgb), 0.3);
  border-left: 3px solid var(--gold);
  animation: tIn 0.3s ease, tOut 0.3s ease 2.3s forwards;
  max-width: 260px;
}

@keyframes tIn {
  from {
    opacity: 0;
    transform: translateX(30px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes tOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(30px);
  }
}

/* ═══════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════ */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(var(--theme-shadow-rgb), 0.65);
  z-index: 800;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.overlay.open {
  display: flex;
}

.bill-modal {
  background: var(--white);
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(var(--theme-shadow-rgb), 0.45);
  animation: mIn 0.3s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes mIn {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.bill-modal::-webkit-scrollbar {
  width: 4px;
}

.bill-modal::-webkit-scrollbar-thumb {
  background: var(--divider);
}

.receipt {
  padding: 26px 26px 18px;
}

.receipt-head {
  text-align: center;
  margin-bottom: 14px;
}

.receipt-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.r-shop-name {
  font-family: 'Inter', sans-serif;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--maroon-deep);
}

.r-shop-prefix {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--maroon-soft);
  line-height: 1;
  margin-bottom: 2px;
}

.r-tagline {
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-top: 2px;
  letter-spacing: 0.3px;
}

.r-div {
  border: none;
  border-top: 1.5px dashed var(--cream-dark);
  margin: 11px 0;
}

.r-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.77rem;
  color: var(--ink-mid);
  margin-bottom: 4px;
  font-weight: 500;
}

.r-meta strong {
  color: var(--maroon-deep);
}

.r-col-head {
  display: grid;
  grid-template-columns: 1fr 72px 72px 72px;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ink-soft);
  padding: 7px 0;
  border-bottom: 1px solid var(--divider);
}

.r-item-row {
  display: grid;
  grid-template-columns: 1fr 72px 72px 72px;
  gap: 4px;
  padding: 7px 0;
  border-bottom: 1px solid var(--cream-dark);
  font-size: 0.8rem;
}

.r-item-row .iname {
  font-weight: 600;
  color: var(--maroon-deep);
}

.r-item-row .num {
  text-align: right;
  color: var(--ink-mid);
}

.r-totals {
  margin-top: 10px;
}

.r-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.83rem;
  padding: 4px 0;
  color: var(--ink-mid);
}

.r-total-row.grand {
  font-size: 1rem;
  font-weight: 800;
  color: var(--maroon-deep);
  border-top: 2px solid var(--maroon);
  margin-top: 8px;
  padding-top: 10px;
}

.r-footer {
  text-align: center;
  margin-top: 16px;
}

.r-thankyou {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--maroon-deep);
  margin-bottom: 5px;
}

.r-footer-sub {
  font-size: 0.72rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.modal-footer {
  padding: 14px 24px 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border-top: 1.5px solid var(--divider);
}

.modal-footer .act-btn {
  padding: 12px;
  font-size: 0.88rem;
}

.btn-modal-close {
  background: var(--cream);
  color: var(--ink-mid);
  border: 1.5px solid var(--divider);
}

.btn-modal-close:hover {
  background: var(--cream-dark);
}

.confirm-card {
  background: var(--white);
  border-radius: 16px;
  max-width: 320px;
  width: 100%;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(30, 8, 8, 0.45);
  animation: mIn 0.25s ease;
}

.confirm-card .c-icon {
  width: 52px;
  height: 52px;
  background: #fff5f5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.confirm-card h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.confirm-card p {
  font-size: 0.84rem;
  color: var(--ink-soft);
  margin-bottom: 22px;
  line-height: 1.5;
}

.confirm-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-btns button {
  padding: 10px 22px;
  border: none;
  border-radius: var(--r-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.c-yes {
  background: #c0392b;
  color: #fff;
}

.c-yes:hover {
  background: #a93226;
}

.c-no {
  background: var(--cream);
  color: var(--ink-mid);
  border: 1.5px solid var(--divider);
}

.c-no:hover {
  background: var(--cream-dark);
}

/* item modal */
.item-modal {
  background: var(--white);
  border-radius: 16px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(30, 8, 8, 0.45);
  animation: mIn 0.3s cubic-bezier(.34, 1.56, .64, 1);
  overflow: hidden;
}

.item-modal-head {
  padding: 22px 26px 2px;
}

.item-modal-head h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.12rem;
  color: var(--maroon-deep);
}

.item-modal-body {
  padding: 10px 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.form-field label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-field input,
.form-field select {
  padding: 9px 12px;
  border: 1.5px solid var(--divider);
  border-radius: var(--r-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.86rem;
  background: var(--cream);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(232, 160, 32, 0.12);
}

/* ═══════════════════════════════════════════
   INVENTORY
   ═══════════════════════════════════════════ */
.inv-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.inv-table th {
  text-align: left;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-soft);
  background: #fff9ec;
  padding: 12px 16px;
  border-bottom: 1.5px solid var(--divider);
  white-space: nowrap;
}

.inv-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--divider);
  font-size: 0.85rem;
  color: var(--ink-mid);
}

.inv-table tr:last-child td {
  border-bottom: none;
}

.inv-name {
  font-weight: 700;
  color: var(--maroon-deep);
  font-family: 'Inter', sans-serif;
}

.inv-emoji {
  margin-right: 7px;
  font-size: 1rem;
  vertical-align: middle;
}

.per-100 {
  font-size: 0.7rem;
  color: var(--ink-soft);
}

.cat-tag {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: capitalize;
}

.cat-tag.cat-sweets {
  background: var(--gold-pale);
  color: #8a5a00;
}

.cat-tag.cat-chips {
  background: #ffe8d2;
  color: #a05a1a;
}

.cat-tag.cat-savory {
  background: #f3dada;
  color: var(--maroon-deep);
}

.inv-actions {
  white-space: nowrap;
}

.inv-act-btn {
  border: 1px solid var(--divider);
  background: var(--cream);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 0.85rem;
  margin-right: 5px;
  transition: background 0.15s, border-color 0.15s;
}

.inv-act-btn:hover {
  background: var(--gold-pale);
  border-color: var(--gold-border);
}

.inv-act-btn.danger:hover {
  background: #ffecec;
  border-color: #eab0b0;
}

/* ═══════════════════════════════════════════
   REPORTS
   ═══════════════════════════════════════════ */
.report-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.report-card {
  background: var(--white);
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rc-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
}

.rc-value {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--maroon-deep);
}

.report-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.report-section {
  background: var(--white);
  border-radius: var(--r);
  box-shadow: var(--card-shadow);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.report-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
}

.report-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.report-row-label {
  min-width: 110px;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ink-mid);
}

.date-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--maroon);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
}

.date-link-btn:hover {
  color: var(--maroon-deep);
}

.range-btns {
  display: flex;
  gap: 6px;
}

.range-btn {
  border: 1px solid var(--divider);
  background: var(--white);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink-mid);
  transition: all 0.15s;
}

.range-btn:hover {
  border-color: var(--gold-border);
}

.range-btn.active {
  background: var(--maroon);
  border-color: var(--maroon);
  color: var(--gold-light);
}

#dayReportDate,
#monthReportMonth,
#rangeFromDate,
#rangeToDate,
#dsFromDate,
#dsToDate {
  border: 1px solid var(--divider);
  background: var(--white);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-mid);
  font-family: 'Inter', sans-serif;
  cursor: pointer;
}

.sub-time {
  font-size: 0.7rem;
  color: var(--ink-soft);
}

.items-cell {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════════ */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  max-width: 920px;
}

.settings-card {
  background: var(--white);
  border-radius: var(--r);
  box-shadow: var(--card-shadow);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-card h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: var(--maroon-deep);
  margin-bottom: 2px;
}

.settings-hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.settings-card.full {
  grid-column: 1/-1;
}

.settings-card.danger-zone {
  border: 1.5px solid #fcd2d2;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 980px) {
  .report-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {

  html,
  body {
    height: auto;
    overflow: auto;
  }

  .app-main {
    overflow: visible;
  }

  .layout {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .left-panel {
    overflow: visible;
    border-right: none;
    border-bottom: 1.5px solid var(--divider);
  }

  .products-scroll {
    max-height: 380px;
    overflow-y: auto;
  }

  .right-panel {
    overflow: visible;
  }

  .bill-scroll {
    max-height: 280px;
    overflow-y: auto;
  }

  .bill-table-head,
  .bill-item {
    grid-template-columns: 1.6fr .8fr .95fr 1fr 1fr .55fr;
    gap: 6px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weight-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .view-scroll {
    padding: 14px 16px 28px;
  }

  .header-text p {
    display: none;
  }

  .today-pill {
    display: none;
  }
}

/* ═══════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════ */
@media print {
  @page {
    size: 58mm auto;
    margin: 0;
  }

  body * {
    visibility: hidden;
  }

  .receipt,
  .receipt * {
    visibility: visible;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .receipt {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    padding: 2mm 2mm calc(4mm + 5px);
  }

  .r-shop-name {
    font-size: 13px;
  }

  .r-tagline {
    font-size: 8.5px;
  }

  .r-meta {
    font-size: 8.5px;
    flex-wrap: wrap;
    gap: 2px 0;
  }

  /* Grid columns don't fit 58mm paper — switch to a wrapping flex layout:
     item/label takes the full line; on the line below, weight+price
     cluster on the left (standard thermal-receipt style) and the total
     is pushed flush right, instead of splitting into equal columns. */
  .r-col-head,
  .r-item-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 8px;
  }

  .r-col-head span:first-child,
  .r-item-row .iname {
    flex: 1 1 100%;
  }

  .r-col-head span:not(:first-child),
  .r-item-row .num {
    flex: 0 0 auto;
    min-width: 0;
  }

  .r-col-head span:last-child,
  .r-item-row .num:last-child {
    margin-left: auto;
    text-align: right;
  }

  .r-col-head {
    font-size: 8px;
  }

  .r-item-row {
    font-size: 8.5px;
    padding: 4px 0;
  }

  .r-total-row {
    font-size: 8.5px;
  }

  .r-total-row.grand {
    font-size: 10.5px;
  }

  .r-thankyou {
    font-size: 10px;
  }

  .r-footer-sub {
    font-size: 8px;
  }

  .modal-footer {
    display: none;
  }
}

/* ═══════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--maroon-deep) 0%, var(--maroon) 55%, var(--maroon-mid) 100%);
  padding: 20px;
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-brand h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 1.7rem;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--maroon-mid) 0%, var(--maroon-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--maroon-deep);
}

.login-brand .shop-title-prefix {
  color: var(--gold-border);
  text-align: center;
}

.login-brand p {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 4px;
}

.login-section h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: var(--maroon-deep);
  margin-bottom: 4px;
}

.login-hint {
  font-size: 0.76rem;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.login-section .form-field {
  margin-bottom: 12px;
}

.login-section input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--divider);
  border-radius: var(--r-sm);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  outline: none;
}

.login-section input:focus {
  border-color: var(--gold-border);
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-wrapper input {
  padding-right: 44px;
}

.toggle-pwd-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  transition: color 0.15s ease;
}

.toggle-pwd-btn:hover {
  color: var(--maroon-deep);
}

.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 22px 0;
  color: var(--ink-soft);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--divider);
}

.login-divider span {
  padding: 0 12px;
}

.login-error {
  margin-top: 18px;
  padding: 10px 14px;
  background: #ffecec;
  border: 1px solid #eab0b0;
  border-radius: var(--r-sm);
  color: #b3261e;
  font-size: 0.82rem;
  text-align: center;
}

/* ═══════════════════════════════════════════
   HOMEPAGE
   ═══════════════════════════════════════════ */
.home-hero {
  text-align: center;
  max-width: 700px;
  margin: 10px auto 20px;
  padding: 0 20px;
  animation: cardFadeIn 0.5s ease both;
}

.home-hero h2 {
  font-family: 'Inter', sans-serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--maroon-deep);
  margin-bottom: 12px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.home-hero p {
  font-size: 1.02rem;
  color: var(--ink-mid);
  line-height: 1.6;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  max-width: 1200px;
  width: 95%;
  margin: 10px auto 30px;
  animation: cardFadeIn 0.6s ease both;
}

.home-card {
  background: var(--white);
  border-radius: var(--r);
  box-shadow: var(--card-shadow);
  border: 1.5px solid transparent;
  padding: 26px 20px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.22s cubic-bezier(.34, 1.56, .64, 1), box-shadow 0.22s ease, border-color 0.22s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.home-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-hover);
  border-color: var(--gold);
}

.home-card-icon {
  width: 46px;
  height: 46px;
  background: var(--gold-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--maroon);
  transition: background 0.2s, color 0.2s;
}

.home-card:hover .home-card-icon {
  background: var(--maroon);
  color: var(--gold-light);
}

.home-card-icon svg {
  width: 22px;
  height: 22px;
}

.home-card-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--maroon-deep);
}

.home-card-desc {
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

@media (max-width: 1024px) {
  .home-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .home-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .home-hero h2 {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════
   CHECKOUT PAGE & FLOATING BAR STYLES
   ═══════════════════════════════════════════ */
.layout.single-col {
  grid-template-columns: 1fr;
}

.left-panel.full-width {
  border-right: none;
}

.checkout-floating-bar {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: floatBarSlideUp 0.3s cubic-bezier(.34, 1.56, .64, 1) both;
}

@keyframes floatBarSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.checkout-floating-bar button {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-deep) 100%);
  color: var(--gold-pale);
  border: 1.5px solid var(--gold);
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(var(--theme-shadow-rgb), 0.45);
  font-weight: 700;
  transition: transform 0.2s, box-shadow 0.2s;
}

.checkout-floating-bar button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(var(--theme-shadow-rgb), 0.55);
  background: linear-gradient(135deg, var(--maroon-mid) 0%, var(--maroon-deep) 100%);
}

.checkout-badge {
  background: var(--gold);
  color: var(--maroon-deep);
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0 4px;
  margin-left: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.checkout-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 480px;
  overflow: hidden;
  min-height: 0;
  background: var(--cream);
}

.checkout-cart-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px 24px;
  border-right: 1.5px solid var(--divider);
  background: var(--white);
  border-radius: var(--r) 0 0 var(--r);
  margin: 14px 0 14px 14px;
  box-shadow: var(--card-shadow);
}

.checkout-summary-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 24px;
  background: var(--cream-dark);
  border-radius: 0 var(--r) var(--r) 0;
  margin: 14px 14px 14px 0;
  box-shadow: var(--card-shadow);
}

.bi-weight-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.bi-weight-input {
  width: 65px;
  border: 1.5px solid transparent;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  padding: 3px 5px;
  border-radius: 5px;
  outline: none;
  text-align: right;
  -moz-appearance: textfield;
  appearance: textfield;
}

.bi-weight-input::-webkit-outer-spin-button,
.bi-weight-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.bi-weight-input:hover {
  border-color: var(--divider);
  background: var(--cream);
}

.bi-weight-input:focus {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 2px rgba(232, 160, 32, .15);
}

.weight-unit {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
}

@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  }
}

@media (max-width: 1024px) {
  header {
    height: 40px !important;
    padding: 0 14px !important;
  }
  .today-pill {
    padding: 4px 10px !important;
    font-size: 0.68rem !important;
  }
  .datetime-box {
    padding: 3px 8px !important;
  }
  .datetime-box .d-date {
    display: none !important;
  }
  .datetime-box .d-time {
    font-size: 0.8rem !important;
  }
  .checkout-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .checkout-cart-panel,
  .checkout-summary-panel {
    margin: 14px;
    border-radius: var(--r);
    overflow: visible;
  }
  .checkout-cart-panel {
    border-right: none;
    border-bottom: 1.5px solid var(--divider);
  }
}

@media (max-width: 768px) {
  header {
    height: 38px !important;
    padding: 0 10px !important;
  }
  .app-sidebar {
    width: 56px !important;
  }
  .sidebar-brand {
    padding: 14px 0 !important;
    justify-content: center !important;
  }
  .sidebar-brand-title,
  .sidebar-toggle {
    display: none !important;
  }
  .nav-tab {
    padding: 12px 0 !important;
    justify-content: center !important;
    gap: 0 !important;
    font-size: 0 !important;
  }
  /* Icons use stroke="currentColor" — set color on the svg itself rather
     than on .nav-tab (font-size:0 already hides the text label), otherwise
     forcing .nav-tab's color to transparent makes every inactive icon
     invisible too, since they inherit currentColor from their parent. */
  .nav-tab svg {
    width: 22px !important;
    height: 22px !important;
    margin: 0 !important;
    color: rgba(255, 255, 255, 0.65);
  }
  .nav-tab:hover svg {
    color: var(--white);
  }
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
    gap: 10px !important;
  }
  .products-scroll {
    padding: 10px 8px 24px !important;
  }
  .search-bar {
    padding: 8px 10px !important;
    gap: 6px !important;
  }
  #searchInput {
    padding: 8px 10px 8px 34px !important;
    font-size: 0.84rem !important;
  }
  .weight-grid {
    gap: 4px !important;
    margin-top: 3px !important;
    margin-bottom: 4px !important;
  }
  .weight-btn {
    padding: 5px 4px !important;
    font-size: 0.74rem !important;
  }
  .today-pill {
    padding: 3px 8px !important;
    font-size: 0.66rem !important;
  }
  .datetime-box {
    padding: 3px 6px !important;
  }
  .datetime-box .d-date {
    display: none !important;
  }
  .datetime-box .d-time {
    font-size: 0.76rem !important;
  }
  .cart-drawer {
    width: 100vw !important;
  }
  .checkout-floating-bar {
    bottom: 16px !important;
    right: 16px !important;
  }
  .report-cards {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    gap: 10px !important;
  }
  .view-scroll {
    padding: 10px 10px 24px !important;
  }
  .inv-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .form-row {
    grid-template-columns: 1fr !important;
  }
  .products-page-header {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }
  .products-page-title {
    flex-wrap: wrap !important;
  }
  .add-product-btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

@media (max-width: 520px) {
  .app-sidebar {
    width: 48px !important;
  }
  .products-grid {
    grid-template-columns: 1fr !important;
  }
  .search-top {
    gap: 6px !important;
  }
  #searchInput {
    padding-left: 34px !important;
    font-size: 0.82rem !important;
  }
  .count-pill {
    padding: 4px 10px !important;
    font-size: 0.7rem !important;
  }
  .quick-picks-row {
    gap: 8px !important;
  }
  .qp-btn {
    padding: 8px 12px !important;
    font-size: 0.78rem !important;
  }
  .filter-btn {
    padding: 5px 10px !important;
    font-size: 0.72rem !important;
  }
  .checkout-floating-bar {
    bottom: 12px !important;
    right: 12px !important;
  }
}

/* ═══════════════════════════════════════════
   FLOATING CHECKOUT BAR
   ═══════════════════════════════════════════ */
.checkout-floating-bar {
  position: fixed;
  bottom: 24px;
  right: 28px;
  z-index: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

/* ═══════════════════════════════════════════
   CART DRAWER & MINI PREVIEW
   ═══════════════════════════════════════════ */
.cart-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(var(--theme-shadow-rgb), 0.65);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cart-drawer-backdrop.open {
  display: block;
  opacity: 1;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--cream);
  z-index: 910;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(.34, 1.56, .64, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(var(--theme-shadow-rgb), 0.2);
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--white);
  border-bottom: 1.5px solid var(--divider);
}

.cart-drawer-header h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--maroon-deep);
  margin: 0;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
}

.drawer-close-btn:hover {
  color: #c0392b;
}

.cart-drawer .checkout-layout {
  grid-template-columns: 1fr;
  flex: 1;
  overflow-y: auto;
  background: var(--cream);
}

.cart-drawer .checkout-cart-panel {
  border-radius: 0;
  margin: 0;
  box-shadow: none;
  border-right: none;
  border-bottom: 1.5px solid var(--divider);
}

.cart-drawer .checkout-summary-panel {
  border-radius: 0;
  margin: 0;
  box-shadow: none;
  background: var(--white);
}

.mini-preview {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  background: var(--white);
  border-radius: var(--r);
  box-shadow: 0 12px 40px rgba(var(--theme-shadow-rgb), 0.4);
  width: 300px;
  max-height: 350px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  padding: 12px;
  transform-origin: bottom right;
  animation: popIn 0.2s cubic-bezier(.34, 1.56, .64, 1);
  border: 1px solid var(--divider);
}

.mini-preview.open {
  display: flex;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.mp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px;
  border-bottom: 1px solid var(--cream-dark);
}

.mp-item:last-child {
  border-bottom: none;
}

.mp-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.mp-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
}

.mp-qty {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.mp-total {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--maroon-deep);
  margin-right: 12px;
}

.mp-del {
  background: transparent;
  border: none;
  color: #c0392b;
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
  line-height: 1;
}

/* ═══════════════════════════════════════════
   QUICK PICKS & CARD HIGHLIGHTS
   ═══════════════════════════════════════════ */
.quick-picks-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 0 16px 0;
  margin-bottom: 8px;
}

.quick-picks-row::-webkit-scrollbar {
  height: 4px;
}
.quick-picks-row::-webkit-scrollbar-thumb {
  background: var(--divider);
  border-radius: 4px;
}

.qp-btn {
  background: var(--white);
  border: 1.5px solid var(--divider);
  border-radius: var(--r-sm);
  padding: 10px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.qp-btn:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(var(--theme-shadow-rgb), 0.15);
}

.product-card.active-in-cart {
  border: 2px solid var(--gold);
  background: #fffdf5;
}

.qty-stepper-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--maroon);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-top: 10px;
}

.qty-stepper-inline button {
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-stepper-inline button:hover {
  background: rgba(0,0,0,0.15);
}

.qty-stepper-inline .qty-val {
  color: var(--white);
  font-weight: 700;
  font-size: 0.95rem;
  flex: 1;
  text-align: center;
}
/* ═══════════════════════════════════════════
   MULTI-BILL TABS
   ═══════════════════════════════════════════ */
.bill-tabs-container {
  display: flex;
  overflow-x: auto;
  background: transparent;
  padding: 0;
  gap: 6px;
  border-bottom: none;
  height: 100%;
  align-items: flex-end;
  flex: 1;
  max-width: 65%;
}

.bill-tabs-container::-webkit-scrollbar {
  height: 4px;
}
.bill-tabs-container::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 4px;
}

.bill-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--divider);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink-soft);
  transition: all 0.2s;
  white-space: nowrap;
}

.bill-tab:hover {
  background: rgba(255, 255, 255, 0.8);
}

.bill-tab.active {
  background: var(--white);
  color: var(--maroon);
  border-color: var(--divider);
  position: relative;
}

.bill-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--white);
}

.bill-tab.new-tab {
  background: transparent;
  border: 1px dashed var(--divider);
  color: var(--maroon-soft);
}
.bill-tab.new-tab:hover {
  background: rgba(255,255,255,0.5);
  border-color: var(--maroon-soft);
  color: var(--maroon);
}

.close-tab-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.close-tab-btn:hover {
  background: rgba(200, 50, 50, 0.1);
  color: #c83232;
}

/* ═══════════════════════════════════════════
   SIDEBAR TOGGLE BUTTON
   ═══════════════════════════════════════════ */
.sidebar-toggle {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}
.sidebar-toggle:hover {
  background: rgba(255,255,255,0.1);
  color: var(--white);
}
.sidebar-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* ═══════════════════════════════════════════
   SIDEBAR COLLAPSED STATE
   Dual selector: html[data-sidebar] fires instantly (set in <head>)
   .sidebar-collapsed fires after JS toggle — both must match
   ═══════════════════════════════════════════ */

/* Collapsed sidebar width */
html[data-sidebar="collapsed"] .app-sidebar,
.app-layout.sidebar-collapsed .app-sidebar {
  width: 68px;
}

/* Hide brand text */
html[data-sidebar="collapsed"] .sidebar-brand h1,
html[data-sidebar="collapsed"] .sidebar-brand p,
html[data-sidebar="collapsed"] .shop-title-prefix,
.app-layout.sidebar-collapsed .sidebar-brand h1,
.app-layout.sidebar-collapsed .sidebar-brand p,
.app-layout.sidebar-collapsed .shop-title-prefix {
  display: none;
}

/* Brand container when collapsed */
html[data-sidebar="collapsed"] .sidebar-brand,
.app-layout.sidebar-collapsed .sidebar-brand {
  padding: 20px 0;
  justify-content: center;
  align-items: center;
  gap: 0;
}

/* Hide brand title div entirely */
html[data-sidebar="collapsed"] .sidebar-brand-title,
.app-layout.sidebar-collapsed .sidebar-brand-title {
  display: none;
}

/* Toggle arrow flips when collapsed */
html[data-sidebar="collapsed"] .sidebar-toggle,
.app-layout.sidebar-collapsed .sidebar-toggle {
  transform: rotate(180deg);
}

/* Nav tabs: icon only */
html[data-sidebar="collapsed"] .nav-tab,
.app-layout.sidebar-collapsed .nav-tab {
  padding: 12px 0;
  justify-content: center;
  gap: 0;
  font-size: 0;       /* hides text nodes */
  color: transparent; /* hides link text colour */
}

html[data-sidebar="collapsed"] .nav-tab svg,
.app-layout.sidebar-collapsed .nav-tab svg {
  width: 22px;
  height: 22px;
  margin: 0;
  flex-shrink: 0;
  opacity: 0.7;
  color: rgba(255,255,255,0.65);
}

html[data-sidebar="collapsed"] .nav-tab.active svg,
.app-layout.sidebar-collapsed .nav-tab.active svg {
  opacity: 1;
  color: var(--gold-light);
}

/* ═══════════════════════════════════════════
   PRODUCTS PAGE
   ═══════════════════════════════════════════ */

.products-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 28px;
  gap: 20px;
  overflow: hidden;
}

/* Page Header */
.products-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.products-page-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.products-page-title h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
}

.prod-count-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--cream-dark);
  padding: 3px 10px;
  border-radius: 20px;
}

.add-product-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--maroon-deep), var(--maroon-mid));
  color: var(--gold-light);
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(74,16,16,0.25);
}
.add-product-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(74,16,16,0.35);
}
.add-product-btn svg {
  width: 16px;
  height: 16px;
}

/* Controls */
.products-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.prod-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.prod-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--ink-soft);
  pointer-events: none;
}

.prod-search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1.5px solid var(--divider);
  border-radius: 10px;
  background: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}
.prod-search-input:focus {
  border-color: var(--maroon-soft);
}

.prod-filters {
  display: flex;
  gap: 6px;
}

.prod-filter-btn {
  padding: 8px 16px;
  border: 1.5px solid var(--divider);
  border-radius: 8px;
  background: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.18s;
}
.prod-filter-btn:hover {
  border-color: var(--maroon-soft);
  color: var(--maroon);
}
.prod-filter-btn.active {
  background: var(--maroon);
  border-color: var(--maroon);
  color: var(--gold-light);
}

/* Table */
.products-table-wrap {
  flex: 1;
  overflow-y: auto;
  border-radius: 12px;
  border: 1.5px solid var(--divider);
  background: var(--white);
}

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

.products-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--cream-dark);
}

.products-table th {
  padding: 8px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  border-bottom: 1.5px solid var(--divider);
}

.prod-row {
  border-bottom: 1px solid var(--divider);
  transition: background 0.15s;
}
.prod-row:last-child { border-bottom: none; }
.prod-row:hover { background: var(--cream); }

.products-table td {
  padding: 7px 14px;
  vertical-align: middle;
}

.prod-id-cell {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
  width: 50px;
}

.prod-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}

.prod-cat-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
}
.cat-chips  { background: #FFF3DC; color: #A06010; }
.cat-sweets { background: #FFE8E8; color: #8B1A1A; }
.cat-savory { background: #E8F5E8; color: #1A6B1A; }

.prod-price {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}
.prod-unit {
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-left: 4px;
}

.prod-actions-cell {
  display: flex;
  gap: 8px;
  align-items: center;
}

.prod-edit-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  background: var(--cream-dark);
  border: 1.5px solid var(--divider);
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-mid);
  cursor: pointer;
  transition: all 0.18s;
}
.prod-edit-btn:hover {
  background: var(--maroon);
  border-color: var(--maroon);
  color: var(--gold-light);
}
.prod-edit-btn svg { width: 13px; height: 13px; }

.prod-del-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1.5px solid var(--divider);
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 0.18s;
}
.prod-del-btn:hover {
  background: #FFF0F0;
  border-color: #E84040;
  color: #C83232;
}
.prod-del-btn svg { width: 14px; height: 14px; }

/* Empty state */
.prod-empty-row td { padding: 0 !important; }
.prod-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--ink-soft);
}
.prod-empty-state svg { width: 48px; height: 48px; opacity: 0.35; }
.prod-empty-state p { font-size: 0.92rem; font-weight: 600; }

/* ═══════════════════════════════════════════
   PRODUCT MODAL
   ═══════════════════════════════════════════ */

.prod-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 5, 5, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.prod-modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.prod-modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 60px rgba(74,16,16,0.3);
  transform: translateY(12px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
.prod-modal-overlay.visible .prod-modal {
  transform: translateY(0);
}
.prod-modal-sm {
  max-width: 380px;
}

.prod-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--divider);
  background: var(--cream);
}
.prod-modal-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
}
.prod-modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  transition: all 0.18s;
}
.prod-modal-close:hover { background: var(--cream-dark); color: var(--ink); }
.prod-modal-close svg { width: 18px; height: 18px; }

.prod-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.prod-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.prod-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prod-form-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-mid);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prod-form-group input,
.prod-form-group select {
  padding: 10px 13px;
  border: 1.5px solid var(--divider);
  border-radius: 9px;
  background: var(--cream);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}
.prod-form-group input:focus,
.prod-form-group select:focus {
  border-color: var(--maroon-soft);
  background: var(--white);
}

/* Toggle switch */
.prod-unit-toggle-group { gap: 8px; }
.prod-toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-mid);
}
.prod-toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.prod-toggle-switch input { opacity: 0; width: 0; height: 0; }
.prod-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--divider);
  border-radius: 24px;
  transition: background 0.25s;
  cursor: pointer;
}
.prod-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.prod-toggle-switch input:checked + .prod-toggle-slider { background: var(--maroon); }
.prod-toggle-switch input:checked + .prod-toggle-slider::before { transform: translateX(20px); }

.prod-unit-hint {
  font-size: 0.76rem;
  color: var(--ink-soft);
  margin-top: -4px;
}

.prod-form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
  border-top: 1px solid var(--divider);
}

.prod-cancel-btn {
  padding: 10px 20px;
  background: var(--cream-dark);
  border: 1.5px solid var(--divider);
  border-radius: 9px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-mid);
  cursor: pointer;
  transition: all 0.18s;
}
.prod-cancel-btn:hover { border-color: var(--maroon-soft); }

.prod-save-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--maroon-deep), var(--maroon-mid));
  border: none;
  border-radius: 9px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold-light);
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: 0 4px 14px rgba(74,16,16,0.25);
}
.prod-save-btn:hover { transform: translateY(-1px); }
.prod-save-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Delete confirm modal */
.prod-delete-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.prod-delete-body svg {
  width: 48px;
  height: 48px;
  color: #E84040;
}
.prod-delete-body p {
  font-size: 0.9rem;
  color: var(--ink-mid);
  line-height: 1.55;
}
.prod-delete-actions {
  display: flex;
  gap: 10px;
  padding: 0 24px 24px;
  justify-content: flex-end;
}
.prod-del-confirm-btn {
  padding: 10px 24px;
  background: #C83232;
  border: none;
  border-radius: 9px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: all 0.18s;
}
.prod-del-confirm-btn:hover { background: #A82020; }
.prod-del-confirm-btn:disabled { opacity: 0.6; cursor: not-allowed; }
