/* 
* Responsive styles for Modluk ERP 
* Targeted for screens 1024px and below
*/

@media (max-width: 1024px) {
  /* ==========================================
    GLOBAL RESPONSIVE FIXES
    ========================================== */

  /* Prevent horizontal scrolling on the entire page */
  html,
  body {
    overflow-x: clip !important;
    width: 100%;
    max-width: 100vw;
    position: relative;
  }

  /* Deep overflow wrappers to trap any overflowing children */
  .erp-container,
  .erp-main,
  .erp-content {
    max-width: 100vw !important;
    overflow-x: clip !important;
    box-sizing: border-box !important;
  }

  /* Fix box model sizing so paddings don't exceed widths */
  *,
  *::before,
  *::after {
    box-sizing: border-box !important;
  }

  /* Catch specific elements that force widths */
  .select2-container,
  canvas,
  iframe,
  img,
  video {
    max-width: 100% !important;
  }

  /* Ensure footer doesn't bleed out */
  .erp-footer {
    width: 100% !important;
    max-width: 100vw !important;
    left: 0 !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    flex-direction: column !important;
    text-align: center !important;
  }

  /* Make sure large tables become scrollable internally instead of breaking the page */
  table,
  .wp-list-table,
  .erp-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  /* Allow scrolling on mobile by overriding the guest overflow: hidden rule */
  html,
  body:not(.logged-in) {
    overflow-y: auto !important;
    height: auto !important;
  }

  /* Override 70px padding-bottom on main container for guest view to fix spacing */
  body:not(.logged-in) .erp-main {
    padding-bottom: 0 !important;
  }

  /* ==========================================
    LOGIN GATEWAY MOBILE LAYOUT
    ========================================== */

  .erp-login-split-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* DO NOT USE CENTER when content might overflow */
    min-height: 100vh;
    height: auto;
    overflow-y: visible;
    /* Let the body handle the scroll */
    background-color: #050811;
    padding: 40px 24px;
  }

  /* Use display: contents to flatten the DOM structure for flex ordering */
  .erp-login-visual-panel {
    display: contents !important;
  }

  .erp-login-visual-content {
    display: contents !important;
  }

  /* 1. Logo at the top */
  .erp-login-visual-logo {
    order: 1;
    margin: 0 0 32px 0;
  }

  /* 2. Login Form in the middle */
  .erp-login-form-panel {
    order: 2;
    width: 100%;
    padding: 0;
    height: auto;
    background: transparent;
  }

  /* 3. Contact & Social at the bottom */
  .erp-login-footer-info {
    order: 3;
    margin-top: 40px;
    padding-top: 32px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  /* Hide unwanted elements on mobile */
  .erp-login-visual-title,
  .erp-login-visual-desc,
  .erp-login-visual-stats,
  .erp-login-visual-panel::before,
  .erp-login-visual-panel::after,
  .erp-login-visual-glow {
    display: none !important;
  }

  /* Contact Links styling */
  .erp-login-footer-info>div:first-child {
    flex-direction: column;
    gap: 20px;
    width: 100%;
    align-items: center;
    margin-bottom: 32px;
  }

  .erp-login-footer-info>div:first-child>div {
    width: 100%;
    justify-content: center;
  }

  /* Text align inside contact info */
  .erp-login-footer-info>div:first-child>div>div:last-child {
    text-align: center;
  }

  /* Social Links wrapper */
  .erp-login-footer-info>div:last-child {
    justify-content: center;
    width: 100%;
  }

  /* Adjust form width for better viewing on tablets */
  .erp-login-card {
    max-width: 440px;
    margin: 0 auto;
  }

  .erp-login-title {
    text-align: center;
  }

  .erp-login-subtitle {
    text-align: center;
  }

  .erp-sidebar-close-btn {
    display: none;
  }

  /* ==========================================
    DASHBOARD (LOGGED-IN) MOBILE LAYOUT
    ========================================== */

  /* 1. Sidebar */
  .erp-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    width: 280px;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .erp-sidebar .erp-brand {
    flex-shrink: 0 !important;
  }

  .erp-sidebar .erp-menu {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    min-height: 0 !important;
  }

  .erp-sidebar .erp-sidebar-footer {
    flex-shrink: 0 !important;
    margin-top: auto !important;
    padding-bottom: max(16px, calc(16px + env(safe-area-inset-bottom, 0px))) !important;
    box-sizing: border-box !important;
  }

  .erp-sidebar.active {
    transform: translateX(0);
  }

  .erp-sidebar-close-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
  }

  .erp-sidebar-close-btn:hover {
    color: var(--color-danger);
    background: rgba(239, 68, 68, 0.1);
  }

  /* 2. Main Content Area */
  .erp-main {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .erp-content {
    padding: 16px;
  }

  /* 3. Header */
  .erp-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 9999 !important;
    background: var(--bg-secondary, #0f1626) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    padding: 0 16px !important;
    gap: 12px !important;
  }

  #erpSidebarTrigger {
    display: flex !important;
  }

  .erp-mobile-header-logo {
    display: flex !important;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    margin-right: auto;
    margin-left: 8px;
  }

  .erp-header-support,
  .erp-header-outlet,
  .erp-pos-header-btn,
  .erp-admin-header-btn,
  button[aria-label="View Alerts"] {
    display: none !important;
    /* Hide to save space on mobile */
  }

  /* 4. Dashboard Widgets & Filters (Premium Mobile UI) */
  .erp-dashboard-filters {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 20px !important;
    background: rgba(255, 255, 255, 0.02);
    padding: 20px !important;
    border-radius: 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }

  .erp-dashboard-filters .filter-group {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 100% !important;
  }

  .erp-dashboard-filters .filter-group label {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
    margin: 0 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
  }

  /* Target the inline flex container for the Date icon */
  .erp-dashboard-filters .filter-group>div {
    width: 100% !important;
  }

  .erp-dashboard-filters input,
  .erp-dashboard-filters select,
  .select2-container {
    width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Make stats grid 2 columns for tablets/large phones */
  .erp-metrics-grid,
  .erp-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .erp-performance-split {
    flex-direction: column !important;
  }

  .erp-chart-panel,
  .erp-pl-summary-panel,
  .erp-login-history-panel {
    width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box;
  }

  /* Full width Daterangepicker popup on mobile to prevent date text from breaking */
  .daterangepicker {
    width: calc(100vw - 32px) !important;
    left: 16px !important;
    right: auto !important;
    box-sizing: border-box !important;
  }

  .daterangepicker .ranges ul {
    width: 100% !important;
  }

  .daterangepicker .drp-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }

  .daterangepicker .drp-selected {
    width: 100%;
    text-align: center;
    white-space: nowrap;
    padding-right: 0 !important;
  }

  .daterangepicker .drp-buttons .btn {
    width: 100%;
    margin-left: 0 !important;
  }
}

/* ==========================================
  POS SYSTEM MOBILE LAYOUT
  ========================================== */
@media (max-width: 992px) {

  /* Hide Desktop Header Elements */
  .pos-desktop-contact,
  .pos-desktop-outlet-name {
    display: none !important;
  }

  /* Show Mobile Header Elements */
  .pos-mobile-header-left {
    display: flex !important;
  }

  /* Sidebar Drawer */
  .pos-sidebar {
    position: fixed !important;
    top: 0;
    left: -100%;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    z-index: 10000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.5);
    width: 260px !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .pos-sidebar .pos-logo {
    flex-shrink: 0 !important;
  }

  .pos-sidebar .pos-nav {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    min-height: 0 !important;
  }

  .pos-sidebar .pos-user-profile {
    flex-shrink: 0 !important;
    margin-top: auto !important;
    padding-bottom: max(20px, calc(15px + env(safe-area-inset-bottom, 0px))) !important;
    box-sizing: border-box !important;
  }

  .pos-sidebar.mobile-active {
    left: 0 !important;
  }

  .pos-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 15, 25, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  /* Main Workspace Layout */
  .pos-container {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
  }

  .pos-main {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
    flex: 1 !important;
  }

  .pos-header {
    background: var(--pos-sidebar-bg, #0f172a) !important;
    padding: 10px 16px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    transition: all 0.3s ease !important;
  }

  .pos-header.is-sticky {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 99999 !important;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.6) !important;
    background: var(--pos-sidebar-bg, #0f172a) !important;
  }

  .pos-workspace {
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    padding: 15px !important;
    gap: 15px !important;
    height: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Make POS category filters horizontally scrollable */
  .pos-category-filters {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    padding-bottom: 8px !important;
    -webkit-overflow-scrolling: touch;
  }

  .pos-category-filters::-webkit-scrollbar {
    height: 4px;
  }

  /* Search Fields Stacking */
  .pos-search-row {
    flex-direction: column !important;
  }

  .pos-search-row>div {
    flex: none !important;
    width: 100% !important;
  }

  /* Cart Table Mobile Card Layout */
  .cart-table-wrapper table {
    display: block !important;
    width: 100% !important;
    border: none !important;
  }

  .cart-table-wrapper thead {
    display: none !important;
  }

  .cart-table-wrapper tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .cart-table-wrapper tr:not(.pos-empty-cart-row) {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "name name"
      "mrp mrp"
      "sale sale"
      "disc disc"
      "qty net";
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
    padding: 16px 16px 20px 16px !important;
    gap: 8px 12px !important;
    position: relative;
    align-items: center;
    margin-bottom: 0 !important;
  }

  .cart-table-wrapper td {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    border: none !important;
    padding: 0 !important;
    text-align: right !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  /* Cart data labels */
  .cart-table-wrapper td::before {
    content: attr(data-label);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
    text-transform: uppercase;
    text-align: left;
    margin-right: auto;
  }

  /* Hide # Cell */
  .cart-table-wrapper td:nth-child(1) {
    display: none !important;
  }

  /* Product Name Cell - Left Aligned */
  .cart-table-wrapper td:nth-child(2) {
    grid-area: name;
    border-bottom: none !important;
    padding: 0 35px 8px 0 !important;
    justify-content: flex-start !important;
    text-align: left !important;
    align-items: flex-start !important;
  }

  .cart-table-wrapper td:nth-child(2)::before {
    display: none;
  }

  .cart-table-wrapper td:nth-child(2) .product-cell {
    width: 100% !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    text-align: left !important;
  }

  .cart-table-wrapper td:nth-child(2) .product-cell>div {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
    width: 100% !important;
  }

  .cart-table-wrapper td:nth-child(2) .product-name {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #fff !important;
    text-align: left !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .cart-table-wrapper td:nth-child(2) .product-cell>div>div:nth-child(2) {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 6px !important;
    text-align: left !important;
  }

  .cart-table-wrapper td:nth-child(2) .product-cell>div>div:nth-child(3) {
    display: inline-block;
    margin-left: 6px;
    margin-top: 6px !important;
    text-align: left !important;
  }

  /* Qty Cell */
  .cart-table-wrapper td:nth-child(3) {
    grid-area: qty;
    justify-content: flex-start !important;
    border-top: none !important;
    padding-top: 6px !important;
    margin-top: 0 !important;
  }

  .cart-table-wrapper td:nth-child(3)::before {
    display: none !important;
  }

  .cart-table-wrapper td:nth-child(3) .qty-control {
    margin: 0 !important;
  }

  /* MRP */
  .cart-table-wrapper td:nth-child(4) {
    grid-area: mrp;
    font-size: 13px;
  }

  /* Sale Price */
  .cart-table-wrapper td:nth-child(5) {
    grid-area: sale;
    font-size: 13px;
  }

  /* Discount - Straight Continuous Full Width Dashed Line */
  .cart-table-wrapper td:nth-child(6) {
    grid-area: disc;
    font-size: 13px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.15) !important;
    padding-bottom: 12px !important;
    margin-bottom: 4px !important;
    width: 100% !important;
  }

  .cart-table-wrapper td:nth-child(6)>div {
    justify-content: flex-end;
  }

  /* Net Amount */
  .cart-table-wrapper td:nth-child(7) {
    grid-area: net;
    justify-content: flex-end !important;
    border-top: none !important;
    padding-top: 6px !important;
    margin-top: 0 !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #10b981 !important;
  }

  .cart-table-wrapper td:nth-child(7)::before {
    display: none !important;
  }

  /* Delete Button Cell */
  .cart-table-wrapper td:last-child {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 0 !important;
    border: none !important;
  }

  .cart-table-wrapper td:last-child::before {
    display: none;
  }

  .cart-table-wrapper td:last-child .btn-remove {
    background: transparent !important;
    color: #ef4444 !important;
    border-radius: 0 !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
  }

  /* Empty Cart Layout Fix */
  .cart-table-wrapper tr.pos-empty-cart-row {
    display: none !important;
  }

  /* Input Styling */
  .cart-table-wrapper .qty-btn,
  .cart-table-wrapper .qty-input,
  .cart-table-wrapper .discount-input {
    background: transparent !important;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: var(--pos-text) !important;
  }

  /* Coupon and Credit Note Blocks */
  .pos-coupon-credit-wrapper {
    flex-direction: column !important;
    gap: 12px !important;
    margin: 12px 0 !important;
  }

  .pos-coupon-credit-wrapper .pos-action-block {
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  /* Cart Actions Mobile Layout */
  .cart-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 15px !important;
    padding: 0 !important;
  }

  .cart-actions>div:first-child {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  .cart-actions .btn-action,
  .cart-actions .btn-clear-cart {
    flex: 1 1 calc(50% - 5px) !important;
    justify-content: center !important;
    padding: 12px 10px !important;
    text-align: center;
    box-sizing: border-box !important;
  }

  .cart-actions .adjust-total-wrapper {
    width: 100% !important;
    justify-content: space-between !important;
    background: rgba(255, 255, 255, 0.02) !important;
    padding: 12px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-sizing: border-box !important;
  }

  /* Return Modal Mobile Layout */
  .pos-modal-title {
    font-size: 16px !important;
  }

  /* Hold Orders Mobile Layout */
  .hold-order-item {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
  }

  .hold-order-meta {
    flex-direction: column !important;
    gap: 6px !important;
  }

  .hold-order-actions {
    justify-content: flex-end !important;
  }

  .hold-order-actions button {
    flex: 1 !important;
    justify-content: center !important;
  }

  /* Coupons Mobile Layout */
  .coupon-item {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .coupon-header {
    flex-wrap: wrap !important;
  }

  .coupon-actions button {
    width: 100% !important;
  }

  .return-modal-deductions-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
  }

  .return-modal-net-summary {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 12px !important;
  }

  .return-modal-net-summary>div {
    text-align: center !important;
  }

  .return-modal-footer,
  .exchange-modal-footer,
  .credit-note-modal-footer {
    flex-direction: column !important;
    gap: 10px !important;
  }

  .return-modal-footer button,
  .exchange-modal-footer button,
  .credit-note-modal-footer button {
    width: 100% !important;
  }

  .return-modal-payment-methods {
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }

  .return-modal-payment-methods label {
    flex: 1 !important;
    justify-content: center !important;
    padding: 8px 6px !important;
    font-size: 13px !important;
  }

  /* Thin Custom Scrollbars for Mobile Modals */
  .pos-modal-body,
  .return-modal-table-wrapper {
    scrollbar-width: thin !important;
    /* Firefox */
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent !important;
  }

  .pos-modal-body::-webkit-scrollbar,
  .return-modal-table-wrapper::-webkit-scrollbar {
    width: 4px !important;
    height: 4px !important;
  }

  .pos-modal-body::-webkit-scrollbar-track,
  .return-modal-table-wrapper::-webkit-scrollbar-track {
    background: transparent !important;
  }

  .pos-modal-body::-webkit-scrollbar-thumb,
  .return-modal-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px !important;
  }
}

/* ==========================================
  POS GLOBAL OVERRIDES (Requested here)
  ========================================== */
.pos-search-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  font-size: 12px;
  color: var(--pos-text-muted, #64748b);
  align-items: center;
}

.pos-search-result-meta .meta-stocks {
  display: flex;
  gap: 12px;
}

.pos-search-result-meta i {
  margin-right: 4px;
}

.meta-wh i {
  color: #3b82f6;
}

.meta-wh strong {
  color: #60a5fa;
}

.meta-out i {
  color: #10b981;
}

.meta-out strong {
  color: #34d399;
}

.erp-mobile-only {
  display: flex !important;
}

.erp-mobile-only.erp-sidebar-close-btn {
  display: flex !important;
}

/* or block */

/* Square table headers, rows, and cells in all POS listing modules */
.pos-orders-wrapper table,
.pos-orders-wrapper thead,
.pos-orders-wrapper tbody,
.pos-orders-wrapper tr,
.pos-orders-wrapper th,
.pos-orders-wrapper td,
.pos-orders-table,
.pos-orders-table th,
.pos-orders-table td,
th:first-child,
th:last-child,
td:first-child,
td:last-child {
  border-radius: 0 !important;
}

/* Desktop View (> 992px): Header controls aligned on TOP RIGHT in ONE line with Title */
@media (min-width: 993px) {
  .pos-orders-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 24px !important;
    gap: 20px !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
  }

  .pos-orders-header>div:first-child,
  .pos-orders-header>h2:first-child {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 15px !important;
    width: auto !important;
    flex: 0 1 auto !important;
    margin: 0 !important;
  }

  .pos-orders-title {
    display: none !important;
  }

  .pos-returns-summary,
  .pos-orders-summary,
  .pos-exchange-summary,
  .pos-cn-summary {
    width: auto !important;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
  }

  .pos-orders-controls,
  .pos-orders-header>div:last-child {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    width: auto !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
  }

  .pos-show-limit,
  .pos-orders-controls>div:first-child,
  .pos-orders-header>div:last-child>div:first-child {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  .pos-show-limit>span,
  .pos-orders-controls>div:first-child>span,
  .pos-orders-header>div:last-child>div:first-child>span {
    display: inline-block !important;
    font-size: 13px !important;
    color: var(--pos-text-muted) !important;
  }

  .pos-orders-controls form,
  .pos-orders-header>div:last-child form,
  .pos-orders-header form {
    display: flex !important;
    position: relative !important;
    align-items: center !important;
    width: auto !important;
    min-width: 200px !important;
    margin: 0 !important;
  }

  .pos-orders-controls form input,
  .pos-orders-header form input[type='search'],
  .pos-orders-header form input[type='text'],
  .pos-orders-header form input {
    width: 220px !important;
    min-width: 180px !important;
    height: 34px !important;
    font-size: 13px !important;
  }

  /* Desktop POS Coupon & Credit Note Horizontal Layout */
  .pos-coupon-credit-wrapper {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
    gap: 16px !important;
    width: 100% !important;
    margin: 16px 0 !important;
  }

  #pos-coupon-block,
  #pos-credit-note-block {
    width: 360px !important;
    max-width: 50% !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
  }

  /* Desktop Cart Actions Horizontal Row */
  .cart-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    width: 100% !important;
  }
}

@media (max-width: 992px) {
  .pos-left {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .pos-search-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .pos-coupon-credit-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 0 14px 0 !important;
  }

  .pos-right,
  .cart-panel,
  .cart-table-wrapper table {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }

  .summary-panel {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 16px 16px 20px 16px !important;
    margin: 0 0 24px 0 !important;
  }

  .cart-table-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 0 16px 0 !important;
  }

  .pos-action-block,
  #pos-coupon-block,
  #pos-credit-note-block {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    border-radius: 8px !important;
  }

  /* Consistent 8px border-radius across all POS search fields, cards, and buttons */
  .input-wrapper input,
  .pos-search-row input,
  #pos-barcode-search,
  #pos-customer-search,
  .cart-table-wrapper tr:not(.pos-empty-cart-row),
  .btn-action,
  .btn-clear-cart,
  .btn-complete,
  .cart-actions button,
  .btn-payment,
  .adjust-total-wrapper,
  #pos-adjust-amount,
  .custom-select,
  select {
    border-radius: 8px !important;
  }

  #pos-coupon-block>div:nth-child(2),
  #pos-credit-note-block>div:nth-child(2) {
    display: flex !important;
    width: 100% !important;
    gap: 8px !important;
  }

  #pos-coupon-block input,
  #pos-credit-note-block input {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .pos-orders-wrapper {
    padding: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  .pos-orders-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .pos-orders-header>div:first-child,
  .pos-orders-header>h2:first-child {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .pos-orders-controls,
  .pos-orders-header>div:last-child {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .pos-show-limit,
  .pos-orders-controls>div:first-child,
  .pos-orders-header>div:last-child>div:first-child {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
  }

  .pos-show-limit>span,
  .pos-orders-controls>div:first-child>span,
  .pos-orders-header>div:last-child>div:first-child>span {
    display: none !important;
  }

  .pos-orders-controls form,
  .pos-orders-header>div:last-child form,
  .pos-orders-header form {
    display: flex !important;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    position: relative !important;
    align-items: center !important;
  }

  .pos-orders-controls form input,
  .pos-orders-header form input[type='search'],
  .pos-orders-header form input[type='text'],
  .pos-orders-header form input {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    height: 34px !important;
    font-size: 12px !important;
  }

  .pos-returns-summary {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .pos-returns-divider {
    display: none !important;
  }

  .pos-coupons-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  .pos-coupons-grid>div {
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  .pos-mapped-skus-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  .pos-mapped-skus-header>div:first-child {
    max-width: 100%;
  }

  .pos-mapped-skus-header>div:last-child,
  #pos-search-mapped-skus {
    width: 100% !important;
    max-width: 100%;
  }

  .pos-sku-action-row {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .pos-sku-action-row button {
    width: 100% !important;
  }

  .pos-coupons-wrapper {
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .pos-table-wrapper {
    max-height: none !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Inventory & Sales Module Mobile Fixes */
  .inventory-table-wrapper,
  .sales-table-wrapper {
    overflow-x: auto !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch;
    display: block !important;
  }

  .inventory-table,
  .sales-table {
    display: table !important;
  }

  .inventory-search-form,
  .sales-search-form {
    width: 100% !important;
  }

  .erp-tabs-wrapper {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .filter-form-wrapper {
    width: 100% !important;
  }

  #inventory-filter-form,
  #sales-filter-form {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  #inventory-filter-form>div,
  #sales-filter-form>div {
    width: 100% !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  #inventory-filter-form select,
  #sales-filter-form select,
  #sales-filter-form input.erp-datepicker {
    flex: 1 !important;
    width: 100% !important;
    min-width: 100px !important;
  }

  .erp-actions-right {
    margin-left: 0 !important;
    width: 100% !important;
  }
}