/* ==========================================================================
   NEXA Accounting — Mobile Web App & PWA Interface
   ========================================================================== */

/* Display switching: Default is desktop layout on desktop screens, mobile app on mobile screens */
#nexaMobileApp {
  display: none;
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body:not(.force-desktop-view) .app {
    display: none !important;
  }
  body:not(.force-desktop-view) .side,
  body:not(.force-desktop-view) .main {
    display: none !important;
  }
  body:not(.force-desktop-view) #nexaMobileApp {
    display: flex;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  #nexaMobileApp * {
    box-sizing: border-box !important;
  }
  #nexaMobileApp table {
    min-width: 0 !important;
    width: 100% !important;
  }
}

body.force-mobile-view html,
body.force-mobile-view {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
}

body.force-mobile-view .app,
body.force-mobile-view .side,
body.force-mobile-view .main {
  display: none !important;
}

body.force-mobile-view #nexaMobileApp {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

/* Base Mobile Container */
#nexaMobileApp {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  background: #f4f7fb;
  color: #152238;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Mobile Header */
.nexa-m-header {
  position: sticky;
  top: 0;
  z-index: 120;
  background: linear-gradient(135deg, #101c33 0%, #17284a 100%);
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(16, 28, 51, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
  width: 100%;
}

.nexa-m-brand-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.nexa-m-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f73ea, #3157d5);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 21px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(49, 87, 213, 0.38);
  flex-shrink: 0;
}

.nexa-m-brand-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nexa-m-app-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
  line-height: 1.2;
}

.nexa-m-company-pill {
  font-size: 11px;
  color: #9cb1d6;
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nexa-m-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nexa-m-icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s ease;
}

.nexa-m-icon-btn:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.2);
}

.nexa-m-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

/* Greeting & Date Banner */
.nexa-m-greeting-banner {
  padding: 16px 16px 12px;
  background: #ffffff;
  border-bottom: 1px solid #eef2f7;
  box-sizing: border-box;
}

.nexa-m-greeting-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nexa-m-greeting-text h2 {
  font-size: 18px;
  font-weight: 750;
  margin: 0;
  color: #152238;
}

.nexa-m-greeting-text p {
  margin: 3px 0 0;
  font-size: 12px;
  color: #64748b;
}

.nexa-m-role-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 20px;
  background: #eef2ff;
  color: #3157d5;
  border: 1px solid #dbe4ff;
}

/* Quick Action Buttons */
.nexa-m-quick-actions {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #ffffff;
  margin-bottom: 12px;
  border-bottom: 1px solid #eef2f7;
  box-sizing: border-box;
}

.nexa-m-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  min-width: 0;
}

.nexa-m-action-item:active .nexa-m-action-circle {
  transform: scale(0.92);
}

.nexa-m-action-circle {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 18px;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease;
}

.nexa-m-action-circle.blue {
  background: linear-gradient(135deg, #3d64df, #2448be);
}

.nexa-m-action-circle.orange {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.nexa-m-action-circle.purple {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.nexa-m-action-circle.green {
  background: linear-gradient(135deg, #10b981, #059669);
}

.nexa-m-action-label {
  font-size: 11px;
  font-weight: 650;
  color: #334155;
  text-align: center;
  white-space: nowrap;
}

/* Summary Cards Grid */
.nexa-m-section {
  padding: 0 16px 16px;
}

.nexa-m-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.nexa-m-section-head h3 {
  font-size: 15px;
  font-weight: 750;
  margin: 0;
  color: #1e293b;
}

.nexa-m-section-link {
  font-size: 12.5px;
  font-weight: 650;
  color: #3157d5;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* Cards */
.nexa-m-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.nexa-m-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 15px rgba(27, 45, 78, 0.04);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.nexa-m-card.full-width {
  grid-column: 1 / -1;
}

.nexa-m-card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.nexa-m-card-accent.blue { background: linear-gradient(90deg, #3d64df, #82a0f8); }
.nexa-m-card-accent.green { background: linear-gradient(90deg, #10b981, #6ee7b7); }
.nexa-m-card-accent.orange { background: linear-gradient(90deg, #f59e0b, #fcd34d); }
.nexa-m-card-accent.purple { background: linear-gradient(90deg, #8b5cf6, #c4b5fd); }

.nexa-m-card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nexa-m-card-value {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.nexa-m-card.highlight .nexa-m-card-value {
  font-size: 22px;
  color: #1e3a8a;
}

.nexa-m-card-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nexa-m-pill-sub {
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 650;
}

.nexa-m-pill-sub.cash {
  background: #eef2ff;
  color: #3157d5;
}

.nexa-m-pill-sub.bank {
  background: #ecfdf5;
  color: #059669;
}

/* Recent Transactions List */
.nexa-m-tx-list {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 15px rgba(27, 45, 78, 0.04);
  overflow: hidden;
}

.nexa-m-tx-item {
  display: flex;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s ease;
  width: 100%;
  text-align: left;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
}

.nexa-m-tx-item:last-child {
  border-bottom: none;
}

.nexa-m-tx-item:active {
  background: #f8fafc;
}

.nexa-m-tx-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  margin-right: 12px;
  flex-shrink: 0;
}

.nexa-m-tx-icon.sale {
  background: #eef2ff;
  color: #3157d5;
}

.nexa-m-tx-icon.expense {
  background: #fef2f2;
  color: #dc2626;
}

.nexa-m-tx-icon.purchase {
  background: #fffbeb;
  color: #d97706;
}

.nexa-m-tx-details {
  flex: 1;
  min-width: 0;
}

.nexa-m-tx-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.nexa-m-tx-meta {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
  display: flex;
  gap: 6px;
}

.nexa-m-tx-amount-col {
  text-align: right;
  margin-left: 10px;
  flex-shrink: 0;
}

.nexa-m-tx-amount {
  font-size: 14px;
  font-weight: 750;
  color: #0f172a;
  letter-spacing: -0.2px;
}

.nexa-m-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  margin-top: 3px;
  text-transform: uppercase;
}

.nexa-m-badge.paid {
  background: #ecfdf5;
  color: #059669;
}

.nexa-m-badge.unpaid {
  background: #fff7ed;
  color: #c2410c;
}

.nexa-m-badge.partial {
  background: #f5f3ff;
  color: #7c3aed;
}

.nexa-m-badge.reversed {
  background: #f1f5f9;
  color: #64748b;
}

/* Empty State */
.nexa-m-empty-box {
  padding: 32px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

/* Bottom Navigation */
.nexa-m-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  height: 64px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
}

.nexa-m-nav-tab {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s ease;
  padding: 0;
}

.nexa-m-nav-tab.active {
  color: #3157d5;
}

.nexa-m-nav-tab svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  transition: transform 0.15s ease;
}

.nexa-m-nav-tab.active svg {
  transform: translateY(-2px);
}

/* Tab Views Container */
.nexa-m-view {
  display: none;
}

.nexa-m-view.active {
  display: block;
}

/* Sales Tab View (Mobile Invoices List) */
.nexa-m-search-wrap {
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid #eef2f7;
  display: flex;
  gap: 8px;
}

.nexa-m-search-input {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  color: #1e293b;
  outline: none;
}

.nexa-m-search-input:focus {
  border-color: #3157d5;
  background: #ffffff;
}

.nexa-m-filter-pills {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  background: #ffffff;
  border-bottom: 1px solid #eef2f7;
}

.nexa-m-pill {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 650;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.nexa-m-pill.active {
  background: #eef2ff;
  color: #3157d5;
  border-color: #c7d2fe;
}

/* Mobile Invoice Viewer Sheet / Modal */
.nexa-m-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 1100;
  display: none;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.nexa-m-modal-backdrop.open {
  display: flex;
}

.nexa-m-bottom-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 540px;
  border-radius: 20px 20px 0 0;
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  animation: nexaSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes nexaSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.nexa-m-sheet-handle {
  width: 40px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 2px;
  margin: 10px auto 4px;
}

.nexa-m-sheet-head {
  padding: 12px 18px;
  border-bottom: 1px solid #eef2f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nexa-m-sheet-head h3 {
  font-size: 16px;
  font-weight: 750;
  margin: 0;
  color: #0f172a;
}

.nexa-m-sheet-close {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  color: #475569;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.nexa-m-sheet-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
}

.nexa-m-invoice-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: #f8fafc;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  margin-bottom: 16px;
}

.nexa-m-info-block span {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
}

.nexa-m-info-block b {
  font-size: 13px;
  color: #0f172a;
  display: block;
  margin-top: 2px;
}

.nexa-m-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 12.5px;
}

.nexa-m-items-table th {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 2px solid #e2e8f0;
  color: #64748b;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
}

.nexa-m-items-table td {
  padding: 10px 6px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.nexa-m-items-table td:last-child,
.nexa-m-items-table th:last-child {
  text-align: right;
}

.nexa-m-totals-box {
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  margin-bottom: 16px;
}

.nexa-m-totals-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  color: #475569;
}

.nexa-m-totals-row.grand {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  border-top: 1px dashed #cbd5e1;
  padding-top: 8px;
  margin-top: 4px;
}

.nexa-m-totals-row.balance {
  color: #c2410c;
  font-weight: 750;
}

.nexa-m-sheet-foot {
  padding: 12px 18px;
  border-top: 1px solid #eef2f7;
  display: flex;
  gap: 10px;
}

.nexa-m-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.nexa-m-btn.primary {
  background: #3157d5;
  color: #ffffff;
}

.nexa-m-btn.secondary {
  background: #f1f5f9;
  color: #334155;
}

/* More Menu View */
.nexa-m-menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
}

.nexa-m-menu-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.nexa-m-menu-card:active {
  transform: scale(0.98);
  background: #f8fafc;
}

.nexa-m-menu-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.nexa-m-menu-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
}

.nexa-m-menu-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.3;
}

/* PWA Install Banner */
.nexa-m-pwa-banner {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #ffffff;
  border-radius: 14px;
  padding: 14px 16px;
  margin: 12px 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.15);
}

.nexa-m-pwa-info h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 750;
}

.nexa-m-pwa-info p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #94a3b8;
}

.nexa-m-pwa-btn {
  background: #3157d5;
  color: #ffffff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* RTL (Arabic) Support */
html[dir="rtl"] #nexaMobileApp {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .nexa-m-tx-icon {
  margin-right: 0;
  margin-left: 12px;
}

html[dir="rtl"] .nexa-m-tx-amount-col {
  text-align: left;
  margin-left: 0;
  margin-right: 10px;
}

html[dir="rtl"] .nexa-m-items-table th,
html[dir="rtl"] .nexa-m-items-table td {
  text-align: right;
}

html[dir="rtl"] .nexa-m-items-table td:last-child,
html[dir="rtl"] .nexa-m-items-table th:last-child {
  text-align: left;
}

/* ==========================================================================
   Phase 2 & 3: Mobile Form Controls, Item Steppers, Stock & Contact Sheets
   ========================================================================== */

/* Form Group & Fields */
.nexa-m-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nexa-m-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

.nexa-m-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nexa-m-input,
.nexa-m-select,
.nexa-m-textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nexa-m-input:focus,
.nexa-m-select:focus,
.nexa-m-textarea:focus {
  border-color: #3157d5;
  box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.12);
}

.nexa-m-textarea {
  resize: vertical;
  min-height: 60px;
}

.nexa-m-hint {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.nexa-m-hint.success { color: #059669; }
.nexa-m-hint.warning { color: #d97706; }
.nexa-m-hint.danger { color: #dc2626; }

/* Segmented Control Toggle (Cash / Bank / Credit) */
.nexa-m-seg-group {
  display: flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 10px;
  gap: 3px;
}

.nexa-m-seg-btn {
  flex: 1;
  padding: 9px 0;
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 700;
  color: #64748b;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.nexa-m-seg-btn.active {
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Dynamic Line Items in Invoice Form */
.nexa-m-line-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nexa-m-line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nexa-m-line-actions {
  display: grid;
  grid-template-columns: 120px 1fr 32px;
  gap: 8px;
  align-items: center;
}

/* Stepper Controls */
.nexa-m-qty-stepper {
  display: flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  height: 38px;
}

.nexa-m-stepper-btn {
  width: 34px;
  height: 100%;
  background: #f1f5f9;
  border: none;
  font-size: 16px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  display: grid;
  place-items: center;
  user-select: none;
}

.nexa-m-stepper-btn:active {
  background: #e2e8f0;
}

.nexa-m-stepper-input {
  flex: 1;
  width: 42px;
  min-width: 0;
  border: none;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  outline: none;
  background: transparent;
  padding: 0;
}

.nexa-m-line-del-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #fee2e2;
  background: #fef2f2;
  color: #dc2626;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.nexa-m-add-item-btn {
  width: 100%;
  padding: 10px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #3157d5;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 12px;
  text-align: center;
  transition: all 0.15s ease;
}

.nexa-m-add-item-btn:hover {
  background: #eef2ff;
  border-color: #93c5fd;
}

/* Customer Directory & Card List */
.nexa-m-contact-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.nexa-m-contact-card:active {
  background: #f8fafc;
}

.nexa-m-contact-info b {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  display: block;
}

.nexa-m-contact-info span {
  font-size: 11.5px;
  color: #64748b;
  display: block;
  margin-top: 2px;
}

.nexa-m-contact-debt {
  text-align: right;
  flex-shrink: 0;
}

.nexa-m-contact-debt b {
  font-size: 13.5px;
  font-weight: 750;
  color: #c2410c;
  display: block;
}

.nexa-m-contact-debt span {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  display: block;
}

/* Stock & Inventory Card List */
.nexa-m-stock-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nexa-m-stock-info {
  min-width: 0;
  flex: 1;
}

.nexa-m-stock-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nexa-m-stock-sku {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.nexa-m-stock-badge-col {
  text-align: right;
  flex-shrink: 0;
}

.nexa-m-stock-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 750;
  padding: 3px 8px;
  border-radius: 8px;
}

.nexa-m-stock-badge.instock {
  background: #ecfdf5;
  color: #059669;
}

.nexa-m-stock-badge.lowstock {
  background: #fffbeb;
  color: #d97706;
}

.nexa-m-stock-badge.outofstock {
  background: #fef2f2;
  color: #dc2626;
}

.nexa-m-stock-price {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-top: 3px;
}

/* Offline Indicator Banner */
.nexa-m-offline-banner {
  background: #f59e0b;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 16px;
  text-align: center;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  position: sticky;
  top: 60px;
  z-index: 110;
}

.nexa-m-offline-banner.online {
  background: #10b981;
}

/* Mobile Toast Notification */
.nexa-m-toast {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nexa-m-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

