/* ===================== DigiWizr — style.css ===================== */

:root {
  /* --navy now carries the DigiWizr brand purple — it is the app's general
     text/border/accent color (labels, selected chips, sticky bars, buttons).
     --gray-panel is used specifically for the header and slide-in menu
     background, per the DigiWizr brand palette. */
  --navy: #695EA9;
  --purple: #695EA9;
  --cyan: #5AC9E8;
  --gray-panel: #D3D3D3;
  --white: #FFFFFF;
  --emerald: #2ECC71;
  --red: #E74C3C;
  --grey: #7F8C8D;
  --blue: #3498DB;
  --amber: #F39C12;
  --ribbon-gold: #D8AE44;
  --disabled-bg: #CCCCCC;
  --disabled-text: #888888;
}

* { box-sizing: border-box; }

/* Browsers don't let form controls (button/select/input/textarea) inherit the
   page's font-family by default (their own UA stylesheet wins) — this is why
   buttons were falling back to the OS system font instead of Hind Siliguri
   even though body.lang-bn sets it below. Force them to inherit explicitly. */
button, select, input, textarea { font-family: inherit; }

html {
  touch-action: pan-x pan-y;
  -ms-touch-action: pan-x pan-y;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--white);
  color: var(--navy);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: pan-x pan-y;
}

body.lang-bn {
  font-family: 'Hind Siliguri', 'Segoe UI', sans-serif;
  font-size: 14px;
}
body.lang-bn button, body.lang-bn .btn { font-size: 16px; }
body.lang-bn .section-title, body.lang-bn .list-title { font-weight: 600; }

#app { min-height: 100vh; display: flex; flex-direction: column; }

a { color: var(--cyan); text-decoration: none; }
a:hover, a:active { color: var(--navy); }

/* ---------- Header ---------- */
.app-header {
  background: var(--gray-panel);
  color: var(--white);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
}
.app-header .header-side { display: flex; align-items: center; min-width: 0; }
.app-header .header-side.left { justify-self: start; }
.app-header .header-side.right { justify-self: end; }
.app-header .back-btn { background: none; border: none; color: var(--white); cursor: pointer; display: flex; padding: 0; }
.app-header .back-btn:hover, .app-header .back-btn:active { color: var(--navy); }
.app-header img.logo { height: 54px; width: auto; display: block; max-width: 100%; }
.header-center { justify-self: center; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: 68px; }
.business-name-tag, .header-subtitle { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.business-name-tag { color: var(--white); font-size: 13px; font-weight: 600; margin-top: 2px; }
.header-subtitle {
  color: rgba(255,255,255,0.85);
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
  text-align: center;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Language switcher (currency is set separately, in Edit Account) */
.lang-switcher select {
  background: var(--navy);
  color: var(--white);
  border: 1px solid var(--white);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
}
.lang-switcher select:hover, .lang-switcher select:focus { background: var(--cyan); border-color: var(--cyan); color: var(--white); }

/* ---------- Burger menu button ---------- */
.menu-burger-btn { background: none; border: none; color: var(--white); cursor: pointer; display: flex; align-items: center; padding: 0; }
.menu-burger-btn:hover, .menu-burger-btn:active { color: var(--navy); }

/* ---------- App menu (slide-in drawer) ---------- */
.app-menu-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 150;
  visibility: hidden; transition: background 0.25s ease, visibility 0s linear 0.3s;
}
.app-menu-overlay.open { background: rgba(0,0,0,0.45); visibility: visible; transition: background 0.25s ease; }
.app-menu-drawer {
  position: absolute; top: 0; right: 0; height: 100%;
  width: 200px; max-width: 82vw;
  background: var(--gray-panel); color: var(--white);
  box-shadow: -4px 0 18px rgba(0,0,0,0.25);
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 0 18px;
  display: flex; flex-direction: column;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.app-menu-overlay.open .app-menu-drawer { transform: translateX(0); }
.app-menu-close {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px;
  background: none; border: none; color: var(--white); cursor: pointer; padding: 4px; line-height: 0; z-index: 1;
}
.app-menu-close:hover, .app-menu-close:active { color: var(--navy); }
.app-menu-group { display: flex; flex-direction: column; padding: 2px 0; }
.app-menu-top { padding-top: 4px; gap: 6px; padding-right: 40px; }
.app-menu-divider { height: 1px; background: rgba(0,0,0,0.15); margin: 2px 18px; }
.app-menu-spacer { flex: 1; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; background: none; border: none; color: var(--white);
  padding: 7px 18px; font-size: 14px; text-align: left; cursor: pointer;
  white-space: nowrap; overflow: hidden;
}
.menu-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item:hover, .menu-item:active { background: rgba(105,94,169,0.18); color: var(--navy); }
.menu-item:hover svg, .menu-item:active svg { color: var(--navy) !important; }
.menu-item-chevron { margin-left: auto; display: flex; flex-shrink: 0; }
.app-menu-submenu { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; display: flex; flex-direction: column; }
.app-menu-submenu.open { max-height: 220px; }
.app-menu-submenu.open.large { max-height: 420px; }
.app-menu-submenu .menu-item { padding-left: 40px; font-size: 13px; padding-top: 6px; padding-bottom: 6px; }
.app-menu-section-label {
  padding: 6px 18px 1px; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: rgba(255,255,255,0.85);
}
.app-menu-lang { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 18px; }
.app-menu-lang-label { display: flex; align-items: center; gap: 12px; font-size: 14px; white-space: nowrap; flex-shrink: 0; }

/* ---------- Layout ---------- */
.screen-body { flex: 1; padding: 16px; padding-bottom: 90px; max-width: 640px; margin: 0 auto; width: 100%; }

.pin-screen-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  padding: 16px;
  max-width: 400px;
  margin: 0 auto;
  width: 100%;
  overflow: hidden;
}

.section-title {
  font-weight: bold;
  color: var(--navy);
  margin: 22px 0 10px;
  border-left: 4px solid var(--emerald);
  padding-left: 8px;
}

.card {
  border: 1.5px solid var(--navy);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--white);
}

.muted { color: var(--grey); }
.italic { font-style: italic; }
.bold { font-weight: bold; }
.right { text-align: right; }
.center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--navy);
  color: var(--white);
  border: 1.5px solid var(--navy);
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--cyan); border-color: var(--cyan); }
.btn.left-align { justify-content: flex-start; }
.btn.outline {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn.outline:hover { background: var(--cyan); color: var(--white); border-color: var(--cyan); }
.btn.outline.danger { color: var(--red); border-color: var(--red); }
.btn.outline.danger:hover { background: var(--red); color: var(--white); border-color: var(--red); }
.btn.small { padding: 8px 14px; width: auto; font-size: 13px; }
.btn:disabled, .btn.disabled {
  background: var(--disabled-bg) !important;
  color: var(--disabled-text) !important;
  border-color: var(--disabled-bg) !important;
  cursor: not-allowed;
  position: relative;
}

.icon-btn { background: none; border: none; cursor: pointer; display: flex; align-items: center; color: var(--emerald); }
.icon-btn.danger { color: var(--red); }

/* ---------- Inputs ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--navy); }
.field { margin-bottom: 14px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.date-selector-row { display: flex; align-items: center; gap: 8px; }
.date-selector-row .date-selector { flex: 1; }
.row-3-even { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.row-3-even .field { margin-bottom: 0; }
.row-3 { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin-bottom: 14px; }
.row-3 input[type="number"] { width: 100%; padding: 10px 8px; text-align: center; }
.row-2 .field, .row-3 .field { margin-bottom: 0; }
.search-scan-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-bottom: 14px; }
.search-scan-row .scan-btn { margin: 0; }
input[type="text"], input[type="tel"], input[type="email"], input[type="number"],
input[type="date"], input[type="password"], textarea, select.form-select {
  width: 100%;
  border: 1.5px solid var(--navy);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
  font-family: inherit;
  background: var(--white);
  color: var(--navy);
}
input:focus, textarea:focus, select.form-select:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 4px rgba(29, 52, 79, 0.15);
}
.input-with-icon { position: relative; }
.input-with-icon input { padding-left: 38px; }
.input-with-icon .icon-left { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--grey); }
.phone-field-with-dial { display: flex; align-items: center; gap: 6px; }
.phone-field-with-dial input { flex: 1; min-width: 0; }
.phone-field-with-dial .dial-btn { flex-shrink: 0; }

.pin-input { text-align: center; font-size: 30px; letter-spacing: 12px; font-weight: bold; }

/* ---------- Chips (expense categories) ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  border: 1.5px solid var(--navy);
  background: var(--white);
  color: var(--navy);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}
.chip.selected { background: var(--navy); color: var(--white); }

/* ---------- Stat cards (home) ---------- */
.stat-row { display: flex; gap: 10px; margin-bottom: 16px; }
.stat-card {
  flex: 1;
  border: 1.5px solid var(--navy);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.stat-card .stat-label { font-size: 11px; color: var(--grey); margin-bottom: 4px; }
.stat-card .stat-value { font-size: 18px; font-weight: bold; }
.stat-card .stat-value.positive { color: var(--emerald); }
.stat-card .stat-value.negative { color: var(--red); }
.shimmer { background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 4px; height: 18px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- Hot row (Sale / Booking / Expense) ---------- */
.hot-row { display: flex; gap: 10px; margin-bottom: 18px; }
.hot-btn {
  -webkit-appearance: none; appearance: none; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: var(--navy); color: var(--white); border: 1.5px solid var(--navy); border-radius: 12px;
  padding: 14px 6px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s ease;
}
.hot-btn:hover { background: var(--cyan); border-color: var(--cyan); }
.hot-btn.disabled {
  background: var(--disabled-bg) !important; color: var(--disabled-text) !important;
  border-color: var(--disabled-bg) !important; cursor: not-allowed;
}

/* ---------- Home widgets (trend / best sellers / stocking-outs) ---------- */
.home-widget { margin-bottom: 20px; }
.home-widget-title { font-weight: 700; font-size: 14px; color: var(--navy); margin-bottom: 8px; }
.home-trend-wrap { border: 1.5px solid var(--navy); border-radius: 10px; padding: 10px 12px 4px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; color: var(--white); }
.badge.sale { background: var(--emerald); }
.badge.expense { background: var(--red); }
.badge.collection { background: var(--blue); }
.badge.due { background: var(--amber); }

.entry-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.booking-card { cursor: pointer; }
.booking-card.live { border-color: #4EB96F; }
.booking-card.live .entry-info, .booking-card.live .entry-info * { color: #4EB96F; }
.booking-card.completed { border-color: var(--grey); }
.booking-card.completed .entry-info, .booking-card.completed .entry-info * { color: var(--grey); }
.entry-info { flex: 1; min-width: 0; }
.entry-desc { font-size: 13px; margin-top: 2px; }
.entry-amount { font-weight: 600; white-space: nowrap; }

/* ---------- Offline / sync banner ---------- */
.offline-banner {
  background: #FDEBD0;
  border: 1px solid var(--amber);
  color: var(--navy);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

/* ---------- Trial ribbon ---------- */
.trial-ribbon {
  background: var(--ribbon-gold);
  color: var(--white);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
}
.trial-ribbon.expired { background: var(--red); cursor: default; }
.trial-ribbon .ribbon-x { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--white); cursor: pointer; }

/* ---------- Footer credit ---------- */
.footer-credit {
  text-align: center;
  padding: 16px 10px 24px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--grey);
}
.footer-credit .brand-digi, .footer-credit .brand-wizr { font-family: 'Syne', sans-serif; font-weight: 700; }
.footer-credit .brand-digi { color: var(--cyan); }
.footer-credit .brand-wizr { color: var(--purple); }
.footer-credit a { text-decoration: none; }

/* ---------- Messages ---------- */
.msg { border-radius: 8px; padding: 10px 12px; margin: 10px 0; font-size: 13px; }
.msg.success { background: #E9F9EF; color: var(--emerald); border: 1px solid var(--emerald); }
.msg.error { background: #FDEDEC; color: var(--red); border: 1px solid var(--red); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(29,52,79,0.65);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-box {
  background: var(--white); border-radius: 14px; padding: 26px 22px; max-width: 380px; width: 100%;
  text-align: center;
}
.modal-close-x {
  position: absolute; top: 10px; right: 10px; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 4px; line-height: 0;
}
.recovery-pin-display { font-size: 34px; font-weight: 800; color: var(--emerald); letter-spacing: 4px; margin: 14px 0; }

/* ---------- Tables ---------- */
table.report-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; font-size: 13px; }
table.report-table th, table.report-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #eee; }
table.report-table th { color: var(--grey); font-weight: 600; font-size: 12px; }
table.report-table td.num, table.report-table th.num { text-align: right; }

.summary-line { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.summary-line.total { font-weight: bold; border-top: 1px solid var(--navy); margin-top: 6px; padding-top: 8px; }

/* ---------- Month picker ---------- */
.month-picker-card { border: 1.5px solid var(--navy); border-radius: 10px; padding: 14px; margin-bottom: 16px; }
.year-row { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 12px; }
.year-row .arrow-btn { background: none; border: none; color: var(--emerald); cursor: pointer; }
.year-row .year-label { font-weight: bold; font-size: 17px; }
.month-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.month-btn { border: 1.5px solid var(--navy); background: var(--white); color: var(--navy); border-radius: 8px; padding: 8px 4px; font-size: 12px; cursor: pointer; }
.month-btn.selected { background: var(--navy); color: var(--white); }
.week-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.week-chip-row .chip { display: flex; flex-direction: column; align-items: center; line-height: 1.3; }
.week-chip-range { display: block; font-size: 10px; opacity: 0.75; margin-top: 2px; }

/* ---------- Status card (dashboard) ---------- */
.status-card { border-radius: 10px; padding: 14px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.status-card.active { background: #E9F9EF; color: var(--emerald); }
.status-card.trial { background: #FEF5E7; color: var(--amber); }
.status-card.expired { background: #FDEDEC; color: var(--red); }

/* ---------- Product select cards ---------- */
.product-card { cursor: pointer; }
.product-card.selected { background: var(--navy); color: var(--white); }
.product-card.selected .muted { color: #cfd6e0; }

/* ---------- Cart ---------- */
.cart-item { display: flex; flex-direction: column; gap: 6px; position: relative; }
.cart-item .cart-top { display: flex; justify-content: space-between; align-items: flex-start; }
.qty-row { display: flex; align-items: center; gap: 10px; }
.qty-row button { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--navy); background: var(--white); color: var(--navy); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.qty-row input[type="number"] { width: 56px; text-align: center; padding: 6px; }
.remove-x { position: absolute; top: 0; right: 0; background: none; border: none; color: var(--red); cursor: pointer; }

/* ---------- Compact 2-line cart card ---------- */
.cart-item-v2 {
  padding: 8px 26px 8px 10px;
  margin-bottom: 8px;
  max-width: 100%;
}
.cart-v2-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.cart-v2-name {
  font-weight: 700;
  font-size: 13px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cart-v2-qty { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.cart-v2-qty button {
  width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--navy);
  background: var(--white); color: var(--navy); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.cart-v2-qty button svg { width: 12px; height: 12px; }
.cart-v2-qty input[type="number"] { width: 34px; padding: 2px; text-align: center; font-size: 12px; border-radius: 5px; }
.cart-v2-discount { flex-shrink: 0; }
.cart-v2-discount input[type="number"] {
  width: 56px; padding: 3px 4px; font-size: 11px; text-align: right; border-radius: 5px;
}
.cart-v2-row2 {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.cart-v2-meta { font-size: 11px; color: var(--grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-v2-total { font-weight: 700; color: var(--emerald); font-size: 13px; white-space: nowrap; }
.cart-item-v2 .remove-x { top: 6px; right: 6px; }
.cart-item-v2 .remove-x svg { width: 14px; height: 14px; }

/* ---------- iOS install banner ---------- */
.ios-banner {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--navy); color: var(--white);
  padding: 12px 16px; display: flex; align-items: center; gap: 10px; z-index: 200; font-size: 13px;
}
.ios-banner button.close-x { margin-left: auto; background: none; border: none; color: var(--white); cursor: pointer; }

/* ---------- WhatsApp button ---------- */
.btn.whatsapp { background: var(--white); border: 1.5px solid var(--navy); color: var(--navy); }
.btn.paypal-btn { background: var(--white); border: 1.5px solid var(--navy); color: var(--navy); margin-top: 4px; }
.btn.paypal-btn:hover { background: var(--cyan); color: var(--white); border-color: var(--cyan); }
.paypal-btn-icon { height: 20px; width: auto; display: block; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: var(--white); }
.btn.blue:hover { background: #2a80b9; border-color: #2a80b9; }

/* ---------- Charts ---------- */
.chart-wrap { background: var(--white); border: 1px solid #eee; border-radius: 10px; padding: 12px; margin-bottom: 16px; }
canvas { max-width: 100%; }

/* ---------- Utility ---------- */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.divider { border: none; border-top: 1px solid #e0e0e0; margin: 18px 0; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-wrap { text-align: center; padding: 40px 0; color: var(--grey); }

/* ===================== Sale / Booking totals box ===================== */
.totals-box {
  background: #F7F9FA;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 14px 0;
}
.totals-box .flex-between { padding: 4px 0; font-size: 14px; }
.total-payable-value { font-size: 18px; font-weight: 700; color: #4EB96F; }
.partial-payment-label { font-weight: 700; color: var(--blue); }
.partial-payment-input {
  width: 110px !important; text-align: right; font-weight: 700; color: var(--blue);
  border-color: var(--blue) !important; padding: 6px 8px !important;
}
.payment-due-value { font-size: 18px; font-weight: 700; color: var(--red); }

/* Accordion toggle for the partial-payment / client-details section */
.accordion-toggle {
  background: none; border: 1.5px solid var(--grey); border-radius: 50%;
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; margin: 4px 0 10px;
}
.accordion-panel { border-top: 1px solid #e0e0e0; padding-top: 10px; margin-bottom: 10px; }

/* ===================== Client autocomplete ===================== */
.client-autocomplete-wrap { position: relative; }
.autocomplete-results {
  display: none;
  position: absolute;
  left: 0; right: 0; top: 100%;
  background: var(--white);
  border: 1.5px solid var(--navy);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 30;
}
.autocomplete-results.show { display: block; }
.autocomplete-item { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid #eee; }
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: #E9F9EF; }

/* ===================== Small square icon buttons (Clear/Receipt etc.) ===================== */
.icon-square-row { display: flex; justify-content: flex-end; gap: 8px; margin: 18px 0 10px; }
.icon-square-btn {
  width: 40px; height: 40px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--white); border: 1.5px solid var(--navy); border-radius: 8px; cursor: pointer;
}
.icon-square-btn.blue { background: var(--blue); border-color: var(--blue); }
.icon-square-btn:disabled { opacity: 0.4; cursor: default; }

/* ===================== History screens: top toolbar + filter row ===================== */
.history-toolbar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.history-filter-row {
  display: flex; align-items: flex-end; gap: 6px; margin-bottom: 16px;
  flex-wrap: nowrap; width: 100%;
}
.history-filter-row > .field { flex: 1 1 0; min-width: 0; margin-bottom: 0; }
.history-filter-row > .field input,
.history-filter-row > .field select { width: 100%; min-width: 0; padding: 8px 6px; font-size: 12px; }
.history-filter-row > .field label { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-filter-row .icon-square-btn { width: 36px; height: 36px; flex: 0 0 36px; }
.history-empty-state { text-align: center; padding: 30px 10px; color: var(--muted, #8a94a6); font-style: italic; }
.history-card { position: relative; padding-right: 74px; }
.history-card-actions { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; gap: 4px; }

/* ===================== Order Ready Schedule time picker ===================== */
.time-picker-row { display: flex; gap: 6px; }
.time-picker-row select {
  flex: 1; border: 1.5px solid var(--navy); border-radius: 8px; padding: 8px 4px;
  font-size: 13px; background: var(--white); color: var(--navy);
}
.compact-date-input { padding: 6px 6px !important; font-size: 12px !important; margin-bottom: 6px; }
.time-picker-row.compact { gap: 4px; }
.time-picker-row.compact select { padding: 5px 2px; font-size: 11px; border-radius: 6px; }

/* ===================== Subscription: benefits + payment channels ===================== */
.benefit-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.benefit-text { font-size: 17px; }
.payment-channel-row { display: flex; justify-content: center; gap: 22px; margin: 14px 0; }
.payment-channel { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--navy); }
.payment-channel-icon { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; display: block; }
.payment-number-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.payment-number-spacer { justify-self: start; width: 32px; height: 32px; }
.payment-number-row button.payment-number-spacer { justify-self: start; width: auto; height: auto; }
.payment-number-box {
  border: 1.5px solid var(--navy); border-radius: 8px; padding: 10px 18px;
  font-size: 18px; font-weight: 700; color: var(--navy); letter-spacing: 1px;
}

/* ===================== Seller permissions ===================== */
.perm-checkbox-row { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.perm-checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; }
.perm-checkbox input[type="checkbox"] { width: 18px; height: 18px; accent-color: #4EB96F; }

/* ===================== Barcode: scan toast ===================== */
.scan-toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px);
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 20px;
  font-size: 13px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 300; max-width: 80%; text-align: center;
}
.scan-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===================== Barcode: camera scan modal ===================== */
.camera-scan-box { width: 100%; max-width: 360px; }
.camera-scan-box video { width: 100%; border-radius: 8px; background: #000; max-height: 60vh; }

/* ===================== Barcode Label Print ===================== */
.bc-label-sheet { display: flex; flex-wrap: wrap; }
.bc-label {
  border: 1px dashed #999;
  padding: 2mm;
  text-align: center;
  box-sizing: border-box;
  page-break-inside: avoid;
  font-family: Arial, sans-serif;
}
.bc-label-name { font-size: 8pt; font-weight: 700; color: #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-label-size { font-size: 7pt; color: #444; }
.bc-label-svg { margin: 1mm 0; }
.bc-label-svg svg { width: 100%; height: auto; display: block; }
.bc-label-code { font-size: 7pt; color: #000; letter-spacing: 0.5px; }

/* ===================== Print styles ===================== */
@media print {
  .app-header, .back-btn, .date-selector, .download-pdf-btn, .lang-switcher,
  .trial-ribbon, .footer-credit, .no-print { display: none !important; }

  body { font-size: 12px; }
  .print-header { display: flex !important; justify-content: space-between; margin-bottom: 12px; }
  .print-footer { display: block !important; text-align: center; font-size: 11px; margin-top: 20px; }

  .section-title, table.report-table, .chart-wrap, .card {
    page-break-inside: avoid;
  }
  tr { page-break-inside: avoid; }

  .btn { background: none !important; color: var(--navy) !important; border: 1px solid var(--navy) !important; }

  @page { size: A4 portrait; margin: 14mm; }
}
.print-header, .print-footer { display: none; }

/* ===================== Inventory: Stock In highlight ===================== */
.stock-in-highlight { color: var(--emerald); }
.stock-in-highlight-input { border-color: var(--emerald) !important; background: #E9F9EF; }

/* ===================== POS Receipt ===================== */
.receipt-print-area { display: none; }
.receipt {
  width: 280px;
  margin: 0 auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  color: #000;
  padding: 8px;
  background: #fff;
}
.receipt-business { font-weight: bold; text-align: center; font-size: 14px; }
.receipt-sub { text-align: center; font-size: 11px; }
.receipt-hr { border: none; border-top: 1px dashed #000; margin: 6px 0; }
.receipt-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.receipt-table th, .receipt-table td { padding: 2px 0; text-align: left; }
.receipt-table th:last-child, .receipt-table td:last-child,
.receipt-table th:nth-child(2), .receipt-table td:nth-child(2) { text-align: right; }
.receipt-line { display: flex; justify-content: space-between; font-size: 12px; padding: 2px 0; }
.receipt-total { font-weight: bold; font-size: 13px; border-top: 1px dashed #000; margin-top: 4px; padding-top: 4px; }
.receipt-footer { text-align: center; font-size: 11px; margin-top: 6px; }
.receipt-brand { color: #555; font-size: 10px; margin-top: 2px; }

@media print {
  body.printing-receipt > *:not(.receipt-print-area) { display: none !important; }
  body.printing-receipt .receipt-print-area { display: block !important; position: fixed; top: 0; left: 0; width: 100%; }
}
