/* =========================================================================
   POS STORE v1.0 - Application Stylesheet
   -------------------------------------------------------------------------
   Design language: "the register drawer" - deep ledger-navy + a warm
   copper accent (the color of a highlighted till key), set in a
   technical type system (Space Grotesk / Inter / JetBrains Mono) that
   nods to product codes, barcodes, and receipt tape.
   ========================================================================= */

:root {
  /* Color tokens */
  --pos-bg: #F7F5F0;
  --pos-surface: #FFFFFF;
  --pos-ink: #16233F;
  --pos-ink-2: #0D1730;
  --pos-fill-dark: #16233F; /* Brand-dark chip/button fill - intentionally constant across themes, unlike --pos-ink (which flips to a light color for readable text in dark mode). */
  --pos-accent: #E07A2C;
  --pos-accent-2: #F2A65A;
  --pos-success: #2F9E64;
  --pos-danger: #D64545;
  --pos-warning: #D9A441;
  --pos-text: #1F2430;
  --pos-muted: #6B7280;
  --pos-border: #E7E2D6;

  /* Type */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--pos-bg);
  color: var(--pos-text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.pos-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.pos-brand-mark { color: var(--pos-accent); }
.pos-brand-rest { color: var(--pos-ink); }
@media (max-width: 480px) { .pos-brand-rest { display: none; } }
.pos-brand-lg { font-size: 1.9rem; }

/* =========================================================================
   Login screen
   ========================================================================= */

.pos-login-body {
  min-height: 100vh;
  margin: 0;
}

.pos-login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.pos-login-aside {
  background: radial-gradient(circle at 20% 15%, #1C2C4E 0%, var(--pos-ink-2) 60%);
  color: #EDEFF4;
  display: flex;
  align-items: center;
  padding: 4rem 3.5rem;
  position: relative;
  overflow: hidden;
}

.pos-login-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(115deg, rgba(224,122,44,0.06) 0 2px, transparent 2px 42px);
  pointer-events: none;
}

.pos-login-aside-inner { position: relative; z-index: 1; max-width: 460px; }

.pos-login-aside .pos-brand-rest { color: #F3F1EA; }

.pos-tagline {
  font-size: 1.05rem;
  color: #C6CBDA;
  margin: 1rem 0 2.25rem;
  line-height: 1.55;
}

/* Receipt: fixed columns keep quantities and prices vertically aligned. */
.pos-receipt {
  background: #FBFAF6;
  color: #1F2430;
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.4rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.55);
  transform: none;
}

.pos-receipt-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 72px;
  column-gap: 0.35rem;
  align-items: start;
  padding: 0.2rem 0;
  color: #3A3F4B;
}
.pos-receipt-line span:first-child { min-width: 0; overflow-wrap: anywhere; }
.pos-receipt-line span:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pos-receipt-line span:nth-child(2) { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pos-receipt-column-head {
  color: var(--pos-ink);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 1px dashed #D7D2C4;
  padding: 0.45rem 0 0.3rem;
}

.pos-receipt-head {
  color: #8A8F9C;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  border-bottom: 1px dashed #D7D2C4;
  padding-bottom: 0.4rem;
  margin-bottom: 0.2rem;
}

.pos-receipt-divider {
  border-top: 1px dashed #D7D2C4;
  margin: 0.5rem 0;
}

.pos-receipt-total {
  font-weight: 600;
  color: var(--pos-ink);
  font-size: 0.88rem;
}

.pos-receipt-barcode {
  display: block;
  height: 48px;
  margin: 0.9rem auto 0;
  width: 100%;
  background: #fff;
}
.pos-code39-svg { display: block; width: 100%; height: 48px; }
.pos-code39-svg rect { fill: #000; }
.pos-receipt-header { line-height: 1.4; }
.pos-receipt-store-name { font-size: .98rem; font-weight: 700; color: var(--pos-ink); }
.pos-receipt-store-address, .pos-receipt-store-contact, .pos-receipt-meta { font-size: .74rem; color: #3A3F4B; }
.pos-receipt-invoice { margin-top: .4rem; font-weight: 700; font-size: .8rem; }
.pos-receipt-customer { margin-top: .15rem; font-size: .78rem; font-weight: 600; }
/* Decorative barcode shown on the login illustration. */
.pos-login-aside .pos-receipt-barcode { display: flex; align-items: flex-end; justify-content: flex-start; gap: 2px; width: auto; height: 30px; background: transparent; }
.pos-login-aside .pos-receipt-barcode span { display: block; width: 3px; background: #2A2E38; }
.pos-login-aside .pos-receipt-barcode span:nth-child(3n) { height: 100%; }
.pos-login-aside .pos-receipt-barcode span:nth-child(3n+1) { height: 70%; }
.pos-login-aside .pos-receipt-barcode span:nth-child(3n+2) { height: 85%; }

.pos-receipt-code {
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: #6B7280;
  margin-top: 0.4rem;
}

/* -------------------------------------------------------------------
   Receipt templates (Classic / Modern) and printer widths (58mm / 80mm)
   ------------------------------------------------------------------- */
/* Classic (default look, defined above) stays plain/monospace. */
.pos-receipt-tpl-modern {
  font-family: var(--font-body);
  border: 1px solid var(--pos-border);
}
.pos-receipt-tpl-modern .pos-receipt-store-name { font-family: var(--font-display); font-size: 1.1rem; }
.pos-receipt-tpl-modern .pos-receipt-head { border-bottom-style: solid; border-color: var(--pos-border); }
.pos-receipt-tpl-modern .pos-receipt-column-head { background: var(--pos-fill-dark); color: #fff; border-radius: 6px 6px 0 0; padding: 0.5rem 0.6rem; margin: 0 -0.2rem; }
.pos-receipt-tpl-modern .pos-receipt-divider { border-top-style: solid; }
.pos-receipt-tpl-modern .pos-receipt-total { background: rgba(224,122,44,0.10); color: var(--pos-accent); font-size: 1rem; padding: 0.35rem 0.5rem; border-radius: 8px; margin: 0.2rem -0.5rem; }
.pos-receipt-tpl-modern .pos-receipt-total span:first-child { font-weight: 700; }

/* Printer width sizing - approximates real 58mm/80mm thermal paper (~203dpi)
   for both the on-screen preview and the printed page. */
.pos-receipt-w58 { max-width: 240px; margin: 0 auto; font-size: 0.72rem; padding: 1rem 0.9rem 0.9rem; }
.pos-receipt-w58 .pos-receipt-line { grid-template-columns: minmax(0, 1fr) 34px 58px; }
.pos-receipt-w80 { max-width: 320px; margin: 0 auto; }

.pos-feature-list {
  list-style: none;
  padding: 0;
  margin: 2.25rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.85rem;
  color: #C6CBDA;
}
.pos-feature-list i { color: var(--pos-accent-2); margin-right: 0.5rem; }

.pos-login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: var(--pos-bg);
}

.pos-login-card {
  width: 100%;
  max-width: 400px;
}

.pos-reset-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at top right, rgba(242, 166, 90, 0.22), transparent 32%),
    #f4f6fa;
}

.pos-reset-card {
  width: 100%;
  max-width: 440px;
  padding: 2.25rem;
  background: var(--pos-surface);
  border: 1px solid rgba(22, 35, 63, 0.1);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(22, 35, 63, 0.14);
}

.pos-reset-card .pos-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.15rem;
}

.pos-reset-card .pos-brand-mark {
  background: var(--pos-fill-dark);
  color: #fff;
  padding: 6px 9px;
  border-radius: 8px;
}

.pos-reset-card .pos-brand-rest {
  color: var(--pos-ink);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.pos-reset-card .form-control {
  min-height: 48px;
  border-radius: 10px;
}

.pos-reset-card .pos-btn-primary {
  min-height: 48px;
  border-radius: 10px;
  font-weight: 700;
}

.pos-login-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
  color: var(--pos-ink);
}

.pos-login-subtitle {
  color: var(--pos-muted);
  margin-bottom: 1.75rem;
  font-size: 0.92rem;
}

.pos-input-group .input-group-text {
  background: var(--pos-surface);
  border-right: none;
  color: var(--pos-muted);
}
.pos-input-group .form-control {
  border-left: none;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}
.pos-input-group .form-control:focus {
  box-shadow: none;
  border-color: var(--pos-accent);
}
.pos-input-group:focus-within .input-group-text {
  border-color: var(--pos-accent);
}
.pos-input-group .form-control,
.pos-input-group .input-group-text {
  border-color: var(--pos-border);
}
.pos-list-search {
  flex: 0 1 480px;
  width: min(100%, 480px);
  max-width: 480px;
  min-width: min(100%, 260px);
}

.pos-toggle-pass {
  border: 1px solid var(--pos-border);
  border-left: none;
  background: var(--pos-surface);
  color: var(--pos-muted);
}

.pos-link { color: var(--pos-accent); font-weight: 500; }
.pos-link:hover { color: var(--pos-ink); }

.pos-btn-primary {
  background: var(--pos-fill-dark);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.15s ease, transform 0.1s ease;
}
.pos-btn-primary:hover { background: #0F1A30; color: #fff; }
.pos-btn-primary:active { transform: scale(0.99); }
.pos-btn-primary:disabled { opacity: 0.7; }

.pos-login-footnote {
  text-align: center;
  color: var(--pos-muted);
  font-size: 0.78rem;
  margin-top: 2rem;
}

@media (max-width: 991.98px) {
  .pos-login-wrap { grid-template-columns: 1fr; }
  .pos-login-aside { display: none; }
}

/* =========================================================================
   Authenticated app shell (navbar / sidebar / dashboard)
   ========================================================================= */

.pos-navbar {
  background: var(--pos-surface);
  border-bottom: 1px solid var(--pos-border);
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.pos-sidebar-toggle { border: none; font-size: 1.3rem; color: var(--pos-ink); }

.pos-icon-btn {
  border: none;
  background: transparent;
  color: var(--pos-muted);
  font-size: 1.1rem;
  width: 38px; height: 38px;
  border-radius: 50%;
}
.pos-icon-btn:hover { background: var(--pos-bg); }

.pos-notif-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--pos-accent);
  border-radius: 50%;
  border: 2px solid var(--pos-surface);
}

.pos-user-btn {
  border: 1px solid var(--pos-border);
  background: var(--pos-surface);
  border-radius: 999px;
  padding: 0.3rem 0.75rem 0.3rem 0.3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.pos-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--pos-fill-dark);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pos-shell {
  display: flex;
  min-height: calc(100vh - 64px);
}

.pos-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--pos-surface);
  border-right: 1px solid var(--pos-border);
  padding: 1rem 0.75rem;
  /* Pinned to the viewport height and independently scrollable, so a
     short/100%-zoomed browser window - or, on mobile, the fixed-position
     panel below - can always reach every nav item (Settings, being last,
     was the one that went permanently unreachable without this). */
  position: sticky;
  top: 64px;
  align-self: flex-start;
  height: calc(100vh - 64px);
  overflow-y: auto;
}

.pos-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--pos-text);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.15rem;
}
.pos-sidebar-group-toggle {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.15rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--pos-text);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
}
.pos-sidebar-group-toggle:hover { background: var(--pos-bg); }
.pos-sidebar-group-toggle.active { background: var(--pos-fill-dark); color: #fff; }
.pos-sidebar-group-toggle > .bi:first-child { width: 20px; color: var(--pos-muted); font-size: 1.05rem; text-align: center; }
.pos-sidebar-group-toggle.active > .bi:first-child { color: var(--pos-accent-2); }
.pos-sidebar-group-chevron { margin-left: auto; font-size: 0.72rem; transition: transform 0.15s ease; }
.pos-sidebar-group-toggle[aria-expanded="true"] .pos-sidebar-group-chevron { transform: rotate(180deg); }
.pos-sidebar-subnav { margin: 0 0 0.35rem 1.05rem; padding-left: 0.45rem; border-left: 1px solid var(--pos-border); }
.pos-sidebar-sublink { padding-left: 0.65rem; font-size: 0.86rem; }
.pos-sidebar-link i { font-size: 1.05rem; color: var(--pos-muted); width: 20px; text-align: center; }
.pos-sidebar-link:hover { background: var(--pos-bg); }
.pos-sidebar-link.active { background: var(--pos-fill-dark); color: #fff; }
.pos-sidebar-link.active i { color: var(--pos-accent-2); }

.pos-badge-soft {
  background: var(--pos-bg);
  color: var(--pos-muted);
  font-weight: 500;
  font-size: 0.65rem;
  border: 1px solid var(--pos-border);
}

.pos-main { flex: 1; min-width: 0; }

.pos-card { border-radius: var(--radius-md); }

/* -------------------------------------------------------------------
   Settings page tabs (one card container per tab)
   ------------------------------------------------------------------- */
/* Shared pill-style tab bar used by Settings, Roles & Permissions, and
   Reports - previously Settings had its own bespoke look (rounded pill
   buttons) while the others used Bootstrap's plain default nav-tabs
   (underlined, white background), so the same kind of page looked like
   two different UI patterns depending on which one you were on. */
.pos-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; padding-bottom: 4px; border-bottom: 0; }
.pos-tabs .nav-link { white-space: nowrap; color: var(--pos-ink); font-weight: 600; font-size: .88rem; border-radius: 999px; padding: 8px 16px; border: 0; }
.pos-tabs .nav-link.active { background: var(--pos-fill-dark); color: #fff; }
.pos-tabs .nav-link:not(.active):hover { background: var(--pos-bg); }

.pos-footer { border-top: 1px solid var(--pos-border); background: var(--pos-surface); }

/* Keep each start/end date pair together when filter toolbars wrap. */
.pos-date-range { display: inline-flex; align-items: center; flex-wrap: nowrap; gap: .5rem; white-space: nowrap; }
.pos-date-range .form-control { flex: 0 1 160px; min-width: 0; }
.sales-filter-secondary,
.activity-filter-secondary { display: flex; align-items: center; flex-wrap: nowrap; gap: .5rem; }
.sales-filter-secondary > #saleStatusFilter,
.sales-filter-secondary > #salePaymentFilter,
.activity-filter-secondary > #logUserFilter { flex: 0 0 auto; }
.sales-filter-secondary > .pos-date-range,
.activity-filter-secondary > .pos-date-range { flex: 0 0 auto; width: auto; }
.rec-control-groups { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.rec-date-navigation, .rec-day-actions { display: flex; align-items: center; flex-wrap: nowrap; gap: .5rem; }
.rec-date-navigation #recDate { flex: 0 1 160px; min-width: 0; }

/* =========================================================================
   CRUD module tables (Categories, Products, Suppliers, Customers)
   ========================================================================= */

.pos-table thead th {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pos-muted);
  border-bottom: 1px solid var(--pos-border);
  font-weight: 600;
  white-space: nowrap;
}
.pos-table td { border-color: var(--pos-border); font-size: 0.9rem; vertical-align: middle; }
.pos-table tbody tr:hover { background: var(--pos-bg); }
.pos-cart-qty-column { width: 175px; min-width: 175px; }
.pos-cart-qty-cell { min-width: 175px; }
.pos-qty-control { flex-wrap: nowrap; min-width: 165px; }
.pos-qty-control .btn { width: 38px; min-width: 38px; display: inline-flex; align-items: center; justify-content: center; }
.pos-qty-control .cart-qty-input { min-width: 74px; flex: 1 1 74px; font-weight: 600; }
/* Keep action buttons reachable when a form is inside a scrollable modal. */
.modal-dialog-scrollable .modal-content > form { display: flex; flex-direction: column; max-height: calc(100vh - 3.5rem); overflow: hidden; }
.modal-dialog-scrollable .modal-content > form .modal-body { overflow-y: auto; }
.modal-dialog-scrollable .modal-content > form .modal-footer { flex-shrink: 0; }

.pos-sortable { cursor: pointer; user-select: none; }
.pos-sortable i { font-size: 0.7rem; opacity: 0.5; margin-left: 2px; }
.pos-sortable:hover i { opacity: 1; }

.pos-badge-success { background: rgba(47,158,100,0.12); color: var(--pos-success); font-weight: 500; }
.pos-badge-muted   { background: rgba(107,114,128,0.12); color: var(--pos-muted); font-weight: 500; }
.pos-badge-warning { background: rgba(217,164,65,0.15); color: #8A6416; font-weight: 500; }
.pos-badge-danger  { background: rgba(214,69,69,0.12); color: var(--pos-danger); font-weight: 500; }

.pos-icon-btn-table {
  border: none;
  background: transparent;
  color: var(--pos-muted);
  padding: 0.25rem 0.45rem;
}
.pos-icon-btn-table:hover { background: var(--pos-bg); color: var(--pos-ink); }

.pos-select { border-color: var(--pos-border); }
.pos-select:focus { border-color: var(--pos-accent); box-shadow: none; }

/* Product image thumbnail + upload dropzone */
.pos-thumb {
  width: 40px; height: 40px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--pos-border);
  background: var(--pos-bg);
}
.pos-image-zoom-trigger { cursor: zoom-in; }
.pos-image-zoom-trigger:hover { filter: brightness(.94); }

.pos-upload-box {
  border: 1.5px dashed var(--pos-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  background: var(--pos-bg);
  transition: border-color 0.15s ease;
}
.pos-upload-box:hover, .pos-upload-box.dragover { border-color: var(--pos-accent); }
.pos-upload-preview {
  width: 96px; height: 96px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--pos-border);
  display: none;
  margin: 0 auto 0.5rem;
}

@media (max-width: 991.98px) {
  .pos-sidebar {
    position: fixed;
    top: 64px;
    bottom: auto;
    left: 0;
    z-index: 1020;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 12px 0 30px -20px rgba(0,0,0,0.3);
    height: calc(100vh - 64px);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    /* Keeps a swipe that reaches the top/bottom of this list from
       "chaining" into scrolling the page behind it once it runs out of
       room - without this, a fast swipe can feel like it stopped
       scrolling the menu and started scrolling (or bouncing) the
       dashboard underneath instead. */
    overscroll-behavior-y: contain;
  }

  @supports (height: 100dvh) {
    .pos-sidebar {
      height: calc(100dvh - 64px);
      max-height: calc(100dvh - 64px);
    }
  }

  .pos-sidebar.show { transform: translateX(0); }

  .pos-sidebar-backdrop {
    display: none;
    position: fixed;
    top: 64px; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1015; /* above page content, below .pos-sidebar (1020) and .pos-navbar (1030) */
  }
  .pos-sidebar-backdrop.show { display: block; }

  /* Belt-and-suspenders alongside overscroll-behavior above: while the
     menu is open, the dashboard page itself can't be scrolled at all,
     so there's no page underneath for a swipe to ever land on by
     mistake. Toggled from JS in assets/js/app.js. */
  body.pos-sidebar-open { overflow: hidden; }
}

/* -------------------------------------------------------------------
   POS Screen (Phase 4) - product tiles + print-only receipt
   ------------------------------------------------------------------- */
.pos-product-col { display: flex; }
.pos-product-tile {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  border: 1px solid var(--pos-border);
  border-radius: var(--radius-md);
  background: var(--pos-surface);
  padding: 0.5rem;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.pos-product-tile:hover { border-color: var(--pos-accent); }
.pos-product-tile-main { display: flex; flex: 1 1 auto; flex-direction: column; background: none; border: none; padding: 0; margin: 0; transition: transform 0.1s ease; }
.pos-product-tile-main:hover:not(:disabled) { transform: translateY(-1px); }
.pos-product-tile-main:disabled { opacity: 0.5; cursor: not-allowed; }
.pos-product-details { display: flex; flex: 1 1 auto; flex-direction: column; width: 100%; }
.pos-product-name {
  min-height: 2.5em; font-weight: 600; font-size: 0.78rem; line-height: 1.25; margin-bottom: 0.2rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pos-product-price { font-family: var(--font-mono); font-weight: 600; color: var(--pos-ink); font-size: 0.82rem; }
.pos-product-stock { align-self: flex-start; font-size: 0.65rem; color: var(--pos-muted); margin-top: 0.25rem; padding: 0.1rem 0.4rem; border-radius: 999px; background: var(--pos-bg); }

.pos-product-image-wrap {
  width: 100%; height: clamp(88px, 15vw, 150px); border-radius: var(--radius-sm, 6px); overflow: hidden;
  background: var(--pos-bg); display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.4rem;
}
.pos-product-image { width: 100%; height: 100%; object-fit: cover; }
.pos-product-image-placeholder { font-size: 1.3rem; color: var(--pos-muted); opacity: 0.5; }

.pos-product-tier-toggle { display: flex; align-items: center; gap: 4px; margin-top: 0.4rem; flex-wrap: wrap; }
.pos-product-tier-label { display: none; }
.pos-product-tier-btn {
  border: 1px solid var(--pos-border); border-radius: 5px; padding: 4px 8px; font-size: 0.64rem; font-weight: 700;
  background: var(--pos-bg); color: var(--pos-ink); display: inline-flex; align-items: center; gap: 3px;
}
.pos-product-tier-btn i { font-size: 0.62rem; }
.pos-product-tier-btn.active { border-color: var(--pos-danger, #e5484d); background: var(--pos-danger, #e5484d); color: #fff; }
.pos-product-tier-btn[data-tier="wholesale"].active { border-color: var(--pos-fill-dark); background: var(--pos-fill-dark); }

@media (max-width: 576px) {
  .pos-product-tile { padding: 0.4rem; }
  .pos-product-name { font-size: 0.7rem; }
  .pos-product-price { font-size: 0.74rem; }
  .pos-product-stock { font-size: 0.6rem; }
  .pos-product-tier-btn { padding: 2px 5px; font-size: 0.58rem; }
  .pos-product-tier-btn span { display: none; } /* icon only - "Retail"/"Wholesale" text doesn't fit 3-per-row on a phone */
}


@media print {
  body.printing-sale-receipt * { visibility: hidden !important; }
  body.printing-sale-receipt #saleReceiptModal,
  body.printing-sale-receipt #saleReceiptModal * { visibility: visible !important; }
  body.printing-sale-receipt #saleReceiptModal {
    position: absolute; top: 0; left: 0; display: block !important;
    width: 100%; height: auto; background: #fff;
  }
  body.printing-sale-receipt #saleReceiptModal .modal-dialog { margin: 0 auto; max-width: 340px; transform: none !important; }
  body.printing-sale-receipt #saleReceiptModal .modal-content { border: 0; box-shadow: none; }
  body.printing-sale-receipt #saleReceiptModal .modal-header,
  body.printing-sale-receipt #saleReceiptModal .modal-footer { display: none !important; }
  body * { visibility: hidden; }
  #receiptModal, #receiptModal * { visibility: visible; }
  #receiptModal {
    /* Keep the receipt out of the normal page flow without giving the
       print document a viewport-height container.  A fixed, inset modal is
       as tall as the screen and can spill onto a second printed page. */
    position: absolute; top: 0; left: 0; z-index: 9999; display: block !important;
    width: 100%; height: auto; min-height: 0;
    background: #fff;
  }
  #receiptModal .modal-dialog {
    margin: 0 auto; max-width: 340px;
    min-height: 0; height: auto; transform: none !important;
  }
  #receiptModal .modal-content { border: 0; box-shadow: none; }
  #receiptModal .modal-header, #receiptModal .modal-footer { display: none; }
  /* Match the printed page to the selected printer width instead of a
     generic A4 sheet, so thermal-printer output isn't mostly blank margin. */
  #receiptModal .pos-receipt-w58 { max-width: 58mm; }
  #receiptModal .pos-receipt-w80 { max-width: 80mm; }
  body:has(.pos-receipt-w58) { @page { size: 58mm auto; margin: 2mm; } }
  body:has(.pos-receipt-w80) { @page { size: 80mm auto; margin: 3mm; } }
  body.printing-report * { visibility: visible; }
  body.printing-report .pos-navbar, body.printing-report .pos-sidebar, body.printing-report .pos-footer,
  body.printing-report #btnPrintReport, body.printing-report #reportPresets, body.printing-report .btn,
  body.printing-report #reportsTabs, body.printing-report .modal { display: none !important; }
  body.printing-report .pos-main { margin: 0 !important; padding: 0 !important; }
  body.printing-report .card { box-shadow: none !important; break-inside: avoid; }
  body.printing-report canvas { max-height: 170px !important; }
  body.printing-report #reportsPaneDailySales .table { font-size: 8pt; }
  body.printing-report #reportsPaneDailySales .table-responsive { max-height: none !important; overflow: visible !important; }
  body.printing-report #reportsPaneDailySales .card { border: 0 !important; }
  body.printing-report:has(#reportsPaneDailySales.active) .pos-date-range { display: none !important; }
  body.printing-report #reportsPaneDailySales .daily-sales-print-head { border-bottom: 1px solid #333; padding-bottom: 8px; }
  body.printing-report #reportsPaneDailySales #dsCashierFilter,
  body.printing-report #reportsPaneDailySales label[for="dsCashierFilter"] { display: none !important; }
  body.printing-report #reportsPaneDailySales #dsPrintCashier { display: inline !important; }
  body.printing-shortcuts #receiptModal { display: none !important; }
  body.printing-shortcuts #posShortcutsModal {
    position: absolute !important;
    inset: 0 auto auto 0 !important;
    z-index: 99999 !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
  }
  body.printing-shortcuts #posShortcutsModal,
  body.printing-shortcuts #posShortcutsModal * { visibility: visible !important; }
  body.printing-shortcuts #posShortcutsModal .modal-dialog { max-width: 760px; margin: 0 auto; transform: none !important; }
  body.printing-shortcuts #posShortcutsModal .modal-content { border: 0; box-shadow: none; }
  body.printing-shortcuts #posShortcutsModal .btn-close,
  body.printing-shortcuts #btnPrintShortcuts { display: none !important; }
  body.printing-shortcuts #posShortcutsModal .modal-body { max-height: none !important; overflow: visible !important; }
  body.printing-shortcuts .pos-shortcut-row { break-inside: avoid; }
  @page { size: A4 landscape; margin: 8mm; }

  /* Refunds/Voids "View" detail modal - same isolated-print trick as
     #receiptModal above, so Print inside it doesn't also try to print
     whatever report tab is open behind it. */
  #rvDetailModal.show { display: block !important; }
  #rvDetailModal, #rvDetailModal * { visibility: visible; }
  #rvDetailModal {
    position: absolute; top: 0; left: 0; z-index: 9999;
    width: 100%; height: auto; min-height: 0; background: #fff;
  }
  #rvDetailModal .modal-dialog { margin: 0 auto; max-width: 340px; min-height: 0; height: auto; transform: none !important; }
  #rvDetailModal .modal-content { border: 0; box-shadow: none; }
  #rvDetailModal .modal-header, #rvDetailModal .modal-footer { display: none; }

  body.printing-customer-collection * { visibility: hidden !important; }
  body.printing-customer-collection #collectionReceiptModal,
  body.printing-customer-collection #collectionReceiptModal * { visibility: visible !important; }
  body.printing-customer-collection #receiptModal,
  body.printing-customer-collection #rvDetailModal,
  body.printing-customer-collection #customerCollectionModal { display: none !important; }
  body.printing-customer-collection #collectionReceiptModal {
    position: absolute !important; inset: 0 auto auto 0 !important; z-index: 99999 !important;
    display: block !important; width: 100% !important; height: auto !important; background: #fff !important;
  }
  body.printing-customer-collection #collectionReceiptModal .modal-dialog {
    width: 100% !important; max-width: 80mm !important; margin: 0 auto !important; transform: none !important;
  }
  body.printing-customer-collection #collectionReceiptModal .modal-content { border: 0 !important; box-shadow: none !important; }
  body.printing-customer-collection #collectionReceiptModal .modal-header,
  body.printing-customer-collection #collectionReceiptModal .modal-footer { display: none !important; }
  body.printing-customer-collection #collectionReceiptPrint { font-size: 12px; color: #000; }
  body.printing-customer-collection .collection-receipt-amount { border-top: 1px solid #222; border-bottom: 1px solid #222; padding: 10px 0; font-size: 15px; }
}

/* -------------------------------------------------------------------
   Navbar low-stock notification bell
   ------------------------------------------------------------------- */
.pos-notif-panel { width: 320px; }
.pos-notif-item:last-child { border-bottom: none !important; }
.pos-notif-item:hover { background: var(--pos-bg); }
@media (max-width: 767.98px) {
  .pos-navbar { padding-left: .75rem !important; padding-right: .75rem !important; }
  .pos-navbar .ms-auto { gap: .35rem !important; }
  /* Full "Shift #6 · 7h 18m" text badge is too wide for a phone-width
     navbar and crowds the other icons - collapse it to match the
     other icon buttons (dark clock icon + a small active-status dot),
     same footprint as .pos-icon-btn, full detail still one tap away
     in the dropdown panel. */
  .pos-shift-badge { width: 38px; height: 38px; padding: 0; border-radius: 50%; justify-content: center; border-color: transparent; background: transparent; max-width: none; }
  .pos-shift-icon { font-size: 1.05rem; color: var(--pos-muted); }
  .pos-shift-badge .pos-shift-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; box-shadow: none; }
  .pos-shift-panel { position: fixed !important; top: 58px !important; left: .5rem !important; right: .5rem !important; width: auto !important; max-width: none; max-height: calc(100dvh - 74px); overflow-y: auto; transform: none !important; }
  .pos-notif-panel { position: fixed !important; top: 58px !important; left: .5rem !important; right: .5rem !important; width: auto !important; max-height: calc(100dvh - 74px); transform: none !important; }
  #notifList { max-height: calc(100dvh - 190px) !important; }
}


.cart-qty-input {
    min-width: 90px !important;
}

td:has(.cart-qty-input) {
    min-width: 180px;
}

/* =========================================================================
   POS v2 - mobile-first sale screen
   ========================================================================= */
.pos-v2 { max-width: 680px; margin: 0 auto; min-height: calc(100vh - 130px); display: flex; flex-direction: column; gap: 18px; color: #172033; }
.pos-v2-header { display: flex; justify-content: space-between; align-items: center; padding-top: 4px; }
.pos-v2-eyebrow { display: block; color: #8a94a6; font-size: .66rem; font-weight: 700; letter-spacing: .12em; }
.pos-v2 h1 { margin: 2px 0 0; font-size: 1.55rem; font-weight: 700; }
.pos-v2-held-button, .pos-v2-clear { border: 1px solid #e2e7ef; background: #fff; border-radius: 12px; min-height: 42px; padding: 0 12px; color: #344054; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.pos-v2-held-count { min-width: 20px; padding: 1px 6px; border-radius: 99px; background: #fff1d7; color: #9a5a00; font-size: .72rem; }
.pos-v2-customer label, .pos-v2-payment-label { display: block; margin-bottom: 7px; color: #475467; font-size: .78rem; font-weight: 700; }
.pos-v2-customer label span { color: #98a2b3; font-weight: 500; }
.pos-v2-search-field, .pos-v2-item-search { display: flex; align-items: center; border: 1px solid #dde3ed; border-radius: 12px; background: #fff; min-height: 48px; padding: 0 11px; }
.pos-v2-search-field > i, .pos-v2-item-search > i { color: #98a2b3; font-size: 1.08rem; }
.pos-v2-search-field input, .pos-v2-item-search input, .pos-v2-amount-input input { border: 0; outline: 0; box-shadow: none; width: 100%; min-width: 0; background: transparent; padding: 10px; color: #172033; }
.pos-v2-search-field button, .pos-v2-item-search button { border: 0; background: transparent; color: #667085; padding: 5px; }
.pos-v2-selected-customer { color: #98a2b3; font-size: .75rem; margin: 5px 2px 0; }
.pos-v2-items { flex: 1; min-height: 230px; display: flex; flex-direction: column; }
.pos-v2-item-search { border-color: #b8c6ff; box-shadow: 0 0 0 3px rgba(72, 103, 255, .06); }
.pos-v2-item-search > i { color: #4867ff; }
.pos-v2-item-search button { border-left: 1px solid #e6eaf0; padding-left: 12px; }
.pos-v2-cart-head { display: grid; grid-template-columns: 1fr 108px 76px; gap: 8px; padding: 18px 6px 7px; color: #98a2b3; font-size: .69rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pos-v2-cart-head span:nth-child(2), .pos-v2-cart-head span:nth-child(3) { text-align: right; }
.pos-v2-cart { flex: 1; min-height: 160px; max-height: 36vh; overflow: auto; border-top: 1px solid #edf0f4; border-bottom: 1px solid #edf0f4; }
.pos-v2-cart-table { width: 100%; margin: 0; }
.pos-v2-cart-table td { padding: 12px 5px; font-size: .85rem; }
.pos-v2-cart-table td:first-child { width: auto; }
.pos-v2-cart-table td:nth-child(2) { min-width: 108px !important; width: 108px; }
.pos-v2-cart-table td:nth-child(3) { width: 76px; white-space: nowrap; }
.pos-v2-cart-table td:last-child { width: 28px; padding-right: 0; }
.pos-v2-cart-table .pos-qty-control { min-width: 102px; }
.pos-v2-cart-table .pos-qty-control .btn { width: 28px; min-width: 28px; padding: 0; }
.pos-v2-cart-table .pos-qty-control .cart-qty-input { min-width: 38px; padding-left: 2px; padding-right: 2px; }

/* Dark theme interaction colors and POS subtotal readability. */
html[data-theme="dark"] .btn:hover:not(:disabled),
html[data-theme="dark"] .pos-btn-primary:hover:not(:disabled),
html[data-theme="dark"] .pos-v2-hold:hover:not(:disabled),
html[data-theme="dark"] .pos-v2-complete:hover:not(:disabled),
html[data-theme="dark"] .pos-v2-clear:hover:not(:disabled),
html[data-theme="dark"] .pos-v2-held-button:hover:not(:disabled),
html[data-theme="dark"] .pos-icon-btn:hover:not(:disabled),
html[data-theme="dark"] .pos-icon-btn-table:hover:not(:disabled),
html[data-theme="dark"] .pos-btn-eod:hover:not(:disabled),
html[data-theme="dark"] .pos-discount-apply-btn:hover:not(:disabled),
html[data-theme="dark"] .pos-shift-end-btn:hover:not(:disabled),
html[data-theme="dark"] .pos-chat-toggle:hover:not(:disabled),
html[data-theme="dark"] .pos-chat-send-btn:hover:not(:disabled) {
  background: var(--pos-accent-2) !important;
  border-color: var(--pos-accent-2) !important;
  color: #fff !important;
}

html[data-theme="dark"] .pos-sidebar-link:hover,
html[data-theme="dark"] .pos-sidebar-group-toggle:hover {
  background: var(--pos-accent-2) !important;
  color: #fff !important;
}

html[data-theme="dark"] .pos-sidebar-link:hover i,
html[data-theme="dark"] .pos-sidebar-group-toggle:hover > .bi:first-child {
  color: #fff !important;
}

html[data-theme="dark"] .pos-v2-subtotal-row,
html[data-theme="dark"] .pos-v2-subtotal-row span,
html[data-theme="dark"] .pos-v2-subtotal-row strong {
  color: #fff !important;
}

html[data-theme="dark"] .pos-v2-tax-row,
html[data-theme="dark"] .pos-v2-tax-row span,
html[data-theme="dark"] .pos-v2-tax-row strong {
  color: #fff !important;
}
.pos-v2-empty { height: 180px; text-align: center; color: #98a2b3; }
.pos-v2-empty i, .pos-v2-empty span, .pos-v2-empty small { display: block; }
.pos-v2-empty i { font-size: 1.8rem; margin-bottom: 7px; color: #c4cad5; }
.pos-v2-empty span { font-weight: 600; color: #667085; }.pos-v2-empty small { margin-top: 3px; }
.pos-v2-summary { padding: 3px 4px 0; }
.pos-v2-count-row { display: flex; justify-content: space-between; align-items: center; padding: 2px 0 10px; margin-bottom: 6px; border-bottom: 1px dashed var(--pos-border); font-size: .8rem; font-weight: 600; color: var(--pos-ink); }
.pos-v2-count-row i { color: var(--pos-accent); margin-right: 4px; }
.pos-v2-count-row > span:last-child > i { color: #C25700; }
.pos-v2-count-row strong { font-family: var(--font-mono); }
.pos-v2-summary-row, .pos-v2-total-row, .pos-v2-change { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: .86rem; }
.pos-v2-summary-row span { color: #667085; }.pos-v2-summary-row strong { font-weight: 600; }
.pos-v2-total-row { margin-top: 7px; padding: 13px 0 0; border-top: 1px dashed #d9dfe8; font-size: 1.12rem; font-weight: 700; }.pos-v2-total-row strong { color: #263eb5; }
.pos-v2-actions { position: sticky; bottom: 0; z-index: 5; display: grid; grid-template-columns: auto 1fr auto; gap: 9px; padding: 11px 0 calc(4px + env(safe-area-inset-bottom)); background: var(--pos-bg); }
.pos-v2-hold, .pos-v2-complete { min-height: 48px; border-radius: 11px; font-weight: 700; border: 0; padding: 0 15px; }.pos-v2-hold { background: #eef1f6; color: #485467; }.pos-v2-complete { background: #3155e7; color: #fff; box-shadow: 0 6px 14px rgba(49,85,231,.2); }.pos-v2-complete:hover { background: #2448d9; color: #fff; }.pos-v2-clear { min-height: 48px; color: #d14343; }
.pos-v2-payment-totals { border: 1px solid #e7ebf1; border-radius: 12px; padding: 11px 14px; margin-bottom: 20px; }.pos-v2-payment-totals > div { display: flex; justify-content: space-between; padding: 4px 0; color: #667085; font-size: .86rem; }.pos-v2-payment-totals strong { color: #172033; }.pos-v2-payment-totals .pos-v2-payment-due { margin-top: 6px; padding-top: 10px; border-top: 1px solid #e7ebf1; font-size: 1.1rem; font-weight: 700; }.pos-v2-payment-due strong { color: #3155e7; }
.pos-discount-breakdown-row { padding-left: 14px !important; font-size: .78rem !important; color: var(--pos-muted) !important; }
.pos-discount-breakdown-row strong { color: var(--pos-muted) !important; font-weight: 600 !important; }
.pos-v2-payment-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }.pos-v2-payment-methods label { border: 1px solid #dfe4ec; border-radius: 10px; padding: 11px 5px; text-align: center; font-size: .8rem; font-weight: 700; color: #667085; cursor: pointer; }.pos-v2-payment-methods label i { margin-right: 4px; }.pos-v2-payment-methods .btn-check:checked + label { background: #edf1ff; border-color: #3155e7; color: #2645c5; }
.pos-v2-amount-input { display: flex; align-items: center; border: 1px solid #dfe4ec; border-radius: 10px; padding-left: 13px; }.pos-v2-amount-input span { color: #667085; font-weight: 700; }.pos-v2-amount-input input { font-size: 1.1rem; font-weight: 700; }.pos-v2-change { margin-top: 12px; padding: 11px 13px; border-radius: 9px; background: #eaf9f1; color: #23764d; }.pos-v2-change strong { color: #23764d; }
@media (min-width: 768px) { .pos-v2 { padding: 8px 4px; } .pos-v2-cart { max-height: 42vh; } }
@media (max-width: 575.98px) { .pos-main > .container-fluid { padding: 16px !important; } .pos-v2 { min-height: calc(100vh - 112px); gap: 15px; } .pos-v2 h1 { font-size: 1.35rem; } .pos-v2-held-button { min-height: 38px; } .pos-v2-cart { max-height: none; } .pos-v2-actions { margin: 0 -2px; } .pos-v2-item-search { position: sticky; top: 76px; z-index: 10; margin: 8px -2px 0; } .modal-fullscreen-sm-down .modal-footer { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); } }

/* v2 follows the register's existing navy and copper design tokens. */
.pos-v2 { color: var(--pos-text); }
.pos-v2-item-search { border-color: var(--pos-accent-2); box-shadow: 0 0 0 3px rgba(224,122,44,.10); }
.pos-v2-item-search > i, .pos-v2-total-row strong, .pos-v2-payment-due strong { color: var(--pos-accent); }
.pos-v2 .pos-v2-total-row { font-size: 1.25rem; font-weight: 800; }
.pos-v2 .pos-v2-total-row span,
.pos-v2 .pos-v2-total-row strong { color: #C25700; }
.pos-v2 .pos-v2-total-row strong { font-size: 1.2em; letter-spacing: -.02em; }
.pos-v2-complete { background: var(--pos-fill-dark); box-shadow: 0 6px 14px rgba(22,35,63,.20); }
.pos-v2-complete:hover { background: var(--pos-ink-2); }
.pos-v2-payment-methods .btn-check:checked + label { background: rgba(224,122,44,.10); border-color: var(--pos-accent); color: var(--pos-ink); }
.pos-v2-modal-customer { margin-bottom: 18px; }
.pos-v2-cart-item:focus { outline: 2px solid var(--pos-accent); outline-offset: -2px; background: rgba(242,166,90,.10); }
.pos-v2-cart-item.pos-cart-keyboard-selected { outline: 2px solid rgba(224,122,44,.55); outline-offset: -2px; background: rgba(242,166,90,.08); }
.pos-v2-toast { position: fixed; z-index: 1090; left: 18px; bottom: 20px; display: flex; align-items: center; gap: 9px; max-width: calc(100vw - 36px); padding: 12px 15px; border-radius: 10px; background: var(--pos-fill-dark); color: #fff; box-shadow: 0 12px 28px rgba(13,23,48,.25); font-size: .86rem; font-weight: 600; opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.pos-v2-toast i { color: var(--pos-accent-2); }.pos-v2-toast.show { opacity: 1; transform: translateY(0); }
.pos-v2-toast.is-error { background: #9f2935; }
.pos-v2-toast.is-warning { background: var(--pos-fill-dark); }
.pos-v2-toast.is-info { background: #24456b; }
.pos-v2-toast.is-error i { color: #fff; }
.pos-v2-cash-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 14px; }.pos-v2-cash-keypad button { min-height: 42px; border: 1px solid var(--pos-border); border-radius: var(--radius-sm); background: var(--pos-surface); color: var(--pos-ink); font-weight: 700; }.pos-v2-cash-keypad button:active { background: rgba(224,122,44,.14); border-color: var(--pos-accent); }.pos-v2-cash-keypad .pos-v2-keypad-clear { color: var(--pos-danger); font-size: .76rem; }.pos-v2-cash-keypad .pos-v2-keypad-dot { grid-column: 2; }

/* Keep the phone register compact; on PC, show a proper two-column register. */
@media (min-width: 768px) {
  .pos-v2 { max-width: 1180px; display: grid; grid-template-columns: minmax(0, 1fr) 350px; grid-template-rows: auto minmax(440px, 1fr) auto; column-gap: 24px; row-gap: 18px; align-items: start; }
  .pos-v2-header { grid-column: 1 / -1; padding: 4px 2px 0; }
  .pos-v2-items { grid-column: 1; grid-row: 2 / 4; min-height: 0; background: var(--pos-surface); padding: 20px; border: 1px solid var(--pos-border); border-radius: var(--radius-md); box-shadow: 0 8px 22px rgba(22,35,63,.04); }
  .pos-v2-cart { max-height: calc(100vh - 300px); }
  .pos-v2-summary { grid-column: 2; grid-row: 2; align-self: start; position: sticky; top: 82px; background: var(--pos-surface); padding: 20px; border: 1px solid var(--pos-border); border-radius: var(--radius-md); }
  .pos-v2-actions { grid-column: 2; grid-row: 3; position: sticky; bottom: 16px; margin: 0; padding: 0; background: transparent; }
  .pos-v2-toast { left: 28px; bottom: 28px; }
  .pos-v2-cash-keypad { display: none !important; }
  .pos-v2-cash-keypad:not(.d-none) { display: grid !important; }
}

/* On tablets, let the cart use the available register height. The phone
   layout below remains unchanged. */
@media (min-width: 768px) and (max-width: 991.98px) {
  .pos-v2 {
    min-height: calc(100vh - 130px);
    min-height: calc(100dvh - 130px);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .pos-v2-items {
    align-self: stretch;
    min-height: 0;
  }

  .pos-v2-cart {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
  }
}

/* -------------------------------------------------------------------
   Keyboard shortcuts modal
   ------------------------------------------------------------------- */
.pos-shortcut-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--pos-border); }
.pos-shortcut-row:last-of-type { border-bottom: none; }
.pos-shortcut-row kbd {
  background: var(--pos-bg); color: var(--pos-ink); border: 1px solid var(--pos-border);
  border-bottom-width: 2px; border-radius: 5px; padding: 2px 7px; font-size: .78rem; font-family: var(--font-mono);
}

   Barcode / QR scanner modal
   ------------------------------------------------------------------- */
.pos-scanner-tabs .nav-link { color: var(--pos-muted); font-weight: 600; border-radius: 999px; padding: 6px 16px; }
.pos-scanner-tabs .nav-link.active { background: var(--pos-fill-dark); color: #fff; }
.pos-scanner-camera { position: relative; width: 100%; max-width: 420px; margin: 0 auto; min-height: 260px; border-radius: var(--radius-md); overflow: hidden; background: #0D1730; }
.pos-scanner-camera video, .pos-scanner-camera img, .pos-scanner-camera canvas { width: 100% !important; border-radius: var(--radius-md); }
.pos-scanner-result { border-color: var(--pos-border); }
.pos-scanner-result:disabled { opacity: .55; }
#scannerManualResults:empty { display: none; }
.pos-scanner-results {
  max-height: 320px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--pos-border); border-radius: var(--radius-md);
}
.pos-scanner-results:empty { border: none; }

@media (max-width: 576px) {
  .pos-scanner-results { max-height: calc(100vh - 360px); }
}

/* -------------------------------------------------------------------
   Dark mode
   -------------------------------------------------------------------
   Light is the default; toggling adds data-theme="dark" to <html>
   (see includes/header.php + assets/js/app.js). Re-pointing the same
   CSS variables the rest of the stylesheet already uses covers the
   navbar, sidebar, cards, tables, inputs, and modals in one pass.
   ------------------------------------------------------------------- */
html[data-theme="dark"] {
  --pos-bg: #10182C;
  --pos-surface: #182238;
  --pos-ink: #F4F1EA;
  --pos-ink-2: #FFFFFF;
  --pos-accent: #F2A65A;
  --pos-accent-2: #E07A2C;
  --pos-success: #4CC489;
  --pos-danger: #EF6B6B;
  --pos-warning: #E8BE6C;
  --pos-text: #E7E9F0;
  --pos-muted: #97A0B8;
  --pos-border: #2B3654;
}
html[data-theme="dark"] body { background: var(--pos-bg); color: var(--pos-text); }
html[data-theme="dark"] .pos-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu { background: var(--pos-surface); color: var(--pos-text); border-color: var(--pos-border); }
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .pos-select { background: var(--pos-surface); color: var(--pos-text); border-color: var(--pos-border); }
html[data-theme="dark"] .form-control::placeholder { color: var(--pos-muted); }
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus { background: var(--pos-surface); color: var(--pos-text); }
html[data-theme="dark"] .table,
html[data-theme="dark"] .pos-table { color: var(--pos-text); }
html[data-theme="dark"] .pos-table th { color: var(--pos-muted); }
html[data-theme="dark"] .pos-table tbody tr:hover { background: rgba(255,255,255,0.04); }
html[data-theme="dark"] .text-muted { color: var(--pos-muted) !important; }
html[data-theme="dark"] .pos-v2-items,
html[data-theme="dark"] .pos-v2-summary { background: var(--pos-surface); border-color: var(--pos-border); }
html[data-theme="dark"] .pos-v2-hold,
html[data-theme="dark"] .pos-v2-held-button,
html[data-theme="dark"] .pos-v2-clear { background: var(--pos-surface); border-color: var(--pos-border); color: var(--pos-text); }
html[data-theme="dark"] .pos-receipt { background: #EDE9DF; color: #1F2430; } /* receipts stay light - they mirror printed paper */
html[data-theme="dark"] .btn-outline-secondary { color: var(--pos-text); border-color: var(--pos-border); }
html[data-theme="dark"] .btn-outline-secondary:hover { background: var(--pos-border); color: var(--pos-text); }
html[data-theme="dark"] .pos-icon-btn:hover { background: var(--pos-border); }
html[data-theme="dark"] .dropdown-item { color: var(--pos-text); }
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus { background: var(--pos-border); color: var(--pos-text); }
html[data-theme="dark"] .dropdown-item.active,
html[data-theme="dark"] .dropdown-item:active { background: var(--pos-fill-dark); color: #fff; }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
html[data-theme="dark"] .list-group-item { background: var(--pos-surface); color: var(--pos-text); border-color: var(--pos-border); }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--pos-border); }

/* -------------------------------------------------------------------
   "Payment Complete" confirmation (shown right after Complete Sale,
   before the printable receipt)
   ------------------------------------------------------------------- */
.pos-payment-complete-check {
  width: 72px; height: 72px; margin: 0 auto; border-radius: 50%;
  background: rgba(47,158,100,0.12); color: var(--pos-success);
  display: flex; align-items: center; justify-content: center; font-size: 2.1rem;
}
.pos-payment-complete-figures {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; gap: .75rem; margin-top: .5rem; text-align: center;
}
.pos-payment-complete-figures div { width: 100%; min-width: 0; text-align: center; }
.pos-payment-complete-figures span { display: block; font-size: .74rem; color: var(--pos-muted); text-transform: uppercase; letter-spacing: .05em; }
.pos-payment-complete-figures strong { display: block; font-size: 1.3rem; font-family: var(--font-mono); color: var(--pos-ink); text-align: center; }
.pos-payment-complete-change strong { font-size: 2rem; color: var(--pos-success); font-weight: 800; text-align: center; }
.pos-payment-complete-progress { height: 6px; border-radius: 999px; background: var(--pos-border); overflow: hidden; }
.pos-payment-complete-progress-bar { height: 100%; width: 100%; background: var(--pos-success); transition: width 1s linear; }
@media (max-width: 420px) {
  .pos-payment-complete-figures { gap: .5rem; }
  .pos-payment-complete-figures strong { font-size: 1.05rem; }
  .pos-payment-complete-change strong { font-size: 1.55rem; }
}

/* -------------------------------------------------------------------
   Transaction Record & End of Day Reconciliation
   ------------------------------------------------------------------- */
.pos-recon-line { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: .86rem; border-bottom: 1px dashed var(--pos-border); }
.pos-recon-line:last-of-type { border-bottom: none; }
.pos-recon-line span:first-child { color: var(--pos-muted); }
.pos-recon-line strong { font-family: var(--font-mono); }
.pos-recon-expected { font-weight: 700; }
.pos-recon-expected strong { color: var(--pos-ink); font-size: 1rem; }
.pos-recon-variance strong { font-size: 1.05rem; }

/* -------------------------------------------------------------------
   POS cart: per-item bargained price + per-item discount
   ------------------------------------------------------------------- */
.pos-cart-price-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.pos-cart-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--pos-bg); border: 1px solid var(--pos-border); border-radius: 999px;
  padding: 2px 9px; font-size: .74rem; font-family: var(--font-mono); color: var(--pos-muted);
  line-height: 1.6; cursor: pointer; transition: border-color .15s ease, color .15s ease;
}
.pos-cart-chip i { font-size: .68rem; }
.pos-cart-chip:hover { border-color: var(--pos-accent); color: var(--pos-ink); }
.pos-cart-chip-price span { color: var(--pos-ink); font-weight: 600; }
.pos-cart-chip-discount { color: var(--pos-muted); }
.pos-cart-chip-discount.pos-cart-chip-active { border-color: var(--pos-accent); color: var(--pos-accent); background: rgba(224,122,44,.08); }
.pos-cart-chip-discount.pos-cart-chip-active i, .pos-cart-chip-discount.pos-cart-chip-active span { color: var(--pos-accent); font-weight: 600; }
.pos-bargain-badge { background: rgba(224,122,44,.12); color: var(--pos-accent); font-weight: 600; font-size: .62rem; vertical-align: middle; }
.pos-wholesale-badge { background: rgba(38,79,196,.12); color: #264fc4; font-weight: 600; font-size: .62rem; vertical-align: middle; }

.pos-cart-item-row { display: flex; align-items: flex-start; gap: 10px; }
.pos-cart-item-info { min-width: 0; flex: 1; }
.pos-cart-thumb {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: var(--radius-sm, 6px); overflow: hidden;
  background: var(--pos-bg); display: flex; align-items: center; justify-content: center; color: var(--pos-muted);
  font-size: 1.1rem;
}
.pos-cart-thumb img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 576px) {
  .pos-cart-thumb { width: 36px; height: 36px; font-size: .95rem; }
}

.pos-btn-eod { background: var(--pos-fill-dark); color: #fff; border: none; font-weight: 600; }
.pos-btn-eod:hover { background: var(--pos-ink-2); color: #fff; }

/* -------------------------------------------------------------------
   Senior Citizen / PWD discount (Payment modal)
   ------------------------------------------------------------------- */
.pos-senior-pwd { border: 1px solid var(--pos-border); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 16px; background: var(--pos-bg); }
.pos-senior-pwd .form-check-label { font-weight: 600; color: var(--pos-ink); }
#posSeniorPwdFields .btn-group .btn { font-size: .8rem; }

/* -------------------------------------------------------------------
   Additional discount widget (Payment modal, below the totals)
   ------------------------------------------------------------------- */
.pos-additional-discount { background: var(--pos-bg); border: 1px solid var(--pos-border); border-radius: var(--radius-md); padding: 12px 14px; margin: 12px 0 16px; }
.pos-additional-discount-label { font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--pos-muted); margin-bottom: 8px; }
.pos-additional-discount-label i { font-size: .8rem; cursor: help; }
.pos-discount-presets { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.pos-discount-preset { flex: 1 1 0; min-width: 60px; border: 1px solid var(--pos-border); background: var(--pos-surface); color: var(--pos-ink); border-radius: 999px; padding: 7px 10px; font-size: .85rem; font-weight: 600; }
.pos-discount-preset:hover, .pos-discount-preset.active { border-color: var(--pos-accent); color: var(--pos-accent); background: rgba(224,122,44,.08); }
.pos-discount-value-row { display: flex; align-items: center; gap: 8px; background: var(--pos-surface); border: 1px solid var(--pos-border); border-radius: 999px; padding: 5px 6px 5px 14px; }
.pos-discount-value-row input { flex: 1; border: none; background: transparent; font-size: .9rem; color: var(--pos-ink); padding: 4px 0; }
.pos-discount-value-row input:focus { outline: none; }
.pos-discount-mode-btn { width: 34px; height: 34px; border-radius: 50%; border: none; font-weight: 700; font-size: .85rem; background: var(--pos-fill-dark); color: #fff; flex-shrink: 0; }
.pos-discount-mode-btn.active { background: var(--pos-danger); color: #fff; }
.pos-discount-applied-row { display: flex; justify-content: space-between; align-items: center; }
.pos-discount-applied-value { color: var(--pos-success); font-weight: 700; font-size: .92rem; }
.pos-discount-remove-link { border: none; background: transparent; color: var(--pos-danger); font-weight: 600; font-size: .8rem; }
.pos-discount-remove-link:hover { text-decoration: underline; }
.pos-discount-apply-btn { width: 100%; border: none; background: var(--pos-fill-dark); color: #fff; font-weight: 700; font-size: .82rem; border-radius: 999px; padding: 8px; }
.pos-discount-apply-btn:hover { background: var(--pos-ink-2); }
.pos-discount-locked { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pos-discount-locked .pos-discount-apply-btn { width: auto; padding: 6px 16px; }

/* -------------------------------------------------------------------
   Payment method redesign (Single/Split toggle, numbered tenders, FILL)
   ------------------------------------------------------------------- */
.pos-payment-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.pos-payment-summary-column, .pos-payment-entry-column { min-width: 0; }
.pos-payment-summary-column .pos-v2-payment-totals { margin-bottom: 10px; padding: 8px 11px; }
.pos-payment-summary-column .pos-v2-payment-totals > div { padding: 2px 0; font-size: .82rem; }
.pos-payment-summary-column .pos-v2-payment-totals .pos-v2-payment-due { padding-top: 7px; margin-top: 4px; }
.pos-payment-summary-column .pos-additional-discount { padding: 10px; margin-bottom: 0; }
.pos-payment-summary-column .pos-discount-presets { gap: 5px; }
.pos-payment-summary-column .pos-discount-preset { min-height: 34px; padding: 4px; }
.pos-payment-summary-column .pos-discount-apply-btn { padding: 6px; }
.pos-payment-entry-column .pos-payment-row-v2 { padding: 8px; margin-bottom: 7px; }
.pos-payment-entry-column .pos-add-tender-btn { padding: 6px; margin-bottom: 7px; }
.pos-payment-entry-column .pos-payment-status-bar { padding: 7px 9px; }
@media (min-width: 600px) {
  #paymentModal .modal-dialog { width: min(92vw, 900px); max-width: 900px; }
  #paymentModal .modal-content { max-height: calc(100dvh - 2rem); }
  #paymentModal .modal-body { overflow-y: auto; }
}
@media (max-width: 599.98px) {
  .pos-payment-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
#paymentModal .modal-content { border: 1px solid var(--pos-border); border-radius: 16px; overflow: hidden; box-shadow: 0 18px 48px rgba(16,24,40,.2); }
#paymentModal .modal-header { padding: 14px 18px; background: var(--pos-surface); border-bottom: 1px solid var(--pos-border); }
#paymentModal .modal-title { color: var(--pos-ink); font-size: 1.05rem; font-weight: 750; }
#paymentModal .modal-body { padding: 16px 18px; }
#paymentModal .modal-footer { padding: 12px 18px; background: var(--pos-bg); border-top: 1px solid var(--pos-border); }
.pos-payment-summary-column .pos-senior-pwd,
.pos-payment-summary-column .pos-v2-payment-totals,
.pos-payment-summary-column .pos-payment-status-bar,
.pos-payment-summary-column .pos-v2-change,
.pos-payment-entry-column .pos-additional-discount,
.pos-payment-entry-column #posPaymentRows { border-radius: 12px; }
.pos-payment-summary-column .pos-senior-pwd { margin-bottom: 10px; padding: 10px 12px; }
.pos-payment-summary-column .pos-payment-status-bar { margin-top: 9px; gap: 8px; font-size: .75rem; }
.pos-payment-summary-column .pos-v2-change { margin-top: 7px; padding: 8px 11px; }
.pos-payment-entry-column .pos-additional-discount { margin: 0 0 12px; }
.pos-payment-entry-column .pos-payment-header { padding-bottom: 8px; border-bottom: 1px solid var(--pos-border); }
.pos-payment-entry-column .pos-v2-payment-label { color: var(--pos-ink); }
#paymentModal .modal-footer .btn-light { border: 1px solid var(--pos-border); }
#paymentModal #btnCheckout { min-width: 150px; }
.pos-payment-layout { gap: 16px; }
.pos-payment-summary-column,
.pos-payment-entry-column { padding: 14px; border: 1px solid var(--pos-border); border-radius: 14px; background: var(--pos-surface); box-shadow: 0 2px 8px rgba(16,24,40,.04); }
.pos-payment-summary-column .pos-v2-modal-customer { margin-bottom: 12px; }
.pos-payment-summary-column .pos-v2-payment-totals { margin-bottom: 0; background: var(--pos-bg); }
.pos-payment-summary-column .pos-v2-payment-totals .pos-v2-payment-due { color: var(--pos-ink); }
.pos-payment-summary-column .pos-v2-payment-due strong { font-size: 1.2rem; }
.pos-payment-summary-column .pos-senior-pwd,
.pos-payment-entry-column .pos-additional-discount {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--pos-border);
  border-radius: var(--radius-md);
  background: var(--pos-bg);
}
.pos-payment-summary-column .pos-senior-pwd .pos-additional-discount-label,
.pos-payment-entry-column .pos-additional-discount .pos-additional-discount-label {
  margin-bottom: 8px;
  color: var(--pos-muted);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.pos-payment-entry-column .pos-additional-discount .pos-discount-preset { min-height: 34px; padding: 4px 8px; }
.pos-payment-entry-column .pos-payment-header { gap: 10px; }
.pos-payment-entry-column #posPaymentRows:empty { min-height: 0; }
#paymentModal .modal-footer { position: sticky; bottom: 0; z-index: 2; }
@media (max-width: 599.98px) {
  .pos-payment-layout { gap: 8px; }
  .pos-payment-summary-column,
  .pos-payment-entry-column { padding: 11px; }
  #paymentModal .modal-header { padding: 12px 15px; }
  #paymentModal .modal-body { padding: 12px 14px; }
  #paymentModal .modal-footer { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .pos-payment-layout { gap: 8px; }
}
.pos-payment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pos-payment-mode-toggle { display: inline-flex; border-radius: 999px; background: var(--pos-bg); border: 1px solid var(--pos-border); padding: 3px; }
.pos-payment-mode-btn { border: none; background: transparent; color: var(--pos-muted); font-size: .78rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; }
.pos-payment-mode-btn.active { background: var(--pos-danger); color: #fff; }
.pos-senior-type-toggle .pos-payment-mode-btn { cursor: pointer; }
.pos-senior-type-toggle .btn-check:checked + .pos-payment-mode-btn { background: var(--pos-danger); color: #fff; }
.pos-senior-type-toggle .btn-check:focus-visible + .pos-payment-mode-btn { outline: 2px solid var(--pos-accent); outline-offset: 2px; }
.pos-split-banner { display: flex; justify-content: space-between; align-items: center; background: rgba(214,69,69,.08); border: 1px solid rgba(214,69,69,.25); color: var(--pos-danger); border-radius: var(--radius-sm); padding: 8px 12px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 10px; }
.pos-split-banner strong { font-family: var(--font-mono); text-transform: none; letter-spacing: normal; }

.pos-payment-row-v2 { background: var(--pos-bg); border: 1px solid var(--pos-border); border-radius: var(--radius-md); padding: 10px; margin-bottom: 10px; }
.pos-payment-row-main { display: flex; align-items: center; gap: 8px; }
.pos-payment-row-badge { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--pos-fill-dark); color: #fff; font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.pos-payment-row-main .payment-method { flex: 0 0 34%; }
.pos-payment-amount-wrap { flex: 1; display: flex; align-items: center; gap: 6px; background: var(--pos-surface); border: 1px solid var(--pos-border); border-radius: 8px; padding: 4px 8px; }
.pos-peso-prefix { color: var(--pos-muted); font-weight: 600; font-size: .85rem; }
.pos-payment-amount-wrap .payment-amount { border: none; background: transparent; padding: 4px 0; flex: 1; min-width: 0; }
.pos-payment-amount-wrap .payment-amount:focus { outline: none; box-shadow: none; }
.pos-fill-btn { flex-shrink: 0; border: none; background: var(--pos-danger); color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .04em; border-radius: 6px; padding: 5px 8px; }
.pos-remove-row-btn { flex-shrink: 0; border: none; background: transparent; color: var(--pos-danger); font-size: 1.1rem; line-height: 1; padding: 0 4px; }
.pos-payment-ref-inline { margin-top: 8px; font-size: .8rem; }

.pos-add-tender-btn { width: 100%; border: 1px dashed var(--pos-border); background: transparent; color: var(--pos-muted); font-weight: 600; font-size: .85rem; border-radius: 999px; padding: 9px; margin-bottom: 10px; }
.pos-add-tender-btn:hover { border-color: var(--pos-accent); color: var(--pos-accent); }

.pos-payment-status-bar { display: flex; justify-content: space-between; align-items: center; background: rgba(232,190,108,.15); border: 1px solid rgba(232,190,108,.4); border-radius: var(--radius-sm); padding: 9px 12px; font-size: .8rem; font-weight: 600; color: var(--pos-ink); }
.pos-payment-status-bar strong { font-family: var(--font-mono); }

/* -------------------------------------------------------------------
   Start Shift / End Shift feature
   ------------------------------------------------------------------- */
.pos-shift-badge { position: relative; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--pos-border); background: var(--pos-surface); border-radius: 999px; padding: 6px 14px 6px 10px; font-size: .78rem; white-space: nowrap; line-height: 1; max-width: 220px; }
.pos-shift-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pos-success); flex-shrink: 0; box-shadow: 0 0 0 3px rgba(47,158,100,.15); }
.pos-shift-badge-text { color: var(--pos-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.pos-shift-badge-sep { color: var(--pos-muted); }

.pos-shift-panel { width: 280px; max-width: calc(100vw - 24px); padding: 16px 18px; box-sizing: border-box; }
.pos-shift-panel-head { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--pos-border); font-size: .92rem; }
.pos-shift-panel-head strong { color: var(--pos-ink); }
.pos-shift-panel-number { margin-left: auto; color: var(--pos-muted); font-size: .8rem; flex-shrink: 0; }
.pos-shift-panel-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; font-size: .82rem; color: var(--pos-muted); }
.pos-shift-panel-row strong { color: var(--pos-ink); font-family: var(--font-mono); text-align: right; }
.pos-shift-end-btn { width: 100%; margin-top: 10px; border: none; background: var(--pos-fill-dark); color: #fff; font-weight: 700; font-size: .82rem; border-radius: 999px; padding: 9px; }
.pos-shift-end-btn:hover { background: var(--pos-ink-2); color: #fff; }
.pos-shift-cancel-btn { width: 100%; margin-top: 10px; border: none; background: var(--pos-accent); color: #fff; font-weight: 700; font-size: .82rem; border-radius: 999px; padding: 9px; }
.pos-shift-cancel-btn:hover, .pos-shift-cancel-btn:focus { background: #c96520; color: #fff; }
.pos-shift-panel-foot { border-top: 1px solid var(--pos-border); padding: 8px 0 0; margin-top: 4px; font-size: .74rem; color: var(--pos-muted); }

.pos-shift-quickcount { border: 1px solid var(--pos-border); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 12px; background: var(--pos-bg); }
.pos-shift-quickcount-head { font-size: .78rem; font-weight: 700; color: var(--pos-muted); margin-bottom: 8px; }
.pos-shift-quickcount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pos-shift-quickcount-grid label, .pos-shift-coins { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: .78rem; color: var(--pos-muted); font-weight: 600; }
.pos-shift-quickcount-grid input, .pos-shift-coins input { width: 68px; text-align: right; }
.pos-shift-coins { margin-top: 8px; }
.pos-shift-coins input { width: 100px; }
.pos-shift-quickcount-total { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--pos-border); font-weight: 700; }
.pos-shift-quickcount-total strong { color: var(--pos-accent); font-family: var(--font-mono); }

.pos-shift-prev-banner { display: flex; align-items: center; gap: 8px; background: rgba(47,158,100,.1); border: 1px solid rgba(47,158,100,.3); color: var(--pos-success); border-radius: var(--radius-sm); padding: 9px 12px; font-size: .82rem; margin-top: 10px; }
.pos-shift-prev-banner strong { font-family: var(--font-mono); }

.pos-shift-start-btn, .pos-shift-end-confirm-btn { border: none; border-radius: 999px; padding: 9px 18px; font-weight: 700; font-size: .88rem; color: #fff; }
.pos-shift-start-btn { background: var(--pos-fill-dark); }
.pos-shift-end-confirm-btn { background: var(--pos-fill-dark); }
.pos-shift-start-btn:disabled, .pos-shift-end-confirm-btn:disabled { background: var(--pos-border); color: var(--pos-muted); cursor: not-allowed; }

.pos-shift-stat-card { border: 1px solid var(--pos-border); border-radius: var(--radius-md); padding: 10px 12px; height: 100%; }
.pos-shift-stat-card strong { display: block; font-size: 1.15rem; font-family: var(--font-mono); color: var(--pos-ink); }
.pos-shift-stat-success { background: rgba(47,158,100,.08); border-color: rgba(47,158,100,.3); }
.pos-shift-stat-success strong { color: var(--pos-success); }

.pos-shift-recon-card { border: 1px solid var(--pos-border); border-radius: var(--radius-md); padding: 10px 14px; background: var(--pos-bg); }
.pos-shift-recon-head { font-size: .78rem; font-weight: 700; color: var(--pos-muted); margin-bottom: 6px; }

/* -------------------------------------------------------------------
   Chat widget (site-wide internal support chat)
   ------------------------------------------------------------------- */
.pos-chat-toggle {
  position: fixed; right: 20px; bottom: 20px; z-index: 1091;
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: var(--pos-fill-dark); color: #fff; font-size: 1.35rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}
.pos-chat-toggle:hover { background: var(--pos-ink-2); }
.pos-chat-toggle-badge {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 4px;
  border-radius: 999px; background: var(--pos-danger, #e5484d); color: #fff; font-size: .68rem;
  font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
  z-index: 1;
}

.pos-chat-panel {
  position: fixed; right: 20px; bottom: 90px; z-index: 1091;
  width: 360px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 120px);
  background: var(--pos-surface); border-radius: var(--radius-md); box-shadow: 0 18px 48px rgba(0,0,0,.22);
  display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--pos-border);
}

.pos-chat-panel-header {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--pos-border);
  background: var(--pos-fill-dark); color: #fff;
}
.pos-chat-panel-title { font-weight: 700; flex: 1; }
.pos-chat-back-btn, .pos-chat-close-btn { background: none; border: none; color: #fff; font-size: 1.05rem; padding: 4px; opacity: .9; }
.pos-chat-back-btn:hover, .pos-chat-close-btn:hover { opacity: 1; }

.pos-chat-list-view { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px; overflow: hidden; }
.pos-chat-new-btn {
  border: 1px dashed var(--pos-border); background: var(--pos-bg); border-radius: var(--radius-sm, 6px);
  padding: 8px; font-weight: 600; font-size: .85rem; color: var(--pos-ink); margin-bottom: 10px;
}
.pos-chat-new-btn:hover { border-color: var(--pos-accent); }
.pos-chat-contact-picker { margin-bottom: 10px; }
.pos-chat-conversations { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.pos-chat-contact-row, .pos-chat-conv-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: var(--radius-sm, 6px);
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
}
.pos-chat-contact-row:hover, .pos-chat-conv-row:hover { background: var(--pos-bg); }
.pos-chat-avatar {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; background: var(--pos-fill-dark); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
}
.pos-chat-avatar.general { background: var(--pos-accent, #e07a2c); }
.pos-chat-avatar.group { background: #6366f1; }
/* Small dot overlaid on the avatar's bottom-right corner - see
   presenceDot() in chat.js. Needs the avatar itself to be a positioning
   context, hence position:relative added here rather than on every
   individual usage. */
.pos-chat-avatar { position: relative; }
.pos-chat-presence-dot {
    position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px;
    border-radius: 50%; background: #9ca3af; border: 2px solid var(--pos-surface);
}
.pos-chat-presence-dot.online { background: #22c55e; }

/* Checkbox people-picker used by the "New group" and "Group members"
   (invite) modals, and the plain member list in "Group members". Each
   contact/member is a full-width row - without an explicit flex layout
   here, the <label>/<div> wrapping each one has no row structure at
   all, so multiple entries render with their names squashed right up
   against each other instead of stacking as separate rows. */
.pos-chat-group-picker { max-height: 220px; overflow-y: auto; border: 1px solid var(--pos-border); border-radius: 8px; }
.pos-chat-group-picker-row, .pos-chat-group-member-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px; width: 100%;
}
.pos-chat-group-picker-row { cursor: pointer; }
.pos-chat-group-picker-row:hover { background: var(--pos-bg); }
.pos-chat-group-picker-row .form-check-input { margin: 0; flex-shrink: 0; }
.pos-chat-group-member-row { font-size: .85rem; }
.pos-chat-group-member-row + .pos-chat-group-member-row { border-top: 1px solid var(--pos-border); }
.pos-chat-conv-info { min-width: 0; flex: 1; }
.pos-chat-conv-title { font-weight: 600; font-size: .85rem; }
.pos-chat-conv-preview { font-size: .74rem; color: var(--pos-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-chat-conv-unread {
  flex: 0 0 auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--pos-danger, #e5484d); color: #fff; font-size: .65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.pos-chat-contact-role { font-size: .68rem; color: var(--pos-muted); }

.pos-chat-thread-view { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.pos-chat-messages { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px; display: flex; flex-direction: column; gap: 8px; }

.pos-chat-bubble-row { display: flex; flex-direction: column; max-width: 78%; }
.pos-chat-bubble-row.mine { align-self: flex-end; align-items: flex-end; }
.pos-chat-bubble-row.theirs { align-self: flex-start; align-items: flex-start; }
.pos-chat-bubble-sender { font-size: .66rem; color: var(--pos-muted); margin-bottom: 2px; padding: 0 2px; }
.pos-chat-bubble {
  border-radius: 14px; padding: 8px 12px; font-size: .85rem; line-height: 1.4; word-break: break-word;
  white-space: pre-wrap;
}
.pos-chat-bubble-row.mine .pos-chat-bubble { background: var(--pos-fill-dark); color: #fff; border-bottom-right-radius: 4px; }
.pos-chat-bubble-row.theirs .pos-chat-bubble { background: var(--pos-bg); color: var(--pos-ink); border-bottom-left-radius: 4px; }
.pos-chat-bubble-time { font-size: .62rem; color: var(--pos-muted); margin-top: 2px; padding: 0 2px; }
/* Missed/declined video call entry - a centered system notice, not a normal chat bubble, since nobody actually said these words. See renderCallLogEntry() in chat.js. */
.pos-chat-call-log {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin: 6px 0; font-size: .74rem; color: var(--pos-muted);
}
.pos-chat-call-log i { color: #ef4444; }
.pos-chat-call-log-time { color: var(--pos-muted); opacity: .8; }
.pos-chat-typing-indicator { font-size: .72rem; color: var(--pos-muted); font-style: italic; padding: 0 12px 4px; }

/* @mention autocomplete (General channel only - see chat.js) */
.pos-chat-mention-list {
    max-height: 160px; overflow-y: auto;
    margin: 0 12px 4px; border: 1px solid var(--pos-border); border-radius: 8px;
    background: var(--pos-surface); box-shadow: 0 6px 18px rgba(0,0,0,.1);
}
.pos-chat-mention-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: .82rem; cursor: pointer; }
.pos-chat-mention-item:hover, .pos-chat-mention-item.active { background: var(--pos-bg); }
.pos-chat-mention-avatar {
    width: 22px; height: 22px; border-radius: 50%; background: var(--pos-fill-dark); color: #fff;
    font-size: .68rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pos-chat-mention { color: var(--pos-accent-2, #2563eb); font-weight: 600; }

/* ---- Video calling ---- */
.pos-call-incoming {
    position: fixed; top: 16px; right: 16px; z-index: 1095;
    display: flex; align-items: center; gap: 14px;
    background: var(--pos-ink-2, #1f2937); color: #fff;
    padding: 12px 14px; border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0,0,0,.28);
    max-width: min(360px, calc(100vw - 32px));
}
.pos-call-incoming-info { display: flex; align-items: center; gap: 8px; font-size: .85rem; flex: 1; min-width: 0; }
.pos-call-incoming-info i { color: #4ade80; font-size: 1.1rem; }
.pos-call-incoming-actions { display: flex; gap: 8px; flex-shrink: 0; }
.pos-call-btn {
    width: 38px; height: 38px; border-radius: 50%; border: none;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; color: #fff;
}
.pos-call-btn.accept { background: #22c55e; }
.pos-call-btn.decline { background: #ef4444; }

.pos-call-overlay {
    position: fixed; inset: 0; z-index: 1096; background: #0b0f14;
    display: flex; flex-direction: column;
}
.pos-call-remote-wrap { position: relative; flex: 1; min-height: 0; }
.pos-call-remote-video { width: 100%; height: 100%; object-fit: contain; background: #0b0f14; }
.pos-call-local-video {
    position: absolute; bottom: 16px; right: 16px; width: 130px; height: 174px;
    object-fit: cover; border-radius: 10px; border: 2px solid rgba(255,255,255,.25);
    background: #111; transform: scaleX(-1); /* mirror, like a selfie camera */
}
/* Only the front camera should mirror (like looking in a mirror) - the
   rear camera shows the world normally, so this cancels the mirroring
   above once switchCamera() (assets/js/chat.js) flips to it. */
.pos-call-local-video.pos-call-camera-rear { transform: none; }
.pos-call-status {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    color: rgba(255,255,255,.85); font-size: 1rem; text-align: center;
}
.pos-call-controls {
    display: flex; justify-content: center; gap: 16px; padding: 16px;
    background: rgba(255,255,255,.04);
}
.pos-call-ctrl-btn {
    width: 52px; height: 52px; border-radius: 50%; border: none;
    background: rgba(255,255,255,.14); color: #fff; font-size: 1.15rem;
    display: inline-flex; align-items: center; justify-content: center;
}
.pos-call-ctrl-btn.active { background: rgba(255,255,255,.35); }
.pos-call-ctrl-btn.end { background: #ef4444; }
@media (max-width: 575.98px) {
    .pos-call-local-video { width: 96px; height: 128px; }
}
.pos-chat-bubble-image { max-width: 100%; border-radius: 10px; display: block; margin-top: 4px; cursor: pointer; }
.pos-chat-bubble-file {
  display: flex; align-items: center; gap: 6px; margin-top: 4px; padding: 6px 10px; border-radius: 8px;
  background: rgba(255,255,255,.15); font-size: .78rem;
}
.pos-chat-bubble-row.theirs .pos-chat-bubble-file { background: #fff; border: 1px solid var(--pos-border); }
.pos-chat-bubble-file a { color: inherit; text-decoration: underline; }

/* Shared product image preview used by the Products and POS screens. */
.modal-dialog.product-image-zoom-dialog { width: min(80vw, 1100px); max-width: min(80vw, 1100px); }
.product-image-zoom-stage { max-height: 70vh; overflow: auto; text-align: center; background: var(--pos-bg); border-radius: 10px; padding: 12px; }
.product-image-zoom-stage img { display: inline-block; max-width: 100%; max-height: 68vh; object-fit: contain; transform-origin: center center; transition: transform .15s ease; }
.product-image-zoom-controls { display: flex; align-items: center; gap: 8px; }
@media (max-width: 767.98px) {
  .modal-dialog.product-image-zoom-dialog { width: auto; max-width: none; margin: .5rem; }
  .product-image-zoom-stage { max-height: 68vh; }
  .product-image-zoom-stage img { max-height: 64vh; }
}

.pos-chat-attachment-preview {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: .78rem; color: var(--pos-muted);
  border-top: 1px solid var(--pos-border);
}
.pos-chat-attachment-preview span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-chat-attachment-preview button { border: none; background: none; color: var(--pos-muted); }

.pos-chat-composer { border-top: 1px solid var(--pos-border); padding: 8px 10px; }
.pos-chat-composer-row { display: flex; align-items: center; gap: 6px; }
.pos-chat-composer-row input { flex: 1; }
.pos-chat-icon-btn {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--pos-bg);
  color: var(--pos-muted); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pos-chat-icon-btn:hover { color: var(--pos-ink); }
.pos-chat-send-btn {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--pos-fill-dark);
  color: #fff; display: flex; align-items: center; justify-content: center;
}
.pos-chat-send-btn:hover { background: var(--pos-ink-2); }
.pos-chat-emoji-picker { position: absolute; bottom: 56px; right: 10px; z-index: 5; box-shadow: 0 10px 28px rgba(0,0,0,.2); border-radius: 10px; }

@media (max-width: 576px) {
  .pos-chat-panel { right: 8px; left: 8px; bottom: 78px; width: auto; max-width: none; height: calc(100vh - 150px); }
  .pos-chat-toggle { right: 14px; bottom: 14px; width: 50px; height: 50px; font-size: 1.2rem; }
  .pos-chat-emoji-picker { right: 4px; left: 4px; }
}

/* -------------------------------------------------------------------
   Mobile layout: keep every table column and action available by touch.
   ------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .pos-main > .container-fluid { min-width: 0; padding: 14px !important; }
  .pos-main .card-body { min-width: 0; padding: 14px; }
  .pos-list-search { flex: 0 0 100%; width: 100%; max-width: 100%; min-width: 0; }

  /* Tables keep their full content width and scroll inside their wrapper,
     instead of stretching the whole page or hiding columns/actions. */
  .table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  .table-responsive > .table { width: max-content; min-width: 100%; margin-bottom: 0; }
  .table-responsive td { white-space: normal; }
  .table-responsive td:last-child { white-space: nowrap; }
  .table-responsive .btn { flex-shrink: 0; }
  .pos-table td { padding: .6rem .55rem; }
  .pos-icon-btn-table { min-width: 40px; min-height: 40px; }

  /* Increase touch targets while allowing toolbars and action rows to wrap. */
  button:not(.btn-close) { min-height: 42px; }
  .btn { min-height: 42px; align-items: center; justify-content: center; }
  .btn.btn-sm { min-height: 38px; }
  .btn-group { max-width: 100%; }
  .nav-tabs .nav-link, .nav-pills .nav-link { min-height: 42px; display: inline-flex; align-items: center; }
  .pagination .page-link { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
  .pagination { flex-wrap: wrap; }
  .form-control, .form-select { min-height: 42px; }
  textarea.form-control { min-height: 88px; }

  .modal-dialog:not(.modal-fullscreen-sm-down) { width: auto; max-width: none; margin: .5rem; }
  .modal-content { max-height: calc(100dvh - 1rem); }
  .modal-body { min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .modal-footer { flex-wrap: wrap; gap: .5rem; }
  .modal-footer > .btn { flex: 1 1 auto; }

  .pos-v2-cart { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .pos-v2-cart-table { min-width: 430px; }
  .pos-v2-cart-table .pos-qty-control .btn { width: 42px; min-width: 42px; min-height: 42px; }
  .pos-v2-item-search button { min-width: 40px; min-height: 40px; }
  .pos-cart-chip { min-height: 38px; padding: 5px 10px; }
  .pos-v2-actions { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) minmax(0, 1.6fr); gap: 6px; }
  .pos-v2-actions > * { min-width: 0; padding-left: 8px; padding-right: 8px; }

  #reportPresets { flex-wrap: wrap; }
  .pos-date-range { flex: 1 1 100%; width: 100%; }
  .pos-date-range .form-control { flex: 1 1 0; width: 1%; max-width: none !important; }
  .rec-control-groups { width: 100%; justify-content: space-between; }

  /* Stack search above the secondary filters on small screens. Keep each
     dropdown and its complete date range together on the second row. */
  .sales-filter-bar { align-items: center !important; }
  .sales-filter-controls,
  .activity-filter-controls {
    display: flex;
    flex: 1 1 100%;
    flex-direction: column;
    align-items: stretch;
    gap: .5rem !important;
    width: 100%;
    min-width: 0;
  }
  .sales-filter-search,
  .activity-filter-search {
    flex: 0 0 auto;
    width: 100%;
    max-width: none !important;
  }
  .sales-filter-secondary,
  .activity-filter-secondary {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: .5rem;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  .sales-filter-secondary > #saleStatusFilter,
  .activity-filter-secondary > #logUserFilter {
    flex: 0 0 clamp(100px, 23vw, 140px);
    max-width: none !important;
  }
  .sales-filter-secondary > #salePaymentFilter {
    flex: 0 0 clamp(120px, 26vw, 170px);
    max-width: none !important;
  }
  .sales-filter-secondary > .pos-date-range,
  .activity-filter-secondary > .pos-date-range {
    flex: 0 0 auto;
    width: auto;
  }
  .sales-filter-secondary > .pos-date-range .form-control,
  .activity-filter-secondary > .pos-date-range .form-control {
    flex: 0 0 clamp(100px, 21vw, 118px);
    width: clamp(100px, 21vw, 118px);
    max-width: none !important;
  }
  .sales-filter-bar > #salePerPage { flex: 0 0 140px; margin-left: auto; }
  #logPerPage { flex: 0 0 140px; margin-left: auto; }
}

/* Daily Sales has many columns; keep details on one line and scroll the table itself. */
.daily-sales-table-wrap {
  width: 100%;
  max-width: 100%;
  max-height: min(65vh, 600px);
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.daily-sales-table-wrap > .daily-sales-table {
  width: max-content;
  min-width: 1500px;
  table-layout: auto;
}
.daily-sales-table th,
.daily-sales-table td {
  white-space: nowrap;
}
.daily-sales-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--pos-surface, #fff);
}

@media (max-width: 380px) {
  .pos-navbar { padding-left: .4rem !important; padding-right: .4rem !important; }
  .pos-navbar .navbar-brand { margin-right: .25rem; }
  .pos-navbar .ms-auto { gap: .15rem !important; }
  .pos-v2-actions { grid-template-columns: 1fr 1fr; }
  .pos-v2-actions .pos-v2-clear { grid-column: 1; }
  .pos-v2-actions .pos-v2-hold { grid-column: 2; }
  .pos-v2-actions .pos-v2-complete { grid-column: 1 / -1; }
  .pos-product-col { width: 50%; }
}

@media (max-width: 576px) {
  .pos-product-tier-btn { min-width: 38px; min-height: 38px; justify-content: center; font-size: .58rem; }
  .pos-product-tier-btn span { display: inline; }
}

@media (max-width: 768px) {
  /* On mobile and small tablets, keep the dropdown and complete date range
     on one row. Let the row scroll when the viewport is too narrow. */
  .sales-filter-controls,
  .activity-filter-controls {
    display: flex;
    flex: 1 1 100%;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap !important;
    gap: .5rem !important;
    width: 100%;
    min-width: 0;
  }
  .sales-filter-search,
  .activity-filter-search {
    flex: 0 0 auto;
    width: 100%;
    max-width: none !important;
  }
  .sales-filter-secondary,
  .activity-filter-secondary {
    display: flex !important;
    align-items: center;
    flex: 0 0 auto;
    flex-wrap: nowrap !important;
    gap: .5rem;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  .sales-filter-secondary > #saleStatusFilter,
  .activity-filter-secondary > #logUserFilter {
    flex: 0 0 clamp(100px, 23vw, 140px);
    width: clamp(100px, 23vw, 140px) !important;
    min-width: 100px;
    max-width: none !important;
  }
  .sales-filter-secondary > #salePaymentFilter {
    flex: 0 0 clamp(120px, 26vw, 150px);
    width: clamp(120px, 26vw, 150px) !important;
    min-width: 120px;
    max-width: none !important;
  }
  .sales-filter-secondary > .pos-date-range,
  .activity-filter-secondary > .pos-date-range {
    display: inline-flex !important;
    flex: 0 0 auto;
    flex-wrap: nowrap !important;
    width: max-content !important;
    min-width: max-content;
    white-space: nowrap;
  }
  .sales-filter-secondary > .pos-date-range .form-control,
  .activity-filter-secondary > .pos-date-range .form-control {
    flex: 0 0 clamp(100px, 21vw, 118px);
    width: clamp(100px, 21vw, 118px);
    max-width: none !important;
  }
}
/* Login process guide */
.process-guide-modal .modal-content { border: 0; border-radius: 20px; overflow: hidden; box-shadow: 0 24px 70px rgba(20, 33, 61, .22); }
.process-guide-eyebrow { color: var(--pos-accent, #e07a2c); font-size: .72rem; font-weight: 700; letter-spacing: .09em; }
.process-guide-layout { display: grid; grid-template-columns: minmax(210px, .8fr) minmax(0, 1.2fr); gap: 1.5rem; align-items: center; }
.process-guide-art { min-height: 265px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; border-radius: 16px; background: linear-gradient(145deg, #f3f6ff, #fff2df); }
.process-guide-cartoon { width: min(100%, 235px); overflow: visible; animation: process-guide-float 3.2s ease-in-out infinite; }
.process-guide-art-caption { color: #263b69; font-size: .88rem; font-weight: 700; margin-top: -.2rem; }
.process-guide-spark { position: absolute; color: #e07a2c; font-size: 1.35rem; animation: process-guide-twinkle 2.1s ease-in-out infinite; }
.process-guide-spark-one { top: 22px; left: 25px; }
.process-guide-spark-two { top: 52px; right: 25px; animation-delay: .8s; }
.process-guide-progress { height: 6px; margin: 0 0 1.25rem; overflow: hidden; border-radius: 9px; background: rgba(107, 114, 128, .16); }
.process-guide-progress span { display: block; width: 12.5%; height: 100%; border-radius: inherit; background: #e07a2c; transition: width .28s ease; }
.process-guide-step h3 { margin: .85rem 0 .55rem; font-size: 1.18rem; font-weight: 700; }
.process-guide-step p { margin-bottom: .75rem; color: var(--bs-secondary-color, #6c757d); line-height: 1.6; }
.process-guide-icon { display: inline-grid; width: 2.5rem; height: 2.5rem; place-items: center; border-radius: 12px; color: #fff; background: #14213d; font-size: 1.15rem; }
.process-guide-step .process-guide-tip { display: flex; gap: .5rem; padding: .65rem .75rem; border-radius: 10px; color: #5e503e; background: #fff5e6; font-size: .86rem; }
.process-guide-tip i { flex: 0 0 auto; color: #d97828; }
.process-guide-counter { color: var(--bs-secondary-color, #6c757d); font-size: .85rem; }
.process-guide-modal .modal-footer { align-items: center; gap: .65rem; }
.process-guide-actions { display: flex; align-items: center; gap: .55rem; }
.process-guide-actions > .btn,
.process-guide-actions > .process-guide-download { min-height: 44px; border-radius: 11px; padding: .6rem .9rem; font-weight: 600; }
.process-guide-actions > [data-guide-prev] { border: 1px solid #d7deea; color: #273858; background: #f6f8fc; }
.process-guide-actions > [data-guide-prev]:hover:not(:disabled) { border-color: #aebbd0; background: #edf1f8; }
.process-guide-actions > [data-guide-prev]:disabled { opacity: .55; }
.process-guide-actions > .process-guide-download { white-space: nowrap; border-color: #e07a2c; color: #a84d13; background: #fff8f0; }
.process-guide-actions > .process-guide-download:hover { color: #fff; border-color: #c9651f; background: #c9651f; }
.process-guide-actions > [data-guide-next],
.process-guide-actions > [data-guide-finish] { border: 0; box-shadow: 0 4px 12px rgba(20, 33, 61, .18); transition: transform .16s ease, box-shadow .16s ease; }
.process-guide-actions > [data-guide-next]:hover,
.process-guide-actions > [data-guide-finish]:hover { transform: translateY(-1px); box-shadow: 0 6px 15px rgba(20, 33, 61, .23); }
.process-guide-actions > .btn:focus-visible,
.process-guide-actions > .process-guide-download:focus-visible { outline: 3px solid rgba(224, 122, 44, .38); outline-offset: 2px; }
@keyframes process-guide-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes process-guide-twinkle { 0%, 100% { opacity: .45; transform: scale(.85) rotate(-10deg); } 50% { opacity: 1; transform: scale(1.15) rotate(10deg); } }
@media (max-width: 575.98px) {
  .process-guide-modal .modal-dialog { margin: .5rem; }
  .process-guide-modal .modal-header { align-items: flex-start; }
  .process-guide-layout { grid-template-columns: 1fr; gap: 1rem; }
  .process-guide-art { min-height: 175px; }
  .process-guide-cartoon { width: 165px; }
  .process-guide-art-caption { margin-top: -.5rem; }
  .process-guide-modal .modal-footer { align-items: stretch; flex-direction: column; gap: .55rem; }
  .process-guide-modal .process-guide-counter { width: 100%; margin: 0 !important; text-align: center; }
  .process-guide-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr); width: 100%; gap: .4rem; }
  .process-guide-actions > .btn,
  .process-guide-actions > .process-guide-download { display: inline-flex; width: 100%; min-width: 0; min-height: 46px; align-items: center; justify-content: center; padding: .45rem .3rem; font-size: .8rem; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .process-guide-cartoon, .process-guide-spark { animation: none; }
  .process-guide-progress span { transition: none; }
  .process-guide-actions > [data-guide-next],
  .process-guide-actions > [data-guide-finish] { transition: none; }
  .process-guide-actions > [data-guide-next]:hover,
  .process-guide-actions > [data-guide-finish]:hover { transform: none; }
}

/* POS cart controls stay reachable on phone layouts. */
@media (max-width: 767.98px) {
  .pos-v2 { min-height: calc(100dvh - 104px); gap: 10px; }
  .pos-v2-items { min-width: 0; min-height: 0; }
  .pos-v2-cart-head { display: none; }
  .pos-v2-cart {
    flex: 1 1 auto;
    min-height: 120px;
    max-height: min(42dvh, 360px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 4px 2px;
    -webkit-overflow-scrolling: touch;
  }
  .pos-v2-cart-table { display: block; width: 100%; min-width: 0 !important; table-layout: fixed; border-collapse: separate; border-spacing: 0 7px; }
  .pos-v2-cart-table > tbody { display: block; width: 100%; }
  .pos-v2-cart-table tr:not(.pos-v2-cart-item) { display: block; }
  .pos-v2-cart-table tr:not(.pos-v2-cart-item) > td { display: block; width: 100%; }
  .pos-v2-cart-table tr.pos-v2-cart-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 116px;
    grid-template-areas: "item remove" "total qty";
    align-items: center;
    gap: 2px 8px;
    margin-bottom: 7px;
    padding: 8px;
    border: 1px solid var(--pos-border);
    border-radius: 12px;
    background: var(--pos-surface);
  }
  .pos-v2-cart-table tr.pos-v2-cart-item > td {
    width: auto !important;
    min-width: 0 !important;
    padding: 3px 2px;
    border: 0;
  }
  .pos-v2-cart-table tr.pos-v2-cart-item > td:first-child { grid-area: item; }
  .pos-v2-cart-table tr.pos-v2-cart-item > td:nth-child(2) { grid-area: qty; }
  .pos-v2-cart-table tr.pos-v2-cart-item > td:nth-child(3) { grid-area: total; text-align: left !important; white-space: nowrap; }
  .pos-v2-cart-table tr.pos-v2-cart-item > td:nth-child(3)::before { content: 'Line total: '; color: var(--pos-muted); font-size: .72rem; font-weight: 500; }
  .pos-v2-cart-table tr.pos-v2-cart-item > td:last-child { grid-area: remove; justify-self: end; padding: 0; }
  .pos-v2-cart-table .pos-cart-item-row { min-width: 0; align-items: flex-start; }
  .pos-v2-cart-table .pos-cart-item-info { min-width: 0; overflow-wrap: anywhere; }
  .pos-v2-cart-table .pos-cart-price-row { flex-wrap: wrap; gap: 4px; }
  .pos-v2-cart-table .pos-cart-chip { max-width: 100%; }
  .pos-v2-cart-table .pos-qty-control { width: 100%; min-width: 0; }
  .pos-v2-cart-table .pos-qty-control .btn { flex: 0 0 30px; width: 30px; min-width: 30px; min-height: 40px; padding: 0; }
  .pos-v2-cart-table .pos-qty-control .cart-qty-input { flex: 1 1 30px; width: 1%; min-width: 30px !important; }
  .pos-v2-cart-table .btn-remove-item { display: inline-flex; width: 40px; min-width: 40px; min-height: 40px; align-items: center; justify-content: center; padding: 0; font-size: 1rem; }
  .pos-v2-actions {
    position: sticky;
    bottom: 0;
    grid-template-columns: minmax(62px, .75fr) minmax(0, 1.8fr) 44px;
    gap: 6px;
    margin: 0 -8px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--pos-border);
    background: var(--pos-bg);
    box-shadow: 0 -8px 18px rgba(22, 35, 63, .08);
  }
  .pos-v2-actions > .pos-v2-hold,
  .pos-v2-actions > .pos-v2-complete,
  .pos-v2-actions > .pos-v2-clear {
    display: inline-flex;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 5px;
    white-space: nowrap;
    font-size: .82rem;
  }
  .pos-v2-actions > .pos-v2-clear { width: 44px; min-width: 44px; padding: 0; font-size: 1rem; }
}

/* Portrait tablets can report a CSS width just below the standard tablet
   breakpoint. Give their cart the remaining height without changing phone
   layouts. */
@media (min-width: 600px) and (max-width: 767.98px) and (min-height: 900px) and (pointer: coarse) {
  .pos-v2-items {
    min-height: 0;
  }

  .pos-v2-cart {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
  }

  .pos-v2-item-search {
    position: sticky;
    top: 72px;
    z-index: 10;
    background: var(--pos-surface);
  }

  .pos-v2-summary {
    position: sticky;
    bottom: calc(60px + env(safe-area-inset-bottom));
    z-index: 4;
    padding: 8px;
    border: 1px solid var(--pos-border);
    border-radius: 12px;
    background: var(--pos-surface);
  }
}

@media (max-width: 340px) {
  .pos-v2-cart-table tr.pos-v2-cart-item { grid-template-columns: minmax(0, 1fr) 108px; gap: 2px 5px; padding: 6px; }
  .pos-v2-actions { grid-template-columns: 58px minmax(0, 1fr) 42px; gap: 5px; }
  .pos-v2-actions > .pos-v2-clear { width: 42px; min-width: 42px; }
  .pos-v2-actions > .pos-v2-complete { font-size: .76rem; }
}

/* Keep Sales History and Activity Logs filters usable on narrow screens. */
@media (max-width: 767.98px) {
  .sales-filter-secondary,
  .activity-filter-secondary {
    flex-wrap: wrap !important;
    overflow: visible !important;
    white-space: normal;
  }
  .sales-filter-secondary > #saleStatusFilter,
  .sales-filter-secondary > #salePaymentFilter {
    flex: 1 1 calc(50% - .25rem);
    width: calc(50% - .25rem) !important;
    min-width: 0;
  }
  .sales-filter-secondary > .pos-date-range,
  .activity-filter-secondary > .pos-date-range {
    display: flex !important;
    flex: 1 1 100%;
    width: 100% !important;
    min-width: 0;
    max-width: 100%;
    flex-wrap: nowrap !important;
    gap: .35rem;
    overflow: visible;
  }
  .sales-filter-secondary > .pos-date-range .form-control,
  .activity-filter-secondary > .pos-date-range .form-control {
    flex: 1 1 0;
    width: 1%;
    min-width: 0;
  }
  .activity-filter-secondary > #logUserFilter {
    flex: 1 1 100%;
    width: 100% !important;
    max-width: none !important;
  }
}

/* Use a roomy invoice list on desktop while keeping the collection form mobile friendly. */
.modal-dialog.customer-collection-dialog {
  width: 80vw;
  max-width: 80vw;
}

/* Use the same wide layout for purchase details and the add/edit form. */
.modal-dialog.purchase-dialog {
  width: 80vw;
  max-width: 80vw;
}

/* Give the permissions editor enough room to scan and update role access. */
.modal-dialog.role-edit-dialog {
  width: 80vw;
  max-width: 80vw;
}

.role-permission-row {
  padding: .35rem .25rem;
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}
.role-permission-row:last-child { border-bottom: 0; }
.role-permission-switch { flex: 0 0 auto; padding-left: 0; }
.role-permission-switch .form-check-input { float: none; margin: 0; cursor: pointer; }
.role-permission-row .form-check-label { cursor: pointer; }

@media (max-width: 767.98px) {
  .modal-dialog.customer-collection-dialog {
    width: auto;
    max-width: none;
    margin: .5rem;
  }
  .modal-dialog.purchase-dialog {
    width: auto;
    max-width: none;
    margin: .5rem;
  }
  .modal-dialog.role-edit-dialog {
    width: auto;
    max-width: none;
    margin: .5rem;
  }
}

/* Fullscreen is an explicit POS-only mode. The sidebar stays available in
   regular POS view and on every other page. */
body.pos-fullscreen-pos .pos-sidebar,
body.pos-fullscreen-pos .pos-sidebar-backdrop {
  display: none !important;
}

body.pos-fullscreen-pos #sidebarToggle {
  display: inline-flex !important;
}

body.pos-fullscreen-pos.pos-fullscreen-sidebar-open .pos-sidebar {
  display: block !important;
}

@media (max-width: 991.98px) {
  body.pos-fullscreen-pos.pos-fullscreen-sidebar-open .pos-sidebar-backdrop {
    display: block !important;
  }
}

body.pos-fullscreen-pos .pos-shell {
  height: calc(100dvh - 64px);
  min-height: 0;
  overflow: hidden;
}

body.pos-fullscreen-pos {
  overflow: hidden;
}

body.pos-fullscreen-pos .pos-footer {
  display: none !important;
}

body.pos-fullscreen-pos .pos-main {
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.pos-fullscreen-pos .pos-main > .container-fluid {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  min-height: 0;
  height: 100%;
  padding-left: clamp(12px, 2vw, 32px) !important;
  padding-right: clamp(12px, 2vw, 32px) !important;
}

body.pos-fullscreen-pos .pos-v2 {
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
}

@media (min-width: 768px) {
  body.pos-fullscreen-pos .pos-v2 {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100%;
    min-height: 0;
  }

  body.pos-fullscreen-pos .pos-v2-items {
    align-self: stretch;
    min-height: 0;
  }

  body.pos-fullscreen-pos .pos-v2-cart {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
  }

  body.pos-fullscreen-pos .pos-v2-summary {
    top: 16px;
  }
}

@media (max-width: 767.98px) {
  body.pos-fullscreen-pos .pos-v2 {
    height: 100%;
    min-height: 0;
  }
}

/* Keep the POS item browser compact like the reference image. The dialog
   stays content-sized and only its body scrolls when the product list grows. */
#catalogModal .pos-catalog-dialog {
  width: 80vw;
  max-width: 900px;
  max-height: 80vh;
  margin: 1rem auto;
}

#catalogModal .modal-content {
  max-height: 80vh;
}

#catalogModal .modal-body {
  min-height: 0;
  max-height: calc(80vh - 4rem);
  overflow-y: auto;
}

#catalogModal .pos-catalog-view-toggle .btn { min-width: 42px; }
#catalogModal .pos-catalog-view-toggle .btn.active { background: var(--pos-fill-dark); border-color: var(--pos-fill-dark); color: #fff; }
#catalogModal .pos-product-browser { position: relative; }
#catalogModal .pos-product-side-navigation { display: none; }
#catalogModal #posProductGrid.pos-catalog-list-view { display: flex; flex-direction: column; margin-left: 0; margin-right: 0; }
#catalogModal #posProductGrid.pos-catalog-list-view > .pos-product-col { flex: 0 0 100%; width: 100%; max-width: 100%; padding-left: 0; padding-right: 0; }
#catalogModal .pos-product-browser.pos-catalog-list-view { padding-left: 44px; padding-right: 44px; }
#catalogModal .pos-product-browser.pos-catalog-list-view .pos-product-side-navigation { position: absolute; z-index: 4; top: 50%; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; transform: translateY(-50%); pointer-events: none; }
#catalogModal .pos-product-browser.pos-catalog-list-view .pos-product-side-navigation .btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 42px; padding: 0; border-radius: 9px; background: var(--pos-surface); box-shadow: 0 2px 8px rgba(16, 24, 40, .12); pointer-events: auto; }
#catalogModal .pos-product-browser.pos-catalog-list-view #posProductPagination button { display: none; }
#catalogModal .pos-catalog-list-view .pos-product-tile { flex-direction: row; align-items: center; gap: .75rem; padding: .5rem; }
#catalogModal .pos-catalog-list-view .pos-product-tile-main { flex-direction: row; align-items: center; gap: .75rem; width: auto !important; min-width: 0; }
#catalogModal .pos-catalog-list-view .pos-product-image-wrap { flex: 0 0 76px; width: 76px; height: 68px; margin-bottom: 0; }
#catalogModal .pos-catalog-list-view .pos-product-details { min-width: 0; }
#catalogModal .pos-catalog-list-view .pos-product-name { min-height: 0; }
#catalogModal .pos-catalog-list-view .pos-product-tier-toggle { flex: 0 0 auto; margin: 0 0 0 auto; }

@media (max-width: 575.98px) {
  #catalogModal .pos-catalog-dialog {
    width: 100vw;
    max-width: none;
    height: 100%;
    max-height: 100%;
    margin: 0;
  }

  #catalogModal .modal-content { height: 100%; max-height: 100%; }
  #catalogModal .modal-body { max-height: none; }
}

/* Customer Reports share one preset and date-range toolbar across both tabs. */
.customer-report-date-toolbar #customerReportPresets {
  flex-wrap: nowrap;
}

.customer-report-date-toolbar .customer-report-date-range .form-control {
  flex: 0 1 112px;
  width: 112px;
}

@media (max-width: 767.98px) {
  .customer-report-date-toolbar #customerReportPresets {
    max-width: 100%;
    overflow-x: auto;
  }
}

@media (max-width: 575.98px) {
  .customer-report-date-toolbar {
    align-items: stretch !important;
  }

  .customer-report-date-toolbar #customerReportPresets {
    width: 100%;
  }

  .customer-report-date-toolbar .customer-report-date-range {
    flex: 1 1 100%;
    width: 100%;
  }

  .customer-report-date-toolbar .customer-report-date-range .form-control {
    flex: 1 1 0;
    width: 1%;
  }
}

/* Persisted desktop sidebar collapse; mobile keeps its slide-in menu behavior. */
@media (min-width: 992px) {
  html.pos-sidebar-collapsed .pos-shell > .pos-sidebar {
    display: none !important;
  }

  html.pos-sidebar-collapsed .pos-shell > .pos-main {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
  }
}

.sales-table-footer { display:flex; justify-content:space-between; align-items:center; gap:.45rem .8rem; flex-wrap:wrap; border-top:1px solid var(--pos-border); margin-top:.25rem; padding:.4rem .35rem; }
.sales-table-footer-info { display:flex; align-items:center; gap:.45rem .8rem; flex-wrap:wrap; min-width:0; }
.sales-pagination { flex-wrap:nowrap !important; gap:2px; }
.sales-pagination .page-link { min-width:26px; min-height:26px; display:inline-flex; align-items:center; justify-content:center; padding:.15rem .38rem; border-radius:5px !important; font-size:.76rem; line-height:1.15; }
.sales-pagination-gap .page-link { border-color:transparent; background:transparent; }
@media (max-width:575.98px) {
  .sales-table-footer { justify-content:center; }
  .sales-table-footer-info { flex:1 1 100%; justify-content:center; }
  .sales-pagination .page-link { min-width:25px; min-height:25px; padding:.12rem .32rem; }
}

/* Scannable barcode previews and printable product labels. */
.barcode-label-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:.75rem; }
.barcode-label { min-width:0; padding:.75rem; border:1px solid var(--pos-border); border-radius:8px; background:#fff; text-align:center; }
.barcode-label-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600; }
.barcode-label-code { margin-top:.25rem; font-family:var(--font-mono); font-size:.78rem; }
.barcode-label-image { display:block; width:100%; height:48px; margin:.35rem auto 0; background:#fff; }
.barcode-label-image rect { fill:#000; }
.barcode-inline { display:flex; align-items:center; gap:.5rem; min-width:max-content; white-space:nowrap; }
.barcode-inline-image { display:block; flex:0 0 150px; width:150px; height:32px; background:#fff; }
.barcode-inline-image rect { fill:#000; }
.barcode-inline-value { font-family:var(--font-mono); font-size:.8rem; white-space:nowrap; }
@media print {
  body.printing-product-barcodes * { visibility:hidden !important; }
  body.printing-product-barcodes #barcodePrintArea,
  body.printing-product-barcodes #barcodePrintArea * { visibility:visible !important; }
  body.printing-product-barcodes #barcodePrintArea {
    position:absolute; inset:0 auto auto 0; display:grid !important;
    grid-template-columns:repeat(3,55mm); gap:3mm; width:174mm; padding:0;
  }
  body.printing-product-barcodes .barcode-label {
    width:55mm; height:28mm; padding:2mm; border:1px dashed #aaa;
    border-radius:0; break-inside:avoid; page-break-inside:avoid; color:#000;
  }
  body.printing-product-barcodes .barcode-label-name { font-size:9pt; }
  body.printing-product-barcodes .barcode-label-image { height:14mm; margin:1mm auto 0; }
  body.printing-product-barcodes .barcode-label-code { margin-top:0; font-size:8pt; }
  body.printing-product-barcodes #receiptModal { display:none !important; }
}

