/* Flowtifyy Main Styles */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --fi-primary: #146EF5;
  --fi-primary-dark: #0f5bd4;
  --fi-dark: #0d0f18;
  --fi-dark-sidebar: #111827;
  --fi-sidebar-text: #9ca3af;
  --fi-sidebar-active: #fff;
  --fi-bg: #f0f4f8;
  --fi-surface: #ffffff;
  --fi-border: #e5e7eb;
  --fi-text: #1a1a1a;
  --fi-muted: #6b7280;
  --fi-success: #10b981;
  --fi-warning: #f59e0b;
  --fi-danger: #ef4444;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

body { margin: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; color: var(--fi-text); background: var(--fi-bg); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }

a { color: var(--fi-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 500; border: none; cursor: pointer; transition: all 0.15s; line-height: 1.5; white-space: nowrap; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--fi-primary); color: #fff; }
.btn-primary:hover { background: var(--fi-primary-dark); }
.btn-secondary { background: #fff; color: var(--fi-text); border: 1px solid var(--fi-border); }
.btn-secondary:hover { background: var(--fi-bg); }
.btn-danger { background: var(--fi-danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 8px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--fi-text); margin-bottom: 6px; }
.form-control { width: 100%; padding: 8px 12px; border: 1px solid var(--fi-border); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; color: var(--fi-text); background: #fff; transition: border-color 0.15s, box-shadow 0.15s; outline: none; }
.form-control:focus { border-color: var(--fi-primary); box-shadow: 0 0 0 3px rgba(20,110,245,0.1); }
.form-control::placeholder { color: var(--fi-muted); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%236b7280'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* Cards */
.card { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--fi-border); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--fi-border); display: flex; align-items: center; justify-content: space-between; }
.card-body { padding: 20px; }
.card-title { font-size: 15px; font-weight: 600; color: var(--fi-text); margin: 0; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-blue { background: #eff6ff; color: #1d4ed8; }
.badge-green { background: #f0fdf4; color: #15803d; }
.badge-yellow { background: #fffbeb; color: #b45309; }
.badge-red { background: #fef2f2; color: #b91c1c; }
.badge-gray { background: #f9fafb; color: #374151; }
.badge-purple { background: #f5f3ff; color: #6d28d9; }

/* Admin Layout */
.admin-layout { display: flex; min-height: 100vh; }

.sidebar { width: 240px; background: var(--fi-dark-sidebar); color: #fff; display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 100; flex-shrink: 0; }
.sidebar-logo { padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 10px; }
.sidebar-logo img { height: 28px; }
.sidebar-logo-text { font-size: 16px; font-weight: 700; color: #fff; }
.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); color: var(--fi-sidebar-text); font-size: 14px; font-weight: 500; transition: all 0.15s; text-decoration: none; margin-bottom: 2px; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.sidebar-nav a.active { background: rgba(20,110,245,0.2); color: var(--fi-primary); }
.sidebar-nav a svg { flex-shrink: 0; }
.sidebar-section-title { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.08em; padding: 8px 10px 4px; margin-top: 8px; }
.sidebar-footer { padding: 12px 8px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-shop-info { padding: 8px 10px; margin-bottom: 4px; }
.sidebar-shop-name { font-size: 13px; font-weight: 600; color: #fff; }
.sidebar-shop-link { font-size: 12px; color: var(--fi-sidebar-text); }
.sidebar-footer a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--radius); color: var(--fi-sidebar-text); font-size: 13px; transition: all 0.15s; text-decoration: none; }
.sidebar-footer a:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }

.main-content { flex: 1; min-width: 0; margin-left: 240px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--fi-border); padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.page-content { padding: 24px; flex: 1; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--fi-border); border-radius: var(--radius-lg); padding: 20px; }
.stat-label { font-size: 13px; color: var(--fi-muted); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--fi-text); line-height: 1; }
.stat-icon { width: 40px; height: 40px; border-radius: var(--radius); background: #eff6ff; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }

/* Tables */
.table-container { background: #fff; border: 1px solid var(--fi-border); border-radius: var(--radius-lg); overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 16px; text-align: left; font-size: 12px; font-weight: 600; color: var(--fi-muted); text-transform: uppercase; letter-spacing: 0.05em; background: var(--fi-bg); border-bottom: 1px solid var(--fi-border); }
td { padding: 12px 16px; border-bottom: 1px solid var(--fi-border); font-size: 14px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--fi-bg); }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--fi-border); margin-bottom: 24px; }
.tab { padding: 10px 16px; font-size: 14px; font-weight: 500; color: var(--fi-muted); border-bottom: 2px solid transparent; cursor: pointer; text-decoration: none; transition: all 0.15s; }
.tab:hover { color: var(--fi-text); text-decoration: none; }
.tab.active { color: var(--fi-primary); border-bottom-color: var(--fi-primary); }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* Toggle */
.toggle { position: relative; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #d1d5db; border-radius: 22px; transition: .2s; }
.toggle-slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .2s; }
.toggle input:checked + .toggle-slider { background: var(--fi-primary); }
.toggle input:checked + .toggle-slider:before { transform: translateX(18px); }

/* Utility */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--fi-muted); }
.text-small { font-size: 12px; }
.font-mono { font-family: 'Courier New', monospace; font-size: 13px; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Color picker */
.color-picker-group { display: flex; gap: 8px; align-items: center; }
.color-picker-group input[type="color"] { width: 40px; height: 38px; padding: 2px; border: 1px solid var(--fi-border); border-radius: var(--radius-sm); cursor: pointer; }

/* Filters bar */
.filters-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.filters-bar .form-control { width: auto; }

/* Status badges */
.status-new { background: #eff6ff; color: #1d4ed8; }
.status-processing { background: #fffbeb; color: #b45309; }
.status-shipped { background: #f0fdf4; color: #15803d; }
.status-cancelled { background: #fef2f2; color: #b91c1c; }
.payment-pending { background: #fffbeb; color: #b45309; }
.payment-paid { background: #f0fdf4; color: #15803d; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius-xl); padding: 24px; max-width: 480px; width: 90%; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 18px; font-weight: 600; margin: 0; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--fi-muted); font-size: 20px; padding: 4px; }

/* Landing page specific */
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: #eff6ff; color: var(--fi-primary); padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; margin-bottom: 24px; }
.section-tag { display: inline-block; background: #eff6ff; color: var(--fi-primary); padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }

/* Code block */
.code-block { background: #1e2130; border-radius: var(--radius); padding: 16px; font-family: 'Courier New', monospace; font-size: 13px; color: #e2e8f0; overflow-x: auto; position: relative; }
.code-block .copy-btn { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,0.1); border: none; color: #e2e8f0; padding: 4px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; }
.code-block .copy-btn:hover { background: rgba(255,255,255,0.2); }
.code-kw { color: #7c3aed; }
.code-str { color: #10b981; }
.code-comment { color: #6b7280; }

/* Superadmin accent */
.superadmin-accent { --fi-primary: #7c3aed; --fi-primary-dark: #6d28d9; }

/* ─── Page header (flex row with optional wrap) ─────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-header h2 { margin: 0; font-size: 20px; font-weight: 600; }
.page-header-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ─── Settings header (title + action buttons row) ──────────────── */
.settings-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.settings-header h2 { margin: 0; font-size: 20px; font-weight: 600; }
.settings-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ─── Order detail responsive grid ──────────────────────────────── */
.order-detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }

/* ─── Categories responsive grid ────────────────────────────────── */
.category-grid { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }

/* ─── Orders: status filter tab strip ───────────────────────────── */
.filter-status-tabs { display: flex; gap: 4px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 2px; }

/* ─── Sidebar toggle (hamburger) ────────────────────────────────── */
.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; color: var(--fi-text); border-radius: var(--radius-sm); flex-shrink: 0; transition: background 0.15s; min-width: 40px; min-height: 40px; justify-content: center; align-items: center; }
.sidebar-toggle:hover { background: var(--fi-bg); }
.sidebar-toggle svg { display: block; }

/* ─── Sidebar backdrop (mobile/tablet) ──────────────────────────── */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
.sidebar-backdrop.open { display: block; }

/* ─── Filters bar – wrap nicely ─────────────────────────────────── */
.filters-bar { flex-wrap: wrap; }

/* ─── Mobile utility classes ────────────────────────────────────── */
.mob-hide { }
.mob-only { display: none; }

/* ─── Product card list (mobile only – hidden on desktop) ─── */
.prod-card-list { display: none; flex-direction: column; gap: 10px; }
.prod-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; overflow: hidden; }
.prod-card-top { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px; }
.prod-card-img { width: 52px !important; height: 52px !important; object-fit: cover; border-radius: 8px; border: 1px solid #e5e7eb; flex-shrink: 0; display: block; }
.prod-card-img-placeholder { background: #f3f4f6; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.prod-card-main { flex: 1; min-width: 0; }
.prod-card-name { font-weight: 600; font-size: 15px; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-card-price { font-size: 13px; color: #6b7280; margin-top: 2px; }
.prod-card-meta { border-top: 1px solid #f3f4f6; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.prod-card-row { display: flex; align-items: center; gap: 8px; }
.prod-card-label { font-size: 11px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: .04em; min-width: 90px; flex-shrink: 0; }
.prod-card-val { display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; color: #374151; }
.prod-card-actions { border-top: 1px solid #f3f4f6; padding: 10px 14px; display: flex; gap: 8px; }

/* ─── Product tile grid (mobile) ───────────────────────────────── */
.prod-tile-grid { display: none; }
.prod-tile {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--fi-border);
  border-radius: 12px; overflow: hidden;
  text-decoration: none; color: inherit;
  transition: box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.prod-tile:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); text-decoration: none; }
.prod-tile-img {
  width: 100%; aspect-ratio: 1/1;
  background: #f3f4f6; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.prod-tile-img img { width: 100%; height: 100%; object-fit: cover; }
.prod-tile-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.prod-tile-name { font-size: 13px; font-weight: 600; color: var(--fi-text); line-height: 1.3; }
.prod-tile-price { font-size: 13px; font-weight: 700; color: var(--fi-primary); }
.prod-tile-cats { display: flex; flex-wrap: wrap; gap: 2px; }
.prod-tile-status { margin-top: auto; }

/* ─── Mobile top navigation bar (fixed below topbar on mobile) ─── */
.mob-bottom-nav {
  display: none;
  position: fixed;
  top: 56px; left: 0; right: 0;
  background: #fff;
  border-bottom: 1px solid var(--fi-border);
  z-index: 150;
}
.mob-nav-items { display: flex; height: 56px; }
.mob-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: #9ca3af; text-decoration: none;
  font-size: 10px; font-weight: 500; gap: 3px; padding: 0;
  background: none; border: none; cursor: pointer; font-family: inherit;
  transition: color 0.15s; -webkit-tap-highlight-color: transparent;
  position: relative;
}
.mob-nav-item:hover { color: var(--fi-text); text-decoration: none; }
.mob-nav-item.active { color: var(--fi-primary); }
.mob-nav-item.active::after {
  content: '';
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 3px; background: var(--fi-primary); border-radius: 3px 3px 0 0;
}
.mob-nav-item svg { flex-shrink: 0; width: 22px; height: 22px; }
.mob-nav-item span { white-space: nowrap; font-size: 10px; font-weight: 500; }

/* ── Bottom nav: force-hidden by JS class ── */
.mob-bottom-nav--hidden { display: none !important; }

/* ─── Mehr (More) slide-up drawer ────────────────────────────── */
.mob-more-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 300;
}
.mob-more-overlay.open { display: block; }
.mob-more-drawer {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: #fff; border-radius: 20px 20px 0 0; z-index: 310;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  will-change: transform;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  max-height: 85vh; overflow-y: auto;
}
.mob-more-drawer.open { transform: translateY(0); }
.mob-more-handle {
  width: 40px; height: 4px; background: #d1d5db; border-radius: 2px;
  margin: 14px auto 8px; cursor: pointer;
}
.mob-more-content { padding-bottom: 12px; }
.mob-more-section-title {
  font-size: 11px; font-weight: 600; color: var(--fi-muted);
  text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 20px 4px;
}
.mob-more-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 20px;
  color: var(--fi-text); font-size: 15px; font-weight: 500;
  text-decoration: none; width: 100%; background: none; border: none;
  cursor: pointer; font-family: inherit; text-align: left;
  transition: background 0.12s; -webkit-tap-highlight-color: transparent;
}
.mob-more-item:hover { background: var(--fi-bg); text-decoration: none; }
.mob-more-item.active { color: var(--fi-primary); }
.mob-more-item svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--fi-muted); }
.mob-more-item.active svg { color: var(--fi-primary); }
.mob-more-divider { height: 1px; background: var(--fi-border); margin: 6px 0; }
.mob-more-lang {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 20px;
}
.mob-more-lang-label { font-size: 14px; font-weight: 500; color: var(--fi-text); }
.mob-more-lang-btns { display: flex; gap: 6px; }
.mob-more-lang-btn {
  font-size: 13px; font-weight: 600; padding: 5px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--fi-border);
  background: #fff; color: var(--fi-muted); cursor: pointer; transition: all 0.15s;
}
.mob-more-lang-btn.mob-lang-active { background: var(--fi-primary); color: #fff; border-color: var(--fi-primary); }
.mob-more-logout { color: var(--fi-danger) !important; }
.mob-more-logout svg { color: var(--fi-danger) !important; }

/* ═══════════════════════════════════════════════════════════════
   TABLET  ≤991px
═══════════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  /* Sidebar: hide off-screen, slide in on open — wider to cover more of the mobile screen */
  .sidebar { width: min(85vw, 300px); transform: translateX(-100%); transition: transform 0.28s cubic-bezier(0.4,0,0.2,1); z-index: 200; will-change: transform; }
  .sidebar.open { transform: translateX(0); }

  /* Backdrop: darker so underlying content recedes */
  .sidebar-backdrop { background: rgba(0,0,0,0.65); }
  .sidebar-backdrop.open { display: block; }

  /* Main content: no left margin */
  .main-content { margin-left: 0; }

  /* Topbar */
  .topbar { padding: 0 14px; height: 52px; }

  /* Show hamburger */
  .sidebar-toggle { display: flex; }

  /* Stats: 2 columns */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Page content */
  .page-content { padding: 16px; }

  /* 3-column grids → 2 */
  .grid-3 { grid-template-columns: 1fr 1fr; }

  /* Order detail: single column */
  .order-detail-grid { grid-template-columns: 1fr; }

  /* Categories: single column */
  .category-grid { grid-template-columns: 1fr; }

  /* Filter status tabs: scroll */
  .filter-status-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; scrollbar-width: none; -ms-overflow-style: none; }
  .filter-status-tabs::-webkit-scrollbar { display: none; }

  /* Tabs: scrollable */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; scrollbar-width: none; -ms-overflow-style: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; flex-shrink: 0; }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE  ≤767px  — complete native-app redesign
═══════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  /* ── Prevent document-level horizontal scroll ── */
  body { overflow-x: hidden; }

  /* ── Utilities ── */
  .mob-hide { display: none !important; }
  .mob-only { display: block; }

  /* ── Show bottom nav ── */
  .mob-bottom-nav { display: block; }

  /* ── Topbar: navigation is via bottom nav, keep it clean ── */
  .sidebar-toggle { display: none !important; }
  .topbar { padding: 0 16px; height: 56px; }
  .topbar-title { font-size: 16px; font-weight: 700; }
  .topbar-role-text { display: none !important; }
  #pwa-push-btn { display: none !important; }
  .topbar-actions { gap: 4px; }

  /* ── Page content: top padding for topnav (56px topbar + 56px nav + 16px gap) ── */
  .page-content { padding: calc(56px + 16px) 16px 24px; overflow-x: hidden; }

  /* ── Mobile tile grid ── */
  .prod-tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

  /* ── Stats grid: 2 cols ── */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 24px; }
  .stat-icon { width: 36px; height: 36px; margin-bottom: 8px; }

  /* ── Grid collapse ── */
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }

  /* ── Filters: stack ── */
  .filters-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .filters-bar .form-control { width: 100% !important; min-width: 0 !important; }
  .filters-bar select.form-control,
  .filters-bar input[type="date"].form-control,
  .filters-bar input[type="text"].form-control { width: 100% !important; }
  .filters-bar .btn { align-self: flex-start; }

  /* ── Prevent iOS zoom on inputs (≥16px) ── */
  input.form-control, select.form-control, textarea.form-control { font-size: 16px; }

  /* ── Touch targets ── */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .btn-icon { min-height: 44px; min-width: 44px; }

  /* ── Settings header ── */
  .settings-header { flex-direction: column; align-items: flex-start; }
  .settings-header-actions { width: 100%; justify-content: flex-end; }
  .settings-form > div[style*="border-top"] { flex-wrap: wrap; }

  /* ── Modal: slide from bottom ── */
  .modal { padding: 20px 16px; margin: 0 8px; width: calc(100% - 16px); max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 12px 12px; }
  .modal-overlay { align-items: flex-end; padding-bottom: env(safe-area-inset-bottom, 0px); }

  /* ── Card ── */
  .card-body { padding: 14px; }
  .card-header { padding: 12px 14px; }

  /* ── Page header ── */
  .page-header { gap: 8px; flex-wrap: nowrap; }
  .page-header > .btn { flex-shrink: 0; }
  .page-header h2 { font-size: 17px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* ── Product card list ── */
  .prod-card-list { display: flex; }

  /* ── Table ── */
  td, th { padding: 10px; font-size: 13px; }
  .table-container { border-radius: 10px; max-width: calc(100vw - 32px); }
  .table-container table { min-width: 420px; }
  td > div[style*="display:flex"],
  td > div[style*="display: flex"] { flex-wrap: wrap; gap: 6px; }

  /* ── Product image cell ── */
  .product-img-cell img,
  .product-img-cell > div { width: 36px !important; height: 36px !important; font-size: 16px !important; }

  /* ── Order / category detail ── */
  .order-detail-grid { gap: 12px; }

  /* ── Tabs ── */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; scrollbar-width: none; -ms-overflow-style: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; flex-shrink: 0; }
  .filter-status-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; scrollbar-width: none; -ms-overflow-style: none; }
  .filter-status-tabs::-webkit-scrollbar { display: none; }

  /* ── PWA update popup: full-width below mobile topbar ── */
  #pwa-update-toast {
    top: 64px !important;
    right: 12px !important; left: 12px !important;
    max-width: none !important;
  }

  /* ── Desktop hint visible on mobile ── */
  .mob-desktop-hint { display: block; }
}

/* ── Absolute guard — bottom nav & drawer never visible above mobile ── */
@media (min-width: 768px) {
  .mob-bottom-nav { display: none !important; }
  .mob-more-overlay { display: none !important; }
  .mob-more-drawer { display: none !important; }
}

/* ─── Pagination bar ────────────────────────────────────────────────────────── */
.pagination-bar {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 20px 0 8px;
}
.pag-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 16px; border-radius: var(--radius);
  border: 1px solid var(--fi-border); background: #fff;
  font-size: 13px; font-weight: 500; color: var(--fi-text);
  text-decoration: none; cursor: pointer; transition: all 0.15s;
}
.pag-btn:hover:not(.pag-disabled) { border-color: var(--fi-primary); color: var(--fi-primary); background: #eff6ff; }
.pag-btn.pag-disabled { opacity: 0.35; cursor: default; pointer-events: none; }
.pag-info { font-size: 13px; color: var(--fi-muted); }

/* ─── Mobile desktop-hint ────────────────────────────────────────────────────── */
.mob-desktop-hint {
  display: none;
  font-size: 12px; color: #6b7280;
  background: #f8faff; border: 1px solid #dbeafe;
  border-radius: 8px; padding: 8px 12px;
  margin-bottom: 14px; text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   SMALL MOBILE  ≤478px
═══════════════════════════════════════════════════════════════ */
@media (max-width: 478px) {
  .stats-grid { gap: 8px; }
  .stat-card { padding: 12px 10px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 11px; }
  .stat-icon { width: 30px; height: 30px; margin-bottom: 6px; }
  .topbar { padding: 0 12px; height: 52px; }
  .topbar-title { font-size: 15px; }
  .page-header h2, .page-content h2 { font-size: 15px !important; }
  td, th { padding: 8px; font-size: 12px; }
  .table-container { max-width: calc(100vw - 24px); }
  .table-container table { min-width: 340px; }
  .badge { font-size: 10px; padding: 2px 5px; }
  .card-body { padding: 12px; }
  .card-header { padding: 10px 12px; }
  .modal { margin: 0; width: 100%; border-radius: 20px 20px 0 0; max-height: 95vh; }
  .mob-nav-item svg { width: 20px; height: 20px; }
  .mob-nav-item span { font-size: 9px; }
  .mob-bottom-nav { top: 52px; }
  .page-content { padding: calc(52px + 12px) 12px 16px; }
}
