:root {
  --bg-light: #F8FAFC;
  --card-light: #FFFFFF;
  --sidebar-dark: #1E293B;
  --border-light: #E2E8F0;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --primary-navy: #0A1172;
  --accent-emerald: #10B981;
  --accent-hover: #059669;
  --alert-red: #EF4444;
  --warning-orange: #F59E0B;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-light);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Navbar */
header.app-header {
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--border-light);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  height: 38px;
  background-color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-navy);
  letter-spacing: -0.5px;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--accent-emerald);
  color: var(--accent-emerald);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.status-pill.offline {
  background-color: rgba(245, 158, 11, 0.1);
  border-color: var(--warning-orange);
  color: var(--warning-orange);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--bg-light);
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--text-main);
}

/* Standalone Login Screen View */
#loginView {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-light);
}

.login-card {
  width: 440px;
  background-color: var(--card-light);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
}

.login-logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.login-logo {
  height: 60px;
  padding: 8px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
}

/* Role Selector Tabs */
.role-tabs {
  display: flex;
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--border-light);
  padding: 0 28px;
  gap: 8px;
  position: sticky;
  top: 63px;
  z-index: 99;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 12px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--primary-navy);
}

.tab-btn.active {
  color: #2563EB;
  border-bottom-color: #2563EB;
}

/* Main Layout */
.app-container {
  flex: 1;
  display: flex;
  min-height: calc(100vh - 64px);
  background-color: var(--bg-light);
}

/* Sleek Light Executive Navigation Sidebar */
.app-sidebar {
  width: 250px;
  background-color: #FFFFFF !important;
  background: #FFFFFF !important;
  border-right: 1px solid #E2E8F0 !important;
  color: #334155 !important;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 100;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
}

.sidebar-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #94A3B8;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 12px 0 6px 0;
  padding: 0 12px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  color: #64748B;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-item svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.sidebar-item:hover {
  background-color: #F8FAFC;
  color: #1E293B;
}

.sidebar-item:hover svg {
  transform: translateX(2px);
}

.sidebar-item.active {
  background-color: #EEF2FF;
  color: #4F46E5;
  font-weight: 700;
  box-shadow: none;
}

.sidebar-item.active svg {
  stroke: #4F46E5;
}

.sidebar-logout:hover {
  background-color: #FEF2F2;
  color: #DC2626 !important;
}

/* Views */
.view-panel {
  display: none;
  width: 100%;
  padding: 24px 32px;
  overflow-y: auto;
}

.view-panel.active {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  gap: 24px;
  align-items: stretch;
}

/* Product Image Thumbnail Placeholder Box */
.prod-thumb-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #94A3B8;
  overflow: hidden;
  object-fit: cover;
}

/* Cashier POS Interactive Register Layout (Desktop Side-by-Side Split) */
#cashierView.active {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 20px !important;
  width: 100% !important;
}

#cashierView .pos-left {
  flex: 1 1 calc(100% - 410px) !important;
  min-width: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#cashierView .pos-right {
  flex: 0 0 390px !important;
  width: 390px !important;
  min-width: 340px !important;
  background-color: var(--card-light);
  border-radius: 14px;
  border: 1px solid var(--border-light);
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

/* Cashier POS List Mode Layout */
.pos-left {
  flex: 65;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pos-right {
  flex: 35;
  background-color: var(--card-light);
  border-radius: 12px;
  border: 1px solid var(--border-light);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Search Bar & Filters */
.search-filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-input {
  flex: 1;
  background-color: var(--card-light);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.search-input:focus {
  border-color: var(--accent-emerald);
}

.category-pills {
  display: flex;
  gap: 8px;
}

.cat-pill {
  background-color: var(--card-light);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.cat-pill.active, .cat-pill:hover {
  background-color: var(--accent-emerald);
  color: #ffffff;
  border-color: var(--accent-emerald);
}

/* Data Table - Refined Enterprise Styling */
.table-container {
  background-color: var(--card-light);
  border: 1px solid #CBD5E1;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
  flex: 1;
  transition: box-shadow 0.2s ease-in-out;
}

table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 0.9rem;
}

table.data-table th {
  background: linear-gradient(180deg, #F8FAFC 0%, #EEF2F6 100%);
  color: #475569;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 18px;
  border-bottom: 2px solid #CBD5E1;
  white-space: nowrap;
}

table.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #E2E8F0;
  color: #1E293B;
  vertical-align: middle;
  font-size: 0.88rem;
}

table.data-table tr:nth-child(even) {
  background-color: #FAFAFC;
}

table.data-table tr:hover {
  background-color: #F0F7FF !important;
  transition: background-color 0.15s ease-in-out;
}

.sku-code {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  color: #3730A3;
  background-color: #EEF2FF;
  border: 1px solid #C7D2FE;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-block;
}

.model-badge {
  background-color: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-add {
  background: #FFFFFF;
  border: 1px solid var(--accent-emerald);
  color: var(--accent-emerald);
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add:hover {
  background-color: var(--accent-emerald);
  color: #ffffff;
}

/* Checkout Receipt Drawer */
.cart-header {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.cart-items-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #F8FAFC;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  font-size: 0.88rem;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-qty {
  background-color: #E2E8F0;
  color: var(--text-main);
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.cart-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.total-amount {
  color: var(--accent-emerald);
  font-size: 1.6rem;
}

.btn-checkout {
  width: 100%;
  background-color: var(--accent-emerald);
  color: #ffffff;
  border: none;
  padding: 16px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-checkout:hover {
  background-color: var(--accent-hover);
}

/* Dashboard Metric Cards (Light Mode) */
/* Dashboard Metric Cards (Light Mode) */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background-color: var(--card-light);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.metric-title {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.metric-val {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.metric-sub {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background-color: var(--card-light);
  border: 1px solid var(--border-light);
  width: 440px;
  max-width: 90vw;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Universal Responsive Media Breakpoints for PC Displays & Laptops */
@media (max-width: 1280px) {
  header.app-header {
    padding: 10px 16px;
  }
  .app-sidebar {
    width: 200px;
  }
  .view-panel {
    width: calc(100% - 200px);
    margin-left: 200px;
    padding: 16px 20px;
  }
  .role-tabs {
    padding: 0 16px;
  }
}

@media (max-width: 1024px) {
  .view-panel.active,
  #cashierView.active {
    flex-direction: column !important;
  }
  .pos-left, .pos-right,
  #cashierView .pos-left, #cashierView .pos-right {
    width: 100% !important;
    flex: auto !important;
    position: static !important;
  }
  .search-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 768px) {
  .view-panel {
    width: 100%;
    margin-left: 0;
    padding: 12px 14px;
  }
}

/* Sticky Screen-Fit Executive Checkout Drawer */
.sticky-checkout-drawer {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
}

.cart-items-scroll {
  flex: 1;
  overflow-y: auto;
  max-height: 260px;
  padding-right: 4px;
}

/* Bold & High-Precision Part Number Badge */
.part-number-bold {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-weight: 700;
  font-size: 0.85rem;
  background: #F1F5F9;
  color: #0F172A;
  border: 1px solid #CBD5E1;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

/* Interactive Quantity Stepper Buttons */
.cart-qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #0F172A;
  font-weight: bold;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cart-qty-btn:hover {
  background: #2563EB;
  color: #FFFFFF;
  border-color: #2563EB;
}

/* Interactive Payment Method Pills */
.pay-pill {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pay-pill.active {
  background: #2563EB;
  color: #FFFFFF;
  border-color: #2563EB;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Light Mode Product Catalog Grid Cards Styling (Fluid Responsive Grid) */
.pos-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  padding-right: 4px;
}

@media (max-width: 1200px) {
  .pos-catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 900px) {
  .pos-catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Blue & Bold Last 4 Characters Suffix Tag */
.part-num-blue-suffix {
  color: #2563EB;
  font-weight: 800;
  background: #DBEAFE;
  padding: 1px 4px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.pos-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.pos-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-color: #CBD5E1;
}

.pos-card-top {
  position: relative;
  width: 100%;
  height: 120px;
  background: #F8FAFC;
  border-radius: 8px;
  border: 1px solid #F1F5F9;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #94A3B8;
  overflow: hidden;
}

.pos-card-stock-badge {
  position: absolute;
  top: 6px;
  right: 6px;
}

.pos-card-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: #0F172A;
  margin-bottom: 4px;
  line-height: 1.25;
}

.pos-card-sku {
  margin-bottom: 8px;
}

.pos-card-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 12px;
  margin-top: auto;
}

.btn-card-add {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: none;
  background: #0F172A;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-card-add:hover {
  background: #2563EB;
}

.btn-card-add:active {
  transform: scale(0.98);
}

/* ==========================================================================
   🖨️ CLEAN PDF & PRINT MEDIA STYLESHEET (PRODUCT LIST & DETAILS ONLY)
   ========================================================================== */
@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 11pt !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Hide all app chrome, sidebars, headers, filter cards, buttons, and modals */
  .app-sidebar,
  .app-header,
  #reportsFilterCard,
  .cat-pill,
  .btn-checkout,
  .btn-add,
  .modal-overlay,
  .user-badge,
  .fin-subnav-tab,
  .search-filter-bar {
    display: none !important;
  }

  .app-container {
    padding: 0 !important;
    margin: 0 !important;
    min-height: auto !important;
    background: #FFFFFF !important;
  }

  .view-panel {
    display: block !important;
    padding: 0 !important;
    width: 100% !important;
    overflow: visible !important;
  }

  .view-panel:not(.active) {
    display: none !important;
  }

  /* Expand data tables and details cards to 100% printable page width */
  #reportTableContainer,
  .table-container,
  .data-table {
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
    border: none !important;
  }

  .data-table th {
    background-color: #F1F5F9 !important;
    color: #0F172A !important;
    border: 1px solid #94A3B8 !important;
    font-weight: bold !important;
    padding: 8px 10px !important;
    font-size: 9pt !important;
  }

  .data-table td {
    border: 1px solid #CBD5E1 !important;
    padding: 8px 10px !important;
    font-size: 9pt !important;
    color: #0F172A !important;
  }

  /* Header Title Banner */
  h2, h3 {
    color: #0F172A !important;
    margin-top: 0 !important;
    margin-bottom: 8px !important;
  }

  @page {
    size: auto;
    margin: 15mm;
  }
}

/* ==========================================================================
   📱 ULTRA-RESPONSIVE MOBILE & TABLET STYLES (iPhones, Android, iPads, Desktops)
   ========================================================================== */

/* Mobile Backdrop Overlay */
#sidebarOverlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

#sidebarOverlay.active {
  display: block;
  opacity: 1;
}

/* Touch momentum and smooth scrolling for all scrollable elements */
.table-container, .view-panel, .modal-box, .app-container {
  -webkit-overflow-scrolling: touch;
}

/* Mobile Screen Breakpoint (< 1024px) */
@media screen and (max-width: 1023px) {
  header.app-header {
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-actions {
    gap: 8px;
    flex-wrap: wrap;
  }

  .user-badge {
    padding: 4px 8px;
    font-size: 0.78rem;
  }

  /* POS Register 2-Column layout stacks vertically on tablets and phones */
  .pos-container {
    flex-direction: column !important;
  }

  .pos-products-section {
    flex: 1 1 100% !important;
    width: 100% !important;
  }

  .pos-cart-sidebar {
    width: 100% !important;
    position: static !important;
    margin-top: 16px;
  }
}

/* Tablet & Smartphone Drawer Breakpoint (< 1025px) */
@media screen and (max-width: 1024px) {
  /* Sidebar becomes a smooth slide-out drawer on left */
  .app-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: -290px !important;
    width: 280px !important;
    height: 100vh !important;
    z-index: 10000 !important;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.25) !important;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow-y: auto !important;
    display: flex !important;
  }

  .app-sidebar.mobile-active {
    left: 0 !important;
    display: flex !important;
  }

  /* Main Canvas Container expands to 100% screen width */
  .app-container {
    width: 100% !important;
    padding: 12px !important;
  }

  .view-panel {
    padding: 12px 8px !important;
  }

  /* Hamburger Menu Toggle Button */
  #mobileMenuToggle {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    background: #EEF2FF;
    color: #4F46E5;
    border: 1px solid #C7D2FE;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
  }
}

/* Smartphone & iPhone Screen Breakpoint (< 640px) */
@media screen and (max-width: 639px) {
  /* Prevent iOS Safari auto-zoom on input focus */
  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="email"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Standalone Login Screen Card */
  .login-card {
    width: 94% !important;
    padding: 24px 16px !important;
    border-radius: 12px !important;
  }

  .login-logo {
    height: 48px !important;
  }

  /* Header Branding */
  .brand-title {
    font-size: 1rem !important;
  }

  .brand-sub {
    font-size: 0.7rem !important;
  }

  /* Hide non-essential header labels on narrow screens */
  #headerPosBtn span {
    display: none;
  }

  #currentUserName {
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
  }

  /* Clean up top header row for narrow smartphone screens */
  header.app-header {
    padding: 8px 12px !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }

  .header-actions {
    gap: 6px !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    margin-left: auto !important;
  }

  .user-badge {
    padding: 4px 8px !important;
    font-size: 0.76rem !important;
    gap: 4px !important;
  }

  #currentUserRoleBadge {
    display: none !important;
  }

  .status-pill {
    padding: 4px 8px !important;
    font-size: 0.74rem !important;
  }

  /* Form Flex Rows (e.g. Price + Category + Part #) stack vertically */
  form div[style*="display: flex"],
  .modal-box div[style*="display: flex"] {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .modal-box div[style*="justify-content: flex-end"],
  .modal-box div[style*="justify-content: space-between"] {
    flex-direction: row !important;
  }

  /* All Modals fit iPhone screen sizes cleanly with full scrollability */
  .modal-overlay {
    padding: 10px !important;
    align-items: center !important;
    justify-content: center !important;
    overflow-y: auto !important;
  }

  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 18px 14px !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
  }

  /* Data Tables horizontal touch scroll styling */
  .table-container {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin-bottom: 12px !important;
  }

  .data-table th, .data-table td {
    padding: 8px 6px !important;
    font-size: 0.78rem !important;
    white-space: nowrap;
  }

  /* Action buttons wrap and stay touch-friendly */
  .data-table td button {
    padding: 6px 10px !important;
    font-size: 0.75rem !important;
    margin-bottom: 4px;
  }

  /* Grid Layouts for Products & KPI Cards on iPhone */
  .pos-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    gap: 10px !important;
  }

  .pos-card-top {
    height: 90px !important;
  }

  .pos-card-title {
    font-size: 0.82rem !important;
  }

  .pos-card-price {
    font-size: 0.98rem !important;
  }

  /* KPI Summary Cards Grid */
  div[style*="grid-template-columns"],
  div[style*="display: grid"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Horizontal Scrolling Sub-navigation Tab Bar */
  .fin-subnav-bar {
    display: flex !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 6px !important;
    width: 100% !important;
  }

  .fin-subnav-bar::-webkit-scrollbar {
    display: none !important;
  }

  .fin-subnav-tab {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 8px 14px !important;
    font-size: 0.82rem !important;
  }

  /* Filter bars mobile responsiveness */
  .fin-filter-bar {
    width: 100% !important;
    padding: 10px !important;
    gap: 8px !important;
    box-sizing: border-box !important;
  }

  .fin-filter-bar select,
  .fin-filter-bar input[type="date"] {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .fin-filter-bar button {
    flex: 1 1 auto !important;
    text-align: center !important;
    justify-content: center !important;
  }
}
