/* ==========================================================================
   MyDukaan — Components, POS Terminal, Modals & Responsive Layouts
   Crafted with human precision for real-world retail store operations.
   ========================================================================== */

/* Forms & Clean Input System */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--primary-light);
}

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

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

.barcode-input-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.barcode-input-group .form-input {
  flex: 1 1 160px;
  min-width: 0;
}

.khata-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.khata-customer-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 220px;
  min-width: 0;
}

.khata-card-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-left: auto;
}

.khata-balance-block {
  text-align: right;
  min-width: 90px;
}

.khata-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

/* ==========================================================================
   POS TERMINAL LAYOUT & HIGH-SPEED BILLING
   ========================================================================== */
.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 20px;
  align-items: start;
}

.pos-layout > * {
  min-width: 0;
}

.pos-catalog-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
}

.pos-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.pos-search-input-wrap {
  flex: 1 1 180px;
  min-width: 0;
  position: relative;
}

.pos-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.pos-search-input {
  width: 100%;
  padding-left: 38px;
  padding-right: 14px;
  height: 42px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
}

.category-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  transition: all 0.15s;
  cursor: pointer;
}

.cat-chip:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.cat-chip.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  font-weight: 600;
}

/* POS Products Grid */
.pos-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 165px), 1fr));
  gap: 12px;
}

.pos-prod-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  min-width: 0;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, background-color 0.12s;
  display: flex;
  flex-direction: column;
  position: relative;
  user-select: none;
}

.pos-prod-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
  background-color: var(--bg-card-hover);
}

.pos-prod-card:active {
  transform: scale(0.98);
}

.pos-prod-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.pos-prod-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.pos-prod-sku {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.pos-prod-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 4px;
  min-height: 34px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pos-prod-mrp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.pos-prod-mrp {
  color: var(--text-muted);
  text-decoration: line-through;
}

.pos-prod-save {
  color: var(--success);
  font-weight: 600;
  font-size: 10px;
}

.pos-prod-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
}

.pos-prod-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.pos-prod-stock {
  font-size: 11px;
  font-weight: 500;
}

/* POS Cart / Register Panel */
.pos-cart-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
  max-height: calc(100vh - var(--topbar-h) - 24px);
  max-height: calc(100dvh - var(--topbar-h) - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  box-shadow: var(--shadow-sm);
}

.pos-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.pos-cart-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.pos-cart-header-actions {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

.pos-cart-items-list {
  flex: 0 1 auto;
  overflow-y: auto;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 76px;
  max-height: 205px;
}

.cart-item-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px 9px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.cart-item-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.cart-item-info {
  flex: 1 1 85px;
  min-width: 0;
}

.cart-item-name {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.cart-item-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.cart-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-input);
  padding: 2px 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.cart-qty-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-primary);
  border-radius: 3px;
  background: var(--bg-card);
  transition: background-color 0.1s;
}

.cart-qty-btn:hover {
  background: var(--bg-elevated);
}

.cart-qty-val {
  font-size: 12px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.cart-qty-input {
  width: 44px;
  height: 22px;
  padding: 0 3px;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--text-primary);
  outline: none;
  -moz-appearance: textfield;
}

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

.cart-qty-input:focus {
  border-color: var(--primary);
  background: var(--bg-surface);
}

.cart-weight-toggle {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  transition: all 0.12s ease;
}

.cart-weight-toggle:hover,
.cart-weight-toggle.active {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

.weight-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 4px;
  border-top: 1px dashed var(--border-subtle);
}

.weight-chip-btn {
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all 0.12s ease;
}

.weight-chip-btn:hover {
  border-color: var(--primary);
  color: var(--text-primary);
}

.weight-chip-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

.voice-pulse-active {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.28);
  animation: voicePulseRing 1.3s ease-in-out infinite;
}

@keyframes voicePulseRing {
  0%, 100% { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25); }
  50% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0.45); }
}

.cart-item-total {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 50px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cart-item-del {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
}

.cart-item-del:hover {
  color: var(--danger);
  background: var(--danger-light);
}

/* Cart Financial Summary & Checkout */
.pos-cart-summary {
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pos-checkout-sticky {
  position: sticky;
  bottom: -12px;
  background: var(--bg-surface);
  padding: 8px 0 2px;
  margin-top: 4px;
  border-top: 1px solid var(--border-subtle);
  z-index: 3;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.summary-line.total {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  padding-top: 6px;
  border-top: 1px dashed var(--border-medium);
  margin-top: 2px;
}

/* Fast Payment Mode Selector */
.payment-modes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin: 6px 0 4px;
}

.pm-btn {
  padding: 6px 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.12s;
  cursor: pointer;
}

.pm-btn:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.pm-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: #60A5FA;
}

/* Fast Cash Denominations */
.cash-tender-row {
  display: flex;
  gap: 5px;
  margin: 5px 0;
  flex-wrap: wrap;
}

.cash-note-chip {
  flex: 1;
  padding: 5px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.12s;
}

.cash-note-chip:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
}

/* Mobile Sticky POS Checkout Bar */
.mobile-pos-sticky-bar {
  display: none;
}

/* ==========================================================================
   BARCODE CAMERA SCANNER MODAL
   ========================================================================== */
.scanner-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  z-index: 10030;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.scanner-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.scanner-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.scanner-viewport-wrap {
  position: relative;
  width: 100%;
  height: 260px;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#html5-qr-reader,
#html5-qr-reader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

#scanner-video-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-target-reticle {
  position: absolute;
  width: 220px;
  height: 130px;
  border: 2px solid rgba(59, 130, 246, 0.9);
  border-radius: 10px;
  box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.scanner-laser {
  width: 100%;
  height: 2px;
  background: #EF4444;
  box-shadow: 0 0 8px #EF4444;
  animation: scanLaserAnim 1.8s ease-in-out infinite alternate;
}

@keyframes scanLaserAnim {
  0% { transform: translateY(-50px); }
  100% { transform: translateY(50px); }
}

.scanned-detection-card {
  padding: 12px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================================
   THERMAL RECEIPT & PRINT VIEW
   ========================================================================== */
.thermal-receipt-modal {
  max-width: 380px;
  background: #FFFFFF;
  color: #111827;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.thermal-receipt-body {
  padding: 14px;
  background: #FFFFFF;
  color: #000000;
  font-size: 11.5px;
  line-height: 1.4;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-sizing: border-box;
}

.thermal-shop-name {
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.thermal-divider {
  border-top: 1px dashed #71717A;
  margin: 10px 0;
}

.thermal-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.thermal-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 800;
  margin-top: 6px;
}

/* ==========================================================================
   AI COPILOT MODAL & CHAT INTERFACE
   ========================================================================== */
.ai-modal-backdrop {
  z-index: 10025;
}

.ai-chat-modal-window {
  max-width: 600px;
  height: min(620px, 88vh);
  display: flex;
  flex-direction: column;
}

.ai-modal-header {
  padding: 12px 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 200px;
}

.ai-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.ai-chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-surface);
}

.ai-msg-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.ai-msg-row.user {
  flex-direction: row-reverse;
}

.ai-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  flex-shrink: 0;
}

.ai-msg-row.user .ai-msg-avatar {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.ai-msg-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.5;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-msg-row.user .ai-msg-bubble {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  border-bottom-right-radius: 4px;
}

.ai-prompt-chips-row {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}

.ai-prompt-chips-row::-webkit-scrollbar {
  display: none;
}

.ai-input-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-input);
  display: flex;
  gap: 8px;
  align-items: center;
}

.ai-textarea {
  flex: 1;
  resize: none;
  height: 38px;
  padding: 8px 12px;
  font-size: 13px;
}

/* ==========================================================================
   NOTIFICATION CENTER & DROPDOWN
   ========================================================================== */
.notification-popover {
  position: absolute;
  top: calc(var(--topbar-h) + 6px);
  right: 20px;
  width: 340px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideUp 0.15s ease-out;
}

.notification-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
}

.notification-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.notification-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: background-color 0.12s;
  cursor: pointer;
}

.notification-item:hover {
  background-color: var(--bg-card);
}

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

/* ==========================================================================
   RESPONSIVE DESIGN RULES FOR MOBILE & TABLETS
   ========================================================================== */
@media (max-width: 900px) {
  .pos-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .pos-cart-panel {
    position: fixed;
    top: auto;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    max-height: calc(100vh - 118px);
    max-height: calc(100dvh - 118px);
    border-radius: 16px 16px 0 0;
    z-index: 9985;
    transform: translateY(115%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
  }

  .pos-cart-panel.open-mobile {
    transform: translateY(0);
  }

  .pos-cart-items-list {
    min-height: 54px;
    max-height: 155px;
  }

  .receipt-modal-footer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    padding: 10px 14px !important;
    flex-shrink: 0;
  }

  .receipt-modal-footer > .btn {
    flex: 0 0 auto !important;
  }

  .mobile-pos-sticky-bar {
    display: none;
    position: fixed;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    height: 48px;
    background: var(--primary);
    color: #FFFFFF;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 9980;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.3);
  }

  .mobile-pos-sticky-bar.pos-active {
    display: flex;
  }

  .form-row-2, .form-row-3 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

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

  .ai-modal-backdrop {
    padding: 0;
  }

  .ai-chat-modal-window {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    max-width: 100%;
    border-radius: 0;
  }

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

  .pos-prod-card {
    padding: 10px 8px;
  }

  .pos-prod-title {
    font-size: 12px;
  }

  .pos-prod-price {
    font-size: 13.5px;
  }

  .notification-popover {
    position: fixed;
    left: 10px;
    right: 10px;
    top: 56px;
    width: auto;
    max-width: none;
  }

  .khata-card-row {
    align-items: flex-start;
  }

  .khata-card-right {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px dashed var(--border-subtle);
  }

  .khata-balance-block {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .scanner-modal-backdrop {
    padding: 8px;
  }

  .scanner-viewport-wrap {
    height: 210px;
  }

  #html5-qr-reader {
    min-height: 200px !important;
  }

  .scanner-target-reticle {
    width: 82%;
    max-width: 260px;
    height: 112px;
  }

  .ai-msg-bubble {
    max-width: 88%;
  }
}

@media (max-width: 440px) {
  .cart-item-row {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .cart-item-info {
    flex: 1 1 calc(100% - 30px);
  }
}

@media (max-width: 350px) {
  .pos-products-grid {
    grid-template-columns: 1fr;
  }
}

/* Product Catalog Cards Grid & Visual Barcode Stickers */
.catalog-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 14px;
}

.catalog-sku-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.catalog-sku-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.catalog-barcode-strip {
  background: #FFFFFF;
  color: #111827;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 6px 8px 4px;
  text-align: center;
}

/* Print Rules for 80mm Receipts & Wide A4 Reports */
@media print {
  @page {
    margin: 10mm;
  }
  html, body {
    background: #FFFFFF !important;
    color: #111827 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }
  .app-layout,
  .sidebar-backdrop,
  .modal-backdrop,
  .scanner-modal-backdrop,
  .mobile-bottom-nav,
  .mobile-pos-sticky-bar,
  .toast-container {
    display: none !important;
  }
  #thermal-printable-area {
    display: block !important;
    position: static !important;
    width: 80mm;
    margin: 0 auto !important;
    padding: 4mm !important;
    background: #FFFFFF !important;
    color: #000000 !important;
  }
  #thermal-printable-area.print-wide {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 6mm !important;
  }
  #thermal-printable-area table {
    page-break-inside: auto;
  }
  #thermal-printable-area tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }
}
