/* ==========================================================
   RouteManifest - Customer Portal CSS
   Matches provided screens: Browse Products, Invoices, Orders, Dashboard
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --sidebar-bg: #0B4627;
  --sidebar-hover: #135A34;
  --sidebar-active: #157347;
  --sidebar-text: #D1E7DD;
  --primary: #0B4627;
  --primary-accent: #157347;
  --primary-light: #EAF7EE;
  --accent-orange: #F97316;
  --body-bg: #F4F7F6;
  --card-bg: #FFFFFF;
  --border-color: #E5E7EB;
  --text-dark: #1F2937;
  --text-muted: #6B7280;
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--body-bg);
  color: var(--text-dark);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
}

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

/* App Layout */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Left Sidebar */
.app-sidebar {
  width: 250px;
  background-color: var(--sidebar-bg);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.08);
  z-index: 100;
}

.sidebar-brand {
  padding: 22px 20px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand img {
  height: 48px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.sidebar-menu {
  list-style: none;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border-radius: 10px;
  color: var(--sidebar-text);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.sidebar-menu li a:hover {
  background-color: var(--sidebar-hover);
  color: #FFFFFF;
}

.sidebar-menu li a.active {
  background-color: var(--sidebar-active);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.sidebar-menu li a i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
}

.sidebar-banner {
  margin: 12px;
  background: linear-gradient(145deg, #09371F 0%, #062816 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 14px;
  color: #FFFFFF;
  font-size: 0.78rem;
  position: relative;
  overflow: hidden;
}

.sidebar-banner h5 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #4ECCA3;
  margin-bottom: 4px;
  font-family: cursive;
}

.sidebar-banner p {
  color: #D1E7DD;
  font-size: 0.76rem;
  line-height: 1.3;
}

/* Main Content Area */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
}

/* Top Navigation Bar */
.app-topbar {
  height: 68px;
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-search {
  display: flex;
  align-items: center;
  background-color: #F9FAFB;
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 8px 18px;
  width: 380px;
  gap: 10px;
}

.topbar-search input {
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
  width: 100%;
}

.topbar-search i {
  color: #9CA3AF;
  font-size: 0.9rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.notif-btn {
  position: relative;
  background: #F3F4F6;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4B5563;
  cursor: pointer;
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: #EF4444;
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 9999px;
  cursor: pointer;
  background-color: #F9FAFB;
  border: 1px solid var(--border-color);
}

.user-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #157347;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-info strong {
  font-size: 0.88rem;
  color: var(--text-dark);
}

.user-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Page Body Container */
.page-content {
  padding: 24px 28px 40px;
  flex: 1;
}

/* KPI Cards Row */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  display: flex;
  align-items: center;
  gap: 16px;
}

.kpi-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.kpi-icon-green { background-color: #DCFCE7; color: #16A34A; }
.kpi-icon-blue { background-color: #DBEAFE; color: #2563EB; }
.kpi-icon-orange { background-color: #FEF3C7; color: #D97706; }
.kpi-icon-red { background-color: #FEE2E2; color: #DC2626; }

.kpi-info span {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: block;
}

.kpi-info h3 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.2;
}

.kpi-info small {
  font-size: 0.75rem;
  color: #6B7280;
}

/* Banner Box */
.promo-banner {
  background: linear-gradient(135deg, #EAF7EE 0%, #D4EDDA 100%);
  border-radius: 16px;
  padding: 24px 30px;
  margin-bottom: 24px;
  border: 1px solid #C3E6CB;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.promo-banner .btn {
  white-space: nowrap !important;
  flex-shrink: 0;
}

/* Filter Pills */
.filter-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.pill-btn {
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
  background-color: #FFFFFF;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pill-btn:hover {
  border-color: #9CA3AF;
}

.pill-btn.active {
  background-color: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

/* Product Cards Grid */
.b2b-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.b2b-card {
  background: #FFFFFF;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.b2b-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.b2b-img-wrap {
  width: 100%;
  height: 140px;
  overflow: hidden;
  background-color: #F3F4F6;
  position: relative;
}

.b2b-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.b2b-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #FFFFFF;
}

.badge-bestseller { background-color: #0B4627; }
.badge-popular { background-color: #EF4444; }
.badge-new { background-color: #F97316; }

.b2b-heart {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #6B7280;
  cursor: pointer;
}

.b2b-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.b2b-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.b2b-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.b2b-price span {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.b2b-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex: 1;
}

.b2b-stock {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #10B981;
  font-weight: 600;
  margin-bottom: 10px;
}

.b2b-qty-row {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F9FAFB;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 10px;
}

.b2b-qty-btn {
  border: none;
  background: transparent;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-dark);
}

.b2b-qty-input, .qty-input {
  width: 48px;
  text-align: center;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 0.95rem;
  outline: none;
  -moz-appearance: textfield;
}

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

.btn-add-cart {
  width: 100%;
  background-color: var(--primary);
  color: #FFFFFF;
  border: none;
  padding: 9px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.2s ease;
}

.btn-add-cart:hover {
  background-color: var(--sidebar-hover);
}

/* Tables */
.b2b-table-card {
  background: #FFFFFF;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  overflow: hidden;
}

.b2b-table {
  width: 100%;
  border-collapse: collapse;
}

.b2b-table th {
  background-color: #F9FAFB;
  padding: 12px 18px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #6B7280;
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.b2b-table td {
  padding: 14px 18px;
  font-size: 0.88rem;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.b2b-table tr:last-child td {
  border-bottom: none;
}

.b2b-table tr:hover td {
  background-color: #FDFEFE;
}

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-delivered { background-color: #DCFCE7; color: #166534; }
.status-confirmed { background-color: #FEF3C7; color: #92400E; }
.status-out_for_delivery { background-color: #DBEAFE; color: #1E40AF; }
.status-pending { background-color: #FEE2E2; color: #991B1B; }
.status-partial { background-color: #FFEDD5; color: #C2410C; }
.status-paid { background-color: #DCFCE7; color: #166534; }
.status-overdue { background-color: #FEE2E2; color: #DC2626; }
.status-cancelled { background-color: #F3F4F6; color: #4B5563; }

/* Right Details Pane (For Invoices & Cart) */
.details-pane {
  background: #FFFFFF;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

/* Invoice Split Grid: 2-col on desktop, stacks on mobile */
.invoice-split-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr;
  gap: 22px;
  align-items: start;
}

/* Stepper Wizard */
.wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  position: relative;
}

/* Step 2 Cart Responsive Views */
.desktop-cart-view {
  display: block;
}

.mobile-cart-view {
  display: none;
}

.cart-mobile-item {
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.step-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.wizard-nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
}

.wizard-stepper::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 30px;
  right: 30px;
  height: 2px;
  background-color: var(--border-color);
  z-index: 1;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  gap: 6px;
}

.wizard-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.wizard-step.active .wizard-step-circle {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
}

.wizard-step-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.wizard-step.active .wizard-step-title {
  color: var(--primary);
}

/* Vertical Timeline for Tracking */
.vertical-tracker {
  position: relative;
  padding-left: 28px;
}

.vertical-tracker::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  bottom: 8px;
  width: 2px;
  background-color: #E5E7EB;
}

.tracker-node {
  position: relative;
  margin-bottom: 18px;
}

.tracker-dot {
  position: absolute;
  left: -28px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: #FFFFFF;
}

.tracker-node.done .tracker-dot {
  background-color: #10B981;
}

.tracker-node.active .tracker-dot {
  background-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 70, 39, 0.2);
}

/* =========================================================
   MOBILE RESPONSIVE — Full Mobile-First Overrides
   Target: <768px (phone), 768-1024px (tablet)
   ========================================================= */

/* Mobile Bottom Navigation Bar (hidden on desktop) */
.mobile-bottom-nav {
  display: none;
}

/* Hamburger Menu Toggle (hidden by default on desktop) */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-dark);
  cursor: pointer;
  padding: 4px 8px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px);
  z-index: 250;
}

/* Tablet: 1024px and below */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .b2b-table-card { overflow-x: auto; }
  .b2b-table { min-width: 600px; }
}

/* Mobile: 768px and below */
@media (max-width: 768px) {

  /* === Layout === */
  body { display: block; }

  .app-container {
    display: block;
    min-height: 100vh;
  }

  /* === Sidebar — slides in from left on mobile === */
  .app-sidebar {
    position: fixed;
    top: 0;
    left: -290px;
    width: 270px;
    height: 100vh;
    z-index: 300;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 6px 0 25px rgba(0,0,0,0.3);
  }

  .app-sidebar.open {
    left: 0;
  }

  .sidebar-overlay.open {
    display: block;
    z-index: 250;
  }

  /* === Topbar === */
  .app-topbar {
    padding: 0 16px;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 150;
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  }

  .mobile-menu-btn { display: flex; align-items: center; }

  .topbar-search { display: none; }

  /* === Main Content === */
  .app-main {
    min-height: calc(100vh - 60px);
  }

  .page-content {
    padding: 14px 14px 80px;
  }

  /* === Bottom Navigation Bar === */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #FFFFFF;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    z-index: 180;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px;
  }

  .mob-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    color: #9CA3AF;
    font-size: 0.62rem;
    font-weight: 700;
    text-decoration: none;
    padding: 6px 0;
    transition: color 0.2s;
  }

  .mob-nav-item i {
    font-size: 1.1rem;
  }

  .mob-nav-item.active {
    color: var(--primary);
  }

  .mob-nav-center {
    position: relative;
    flex: 1.2;
    margin-top: -20px;
  }

  .mob-nav-fab {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 16px rgba(11, 70, 39, 0.35);
    margin: 0 auto 3px;
  }

  .mob-nav-center.active .mob-nav-fab {
    background: var(--primary-accent);
  }

  /* === KPI Grid === */
  .kpi-grid, .admin-kpi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
  .kpi-card { padding: 14px; }
  .kpi-icon { width: 38px; height: 38px; font-size: 1rem; }
  .kpi-info h3 { font-size: 1.4rem; }

  /* === Tables === */
  .b2b-table-card { overflow-x: auto; border-radius: 12px; }
  .b2b-table { min-width: 560px; font-size: 0.82rem; }
  .b2b-table th, .b2b-table td { padding: 10px 10px; }

  /* === Status pills === */
  .status-pill { font-size: 0.72rem; padding: 3px 8px; }

  /* === Buttons === */
  .btn { padding: 10px 16px; font-size: 0.88rem; }
  .btn-sm { padding: 5px 10px; font-size: 0.78rem; }

  /* === Section headers === */
  h1 { font-size: 1.5rem !important; }
  h2 { font-size: 1.2rem !important; }

  /* === Dashboard order tracker === */
  .order-tracker-grid { grid-template-columns: 1fr; }

  /* === Invoice Split Grid & Order Details === */
  .invoice-split-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .order-details-card {
    padding: 16px !important;
  }
  .order-details-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* === Universal Grid Stacking on Mobile === */
  [style*="grid-template-columns: 1.15fr 1.35fr"],
  [style*="grid-template-columns: 1.1fr 1.4fr 1.2fr"],
  [style*="grid-template-columns: 2.2fr 0.95fr"],
  [style*="grid-template-columns: 1.8fr 1fr"],
  [style*="grid-template-columns: 1.55fr 1fr"],
  [style*="grid-template-columns: 1.65fr 1fr"],
  [style*="grid-template-columns: 1fr 2fr"],
  [style*="grid-template-columns: 2fr 1.05fr"],
  [style*="grid-template-columns: 2fr 1fr"],
  [style*="grid-template-columns: 1.15fr 1.25fr"],
  [style*="grid-template-columns: 1.2fr 1fr"],
  [style*="grid-template-columns: 1fr 1.3fr"],
  [style*="grid-template-columns: 1fr 1fr 1fr"],
  [style*="grid-template-columns: repeat(4, 1fr)"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* === Invoice / Ledger wide cards === */
  .invoice-card, .ledger-card { padding: 14px; }
  #invoice-sheet { padding: 16px !important; }

  /* === Promo Banner Mobile Fix === */
  .promo-banner {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    padding: 18px 20px !important;
  }
  .promo-banner > div:last-child {
    width: 100% !important;
  }
  .promo-banner .btn {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    padding: 12px 20px !important;
    font-size: 0.95rem !important;
    box-sizing: border-box !important;
  }

  /* === Topbar Date Hide on Mobile === */
  .topbar-date,
  .topbar-right > div:first-child:not(.notif-btn):not(.user-profile-badge) {
    display: none !important;
  }

  /* === Wizard Stepper on Tablet & Mobile === */
  .wizard-stepper {
    margin-bottom: 22px;
  }
  .wizard-stepper::before {
    left: 20px;
    right: 20px;
    top: 14px;
  }
  .wizard-step-circle {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
  .wizard-step-title {
    font-size: 0.68rem;
    text-align: center;
    max-width: 68px;
    line-height: 1.15;
  }

  /* === Products Grid (2 columns on mobile) === */
  .b2b-products-grid,
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .b2b-card-title {
    font-size: 0.82rem !important;
  }
  .b2b-price {
    font-size: 0.88rem !important;
  }
  .b2b-img-wrap {
    height: 110px !important;
  }

  /* === Step 2 Cart Responsive === */
  .desktop-cart-view {
    display: none !important;
  }
  .mobile-cart-view {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
  }

  /* === Wizard Step Footers on Mobile === */
  .step-footer-bar {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .step-footer-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #F9FAFB;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
  }
  .step-footer-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .step-footer-actions .btn {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }
  .wizard-nav-buttons {
    flex-direction: column-reverse !important;
    gap: 10px !important;
    width: 100% !important;
  }
  .wizard-nav-buttons .btn {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  /* === Hide less important elements on mobile === */
  .hide-mobile { display: none !important; }

  /* === Mobile User Profile Badge in Topbar === */
  .user-profile-badge {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* === Admin Order Items Table on Mobile === */
  .admin-order-table {
    min-width: unset !important;
    width: 100% !important;
  }
  .admin-order-table th, .admin-order-table td {
    padding: 8px 6px !important;
    font-size: 0.8rem !important;
  }

  /* === All Admin Tables: Horizontal Scroll on Mobile === */
  .b2b-table-card {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .b2b-table {
    min-width: 540px;
    width: 100%;
  }

  /* === Bottom spacing === */
  .page-content { padding-bottom: 80px; }
}

/* Extra small: 480px and below */
@media (max-width: 480px) {
  .kpi-grid, .admin-kpi-grid { grid-template-columns: 1fr !important; gap: 10px; }
  .page-content { padding: 10px 10px 80px; }
  .kpi-card { padding: 12px; }
  .b2b-table-card header,
  [style*="padding: 20px 24px"],
  [style*="padding: 28px"],
  [style*="padding: 24px"] { padding: 14px 16px !important; }

  /* Compact stepper on very small screens */
  .wizard-stepper::before {
    left: 16px;
    right: 16px;
    top: 13px;
  }
  .wizard-step-circle {
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
  }
  .wizard-step .wizard-step-title {
    display: none;
  }
  .wizard-step.active .wizard-step-title {
    display: block;
    position: absolute;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--primary);
  }
  .wizard-stepper {
    margin-bottom: 30px;
  }
}

/* Dedicated Print Layout */
@media print {
  .app-sidebar,
  .app-topbar,
  .sidebar-overlay,
  .filter-pills,
  .mobile-bottom-nav,
  .no-print,
  button:not(.allow-print),
  .b2b-table-card {
    display: none !important;
  }
  .app-container, .app-main, .page-content {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: auto !important;
  }
  #invoice-details-card,
  #invoice-sheet {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: 100% !important;
  }
}
