@media (min-width: 768px) {
  /* Hide original top nav on desktop (kept in DOM for showTab compatibility) */
  body.v37-sidebar-active .nav { display:none !important; }

  /* V37: Hide Excel button in header (user request) */
  body.v37-sidebar-active #h-excel-btn {
    display:none !important;
  }

  /* === SIMPLE FLEX LAYOUT === */
  body.v37-sidebar-active #v37-shell {
    display:flex !important;
    flex-direction:row !important;
    width:100%;
    align-items:stretch;
  }

  /* Header sticky */
  body.v37-sidebar-active .header {
    position:sticky;
    top:0;
    z-index:100;
  }

  /* Main wrapper takes remaining width */
  body.v37-sidebar-active .v37-app-main {
    flex:1 1 auto;
    min-width:0;
    max-width:100%;
    width:auto !important;
    display:block !important;
    overflow:visible;
  }

  /* Content fills the main, max-width:none so it doesn't center */
  body.v37-sidebar-active .content {
    max-width:none !important;
    width:auto !important;
    margin:0 !important;
    padding:18px 22px !important;
    box-sizing:border-box;
    min-width:0;
  }

  /* fhero-sticky: nav is hidden, so reset its sticky offset to header only */
  body.v37-sidebar-active .fhero-sticky {
    top:calc(var(--header-h, 58px) + 4px) !important;
  }

  /* ════════════════════════════════════════════════════════════════════
     V37 FIX: Billing & Audit tabs were pushed BELOW the sidebar because
     their inner elements use `min-width:fit-content` (e.g. the Billing
     payment calendar with 12 monthly cells) which forces the flex item
     to grow beyond its allotted width.

     SCOPE: Only #tab-billing and #tab-audit. No other tab is affected.

     STRATEGY: Inside these two tabs only, override min-width:fit-content
     on inline-styled children, and let the existing overflow-x:auto on
     the calendar's parent handle horizontal scrolling instead.
     ════════════════════════════════════════════════════════════════════ */
  body.v37-sidebar-active #tab-billing,
  body.v37-sidebar-active #tab-audit {
    max-width:100%;
    min-width:0;
  }
  /* Override the inline `min-width:fit-content` only inside these tabs */
  body.v37-sidebar-active #tab-billing div[style*="min-width:fit-content"],
  body.v37-sidebar-active #tab-audit div[style*="min-width:fit-content"] {
    min-width:0 !important;
  }
  /* Tables inside these tabs should also respect parent width */
  body.v37-sidebar-active #tab-billing table,
  body.v37-sidebar-active #tab-audit table {
    max-width:100%;
  }

  /* === V37 PAGE TITLE BADGE (in header, after logo) === */
  /* Renders as a colored chip inside the existing header — does NOT affect layout */
  .v37-page-title-chip {
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:6px 14px;
    border-radius:8px;
    font-size:14px;
    font-weight:700;
    background:rgba(59,130,246,0.12);
    color:var(--text);
    margin-inline-start:18px;
    border:1px solid rgba(59,130,246,0.25);
    white-space:nowrap;
    flex-shrink:0;
  }
  .v37-page-title-chip-icon {
    width:18px; height:18px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
  }
  .v37-page-title-chip-icon svg {
    width:14px; height:14px;
  }
  body.light .v37-page-title-chip {
    background:rgba(59,130,246,0.10);
  }

  /* === V37 SIDEBAR === */
  .v37-sidebar {
    width:230px !important;
    min-width:230px;
    max-width:230px;
    flex-shrink:0;
    flex-grow:0;
    background:var(--bg2);
    border-left:1px solid var(--border);
    display:flex;
    flex-direction:column;
    transition:width .25s ease, min-width .25s ease, max-width .25s ease;
    overflow:hidden;
    position:sticky;
    top:var(--header-h, 58px);
    height:calc(100vh - var(--header-h, 58px));
    align-self:flex-start;
  }
  body.light .v37-sidebar {
    background:#f8fafc;
    box-shadow:1px 0 8px rgba(0,0,0,0.04);
  }
  body.v37-collapsed .v37-sidebar {
    width:62px !important;
    min-width:62px;
    max-width:62px;
  }

  /* Sidebar Header */
  .v37-sb-head {
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 12px;
    border-bottom:1px solid var(--border);
    min-height:50px;
  }
  .v37-sb-logo {
    width:30px; height:30px; border-radius:8px;
    background:linear-gradient(135deg, var(--blue), var(--cyan));
    display:flex; align-items:center; justify-content:center;
    color:#fff; font-weight:700; font-size:13px;
    flex-shrink:0;
    box-shadow:0 2px 8px rgba(59,130,246,0.3);
  }
  .v37-sb-brand {
    display:flex; flex-direction:column;
    flex:1; min-width:0;
  }
  .v37-sb-brand-name { font-weight:700; font-size:13px; color:var(--text); }
  .v37-sb-brand-sub { font-size:9px; color:var(--text2); margin-top:1px; }
  body.v37-collapsed .v37-sb-brand { display:none; }
  body.v37-collapsed .v37-sb-logo { display:none; }
  body.v37-collapsed .v37-sb-head { padding:10px 14px; justify-content:center; gap:0; }

  .v37-sb-toggle {
    background:transparent; border:none; cursor:pointer;
    color:var(--text2); padding:6px;
    border-radius:6px;
    display:flex; align-items:center; justify-content:center;
    transition:background .15s, color .15s, transform .25s ease;
    flex-shrink:0;
  }
  .v37-sb-toggle:hover { background:var(--bg3); color:var(--text); }
  body.v37-collapsed .v37-sb-toggle {
    transform:rotate(180deg);
    width:32px; height:32px;
    background:var(--bg3);
    border:1px solid var(--border);
  }
  body.rtl.v37-collapsed .v37-sb-toggle { transform:rotate(180deg); }

  /* Sidebar body */
  .v37-sb-body {
    flex:1;
    overflow-y:auto;
    overflow-x:hidden;
    padding:6px 0;
  }
  .v37-sb-body::-webkit-scrollbar { width:4px; }
  .v37-sb-body::-webkit-scrollbar-thumb { background:var(--border2); border-radius:2px; }

  .v37-sb-section-h {
    font-size:10px;
    font-weight:600;
    color:var(--text3);
    letter-spacing:.08em;
    padding:12px 16px 4px 16px;
    text-transform:uppercase;
    white-space:nowrap;
  }
  body.v37-collapsed .v37-sb-section-h {
    font-size:0;
    height:1px;
    margin:8px 14px 4px;
    background:var(--border);
    border-radius:1px;
    overflow:hidden;
    padding:0;
  }

  /* Sidebar item */
  .v37-sb-item {
    display:flex;
    align-items:center;
    gap:11px;
    padding:6px 12px;
    margin:1px 8px;
    border-radius:8px;
    color:var(--text2);
    cursor:pointer;
    transition:background .15s, color .15s;
    position:relative;
    text-decoration:none;
    font-size:12.5px;
    font-weight:500;
    white-space:nowrap;
    user-select:none;
  }
  .v37-sb-item:hover {
    background:var(--bg3);
    color:var(--text);
  }
  .v37-sb-item.active {
    background:rgba(59,130,246,0.12);
    color:var(--text);
    font-weight:600;
  }
  .v37-sb-item.active::before {
    content:"";
    position:absolute;
    right:-8px; /* RTL: right side accent */
    top:6px; bottom:6px;
    width:3px;
    background:var(--blue);
    border-radius:2px;
  }
  body.ltr .v37-sb-item.active::before {
    right:auto;
    left:-8px;
  }

  /* Colored icon backgrounds (Option 3) */
  .v37-sb-ico {
    width:24px; height:24px;
    border-radius:6px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
    color:#fff;
  }
  .v37-sb-ico svg { width:13px; height:13px; }
  /* Image-based tab icon (e.g. Marketing Workspace) */
  .v37-ico-marketing { background:#fff; padding:0; overflow:hidden; }
  .v37-sb-ico-img { width:24px; height:24px; border-radius:6px; object-fit:cover; display:block; }
  .v37-chip-ico-img { width:16px; height:16px; border-radius:4px; object-fit:cover; display:inline-block; vertical-align:middle; }

  /* Per-tab colors (Option 3) */
  .v37-ico-dashboard  { background:#3b82f6; }
  .v37-ico-today      { background:#06b6d4; }
  .v37-ico-followups  { background:#f59e0b; }
  .v37-ico-pipeline   { background:#a855f7; }
  .v37-ico-kanban     { background:#ec4899; }
  .v37-ico-activity   { background:#14b8a6; }
  .v37-ico-customers  { background:#22c55e; }
  .v37-ico-leads      { background:#f97316; }
  .v37-ico-leadactivity { background:#6366f1; }
  .v37-ico-myperf     { background:#0ea5e9; }
  .v37-ico-funnel     { background:#a855f7; }
  .v37-ico-reports    { background:#22c55e; }
  .v37-ico-billing    { background:#64748b; }
  .v37-ico-audit      { background:#475569; }

  .v37-sb-item-text {
    flex:1;
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .v37-sb-item-badge {
    background:var(--red);
    color:#fff;
    font-size:9px;
    font-weight:700;
    min-width:18px;
    height:17px;
    border-radius:9px;
    padding:0 5px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
  }
  .v37-sb-item-badge.amber { background:var(--amber); color:#000; }

  body.v37-collapsed .v37-sb-item {
    justify-content:center;
    padding:6px;
    margin:1px 6px;
  }
  body.v37-collapsed .v37-sb-item-text,
  body.v37-collapsed .v37-sb-item-badge { display:none; }
  body.v37-collapsed .v37-sb-item.active::before {
    right:-6px; top:5px; bottom:5px;
  }

  /* Tooltip on collapsed hover */
  body.v37-collapsed .v37-sb-item:hover::after {
    content:attr(data-label);
    position:absolute;
    right:calc(100% + 8px);
    top:50%;
    transform:translateY(-50%);
    background:var(--card);
    border:1px solid var(--border2);
    padding:5px 9px;
    border-radius:6px;
    white-space:nowrap;
    font-size:11px;
    color:var(--text);
    box-shadow:var(--sh);
    z-index:1000;
    pointer-events:none;
  }
  body.ltr.v37-collapsed .v37-sb-item:hover::after {
    right:auto;
    left:calc(100% + 8px);
  }

  /* Sidebar footer */
  .v37-sb-foot {
    border-top:1px solid var(--border);
    padding:8px 10px;
  }
  .v37-sb-user {
    display:flex;
    align-items:center;
    gap:9px;
    padding:6px;
    border-radius:8px;
    cursor:pointer;
    transition:background .15s;
  }
  .v37-sb-user:hover { background:var(--bg3); }
  .v37-sb-user-avatar {
    width:28px; height:28px;
    border-radius:50%;
    background:linear-gradient(135deg, var(--purple), var(--blue));
    color:#fff;
    font-weight:700;
    font-size:12px;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
  }
  .v37-sb-user-info { flex:1; min-width:0; overflow:hidden; }
  .v37-sb-user-name {
    font-size:12px;
    font-weight:600;
    color:var(--text);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .v37-sb-user-role {
    font-size:9px;
    color:var(--text2);
  }
  body.v37-collapsed .v37-sb-user-info { display:none; }
  body.v37-collapsed .v37-sb-user { justify-content:center; padding:6px 0; }

  /* Main content wrapper */
  .v37-app-main {
    flex:1;
    display:flex;
    flex-direction:column;
    min-width:0;
    overflow:hidden;
  }
}

/* Mobile: V37 sidebar inert */
@media (max-width: 767px) {
  .v37-sidebar { display:none !important; }
  body.v37-sidebar-active #v37-shell {
    display:block !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   V43 — MOBILE PASS (Professional Mobile Layout)
   • Filter Bottom Sheet (replaces inline filter bars)
   • Filter chips (active filter indicators)
   • Compact sticky header per screen
   • Smaller FAB (48px) above tab bar
   • Card-based Pipeline / Customers / Billing views
   • Vertical Kanban
   • Compact Forecast widget
   Activates only when body.mob-active is set (mobile viewport + logged in)
   ═══════════════════════════════════════════════════════════════════════════ */

body.mob-active {
  --v43-sheet-bg: #0f1f3a;
  --v43-sheet-radius: 20px;
  --v43-chip-radius: 12px;
  --v43-card-radius: 10px;
  --v43-sticky-z: 47;
  --v43-sheet-z: 220;
  --v43-backdrop-z: 215;
}
body.mob-active.light {
  --v43-sheet-bg: #ffffff;
}

/* === V43.2 — Targeted horizontal overflow fix ===
   Earlier V43.1 used overflow:hidden on body/shell, which broke sticky
   positioning and z-index stacking (filter bar collided with notif alerts,
   FAB sat above content, kpi grids got pushed wide).
   V43.2 approach: only constrain the OFFENDING chart/SVG elements, leave
   body/shell scroll model alone. */
body.mob-active {
  /* Allow body to scroll vertically as normal; don't touch overflow-x globally */
}
/* Cap SVG charts to their card's content box — this is what actually overflowed */
body.mob-active .dash-chart-card svg,
body.mob-active [id^="dash-charts-row"] svg,
body.mob-active #dash-forecast-body svg,
body.mob-active #dash-sector-section svg,
body.mob-active #donut-chart svg,
body.mob-active #funnel-trap-chart svg {
  max-width: 100% !important;
  height: auto !important;
  display: block;
}
/* Chart card wrappers themselves get their own horizontal scroll if needed,
   so nothing leaks into the body */
body.mob-active .dash-chart-card,
body.mob-active [id^="dash-charts-row"] > div,
body.mob-active #dash-forecast-section,
body.mob-active #slot1-body,
body.mob-active #slot2-body,
body.mob-active #slot3-body,
body.mob-active #slot4-body {
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}
/* #dash-sector-section: V43.8 — contain charts without page-level horizontal scroll */
body.mob-active #dash-sector-section {
  max-width: 100% !important;
  overflow-x: hidden !important;
}
/* Sector inner grids: V43.8 handles donut/kpi/split rows; other 2-col rows stack via .v43-sector-split-grid */
body.mob-active #dash-sector-section [style*="grid-template-columns"]:not(.v43-sector-donut-grid):not(.v43-sector-split-grid):not(#sec-kpi-cards) {
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}
/* Tables stay scrollable inside their own wrapper, never the body */
body.mob-active .table-wrap > div[style*="overflow-x:auto"],
body.mob-active .table-wrap > div[style*="overflow-x: auto"] {
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* === Hide inline filter bars (fhero) and use a compact bar with "Filter" button === */
body.mob-active .fhero-sticky .fhero-filters > .filters,
body.mob-active .fhero-sticky .fhero-filters > .report-filters-grid,
body.mob-active #billing-collections-filters {
  display: none !important;
}
/* Keep the filter wrapper, but compact it to header-only */
body.mob-active .fhero-sticky {
  min-height: 0 !important;
  padding: 0 !important;
}
body.mob-active .fhero-sticky .fhero-filters {
  padding: 8px 12px !important;
  gap: 6px !important;
}
body.mob-active .fhero-sticky .fhero-filters > div[style*="display:flex"]:has(button) {
  /* The action buttons row (View/Excel/PDF) in Reports tab — hide; we'll provide bottom action bar */
  display: none !important;
}

/* === V43 — Compact filter bar (replaces fhero filters on mobile) === */
.v43-filter-bar {
  display: none;
}
body.mob-active .v43-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 0 0 10px 0;
  position: sticky;
  top: calc(54px + 49px);
  z-index: var(--v43-sticky-z);
}
body.mob-active .v43-filter-bar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
  flex: 1;
}
body.mob-active .v43-filter-bar-title .v43-count {
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
}
body.mob-active .v43-filter-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  background: rgba(59,130,246,.15);
  border: 1px solid rgba(59,130,246,.4);
  color: #93c5fd;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
body.mob-active.light .v43-filter-btn {
  background: rgba(59,130,246,.1);
  color: #1d4ed8;
}
body.mob-active .v43-filter-btn:active { transform: scale(.96); }
body.mob-active .v43-filter-btn .v43-filter-badge {
  background: #3b82f6;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9px;
  min-width: 17px;
  text-align: center;
  line-height: 1.3;
}
body.mob-active .v43-filter-btn[data-count="0"] .v43-filter-badge { display: none; }

/* === V43 — Filter chips strip === */
body.mob-active .v43-chips-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 12px 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
body.mob-active .v43-chips-strip::-webkit-scrollbar { display: none; }
body.mob-active .v43-chips-strip:empty { display: none; }
body.mob-active .v43-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--v43-chip-radius);
  background: rgba(34,197,94,.12);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,.3);
  white-space: nowrap;
  scroll-snap-align: start;
  cursor: pointer;
}
body.mob-active.light .v43-chip {
  background: rgba(22,163,74,.1);
  color: #166534;
  border-color: rgba(22,163,74,.3);
}
body.mob-active .v43-chip.chip-purple {
  background: rgba(168,85,247,.12); color:#c084fc; border-color: rgba(168,85,247,.3);
}
body.mob-active.light .v43-chip.chip-purple {
  background: rgba(126,34,206,.1); color:#6b21a8; border-color: rgba(126,34,206,.3);
}
body.mob-active .v43-chip.chip-amber {
  background: rgba(245,158,11,.12); color:#fcd34d; border-color: rgba(245,158,11,.3);
}
body.mob-active.light .v43-chip.chip-amber {
  background: rgba(180,83,9,.1); color:#92400e; border-color: rgba(180,83,9,.3);
}
body.mob-active .v43-chip.chip-cyan {
  background: rgba(34,211,238,.12); color:#67e8f9; border-color: rgba(34,211,238,.3);
}
body.mob-active.light .v43-chip.chip-cyan {
  background: rgba(8,145,178,.1); color:#155e75; border-color: rgba(8,145,178,.3);
}
body.mob-active .v43-chip .v43-chip-x {
  font-size: 14px;
  line-height: 1;
  opacity: .75;
}
body.mob-active .v43-chip:active { transform: scale(.95); }

/* === V43 — Bottom Sheet === */
.v43-sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: var(--v43-backdrop-z);
}
.v43-sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.v43-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--v43-sheet-bg, var(--bg2));
  border-top-left-radius: var(--v43-sheet-radius);
  border-top-right-radius: var(--v43-sheet-radius);
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.32,.72,0,1);
  z-index: var(--v43-sheet-z);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.v43-sheet.open { transform: translateY(0); }
.v43-sheet-handle {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
  flex-shrink: 0;
  cursor: grab;
}
.v43-sheet-handle::before {
  content: '';
  width: 38px;
  height: 4px;
  background: rgba(148,163,184,.45);
  border-radius: 2px;
}
.v43-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.v43-sheet-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.v43-sheet-close {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.v43-sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px 10px;
  flex: 1;
}
.v43-sheet-foot {
  padding: 10px 16px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.v43-sheet-foot button {
  flex: 1;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.v43-sheet-foot button.primary {
  flex: 2;
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}
.v43-sheet-foot button:active { transform: scale(.97); }

/* === V43 — Sheet form groups === */
.v43-sheet-section {
  margin-bottom: 14px;
}
.v43-sheet-section:last-child { margin-bottom: 0; }
.v43-sheet-label {
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.v43-sheet-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.v43-sheet select, .v43-sheet input[type="date"], .v43-sheet input[type="text"] {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  -webkit-appearance: none;
  appearance: none;
}
.v43-sheet select { padding-inline-end: 30px; }
.v43-sheet .v43-sheet-row-2 {
  display: flex; gap: 8px;
}
.v43-sheet .v43-sheet-row-2 > * { flex: 1; }

/* === V43 — Smaller FAB (48px override) + sit just above tab bar === */
body.mob-active .mob-fab {
  width: 48px !important;
  height: 48px !important;
  font-size: 24px !important;
  border-width: 3px !important;
  box-shadow: 0 4px 14px rgba(59,130,246,.4), 0 2px 6px rgba(0,0,0,.12) !important;
}
body.mob-active .mob-fab-container {
  bottom: calc(var(--mobile-bottom-nav-h) - 8px + env(safe-area-inset-bottom,0)) !important;
}

/* === V43 — Mobile card view for Pipeline (replaces table on mobile) === */
body.mob-active #tab-pipeline .table-wrap > div[style*="overflow-x:auto"],
body.mob-active #tab-pipeline .table-wrap table {
  display: none !important;
}
body.mob-active .v43-deal-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 12px 16px;
}
body.mob-active .v43-deal-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--v43-card-radius);
  padding: 12px;
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
body.mob-active.rtl .v43-deal-card { border-right: 3px solid var(--stage-color, #64748b); }
body.mob-active.ltr .v43-deal-card { border-left: 3px solid var(--stage-color, #64748b); }
body.mob-active .v43-deal-card:active { transform: scale(.99); background: var(--bg3); }
body.mob-active .v43-deal-card .v43-deal-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; margin-bottom: 6px;
}
body.mob-active .v43-deal-card .v43-deal-name {
  flex: 1; min-width: 0;
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.mob-active .v43-deal-card .v43-deal-meta {
  font-size: 10px; color: var(--text2); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.mob-active .v43-deal-card .v43-deal-badge {
  flex-shrink: 0; font-size: 9px; padding: 2px 7px; border-radius: 6px;
  font-weight: 700; white-space: nowrap;
}
body.mob-active .v43-deal-card .v43-deal-bot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px;
}
body.mob-active .v43-deal-card .v43-deal-value {
  color: var(--cyan, #22d3ee);
  font-weight: 700;
  font-size: 12px;
}
body.mob-active .v43-deal-card .v43-deal-info {
  display: flex; gap: 10px; color: var(--text2); font-size: 10px;
  white-space: nowrap;
}
body.mob-active .v43-deal-card .v43-deal-info > span {
  display: inline-flex; align-items: center; gap: 3px;
}
body.mob-active .v43-deal-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text2);
  font-size: 13px;
}

/* === V43 — Mobile bottom action bar (Reports tab: View/Excel/PDF) === */
.v43-action-bar { display: none; }
body.mob-active .v43-action-bar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  margin: 0 0 10px 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: sticky;
  bottom: calc(var(--mobile-bottom-nav-h) + env(safe-area-inset-bottom, 0) + 6px);
  z-index: 46;
}
body.mob-active .v43-action-bar button {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: none;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  color: #fff;
}
body.mob-active .v43-action-bar button:active { transform: scale(.97); }
body.mob-active .v43-action-bar .v43-act-pdf { background: #ef4444; }
body.mob-active .v43-action-bar .v43-act-excel { background: #22c55e; }
body.mob-active .v43-action-bar .v43-act-view { background: #3b82f6; }

/* === V43 — Mobile compact Forecast widget on Dashboard === */
body.mob-active #forecast-widget-container,
body.mob-active .forecast-widget {
  padding: 10px 12px !important;
}
body.mob-active .forecast-bars-grid,
body.mob-active #forecast-bars-grid {
  display: flex !important;
  gap: 4px !important;
  align-items: flex-end !important;
  overflow-x: auto !important;
  padding-bottom: 4px !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
}
body.mob-active .forecast-bars-grid::-webkit-scrollbar { display: none; }
body.mob-active .forecast-bars-grid > div,
body.mob-active #forecast-bars-grid > div {
  min-width: 44px !important;
  flex: 1 !important;
  font-size: 9px !important;
}

/* === V43 — Mobile Kanban: vertical columns instead of horizontal === */
body.mob-active #tab-kanban .kanban,
body.mob-active .kanban-board {
  flex-direction: column !important;
  gap: 12px !important;
}
body.mob-active .kanban-col,
body.mob-active #tab-kanban [class*="kanban-col"] {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}

/* === V43 — Customer cards mobile (Customers 360°) === */
body.mob-active #tab-customers .table-wrap > div[style*="overflow-x:auto"],
body.mob-active #tab-customers .table-wrap table {
  display: none !important;
}
body.mob-active .v43-cust-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 12px 16px;
}
body.mob-active .v43-cust-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--v43-card-radius);
  padding: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
body.mob-active .v43-cust-card:active { transform: scale(.99); background: var(--bg3); }
body.mob-active .v43-cust-card-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
body.mob-active .v43-cust-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(59,130,246,.15);
  color: #60a5fa;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}
body.mob-active .v43-cust-info { flex: 1; min-width: 0; }
body.mob-active .v43-cust-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.mob-active .v43-cust-sub {
  font-size: 10px; color: var(--text2); margin-top: 2px;
}
body.mob-active .v43-cust-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px;
  padding-top: 8px; border-top: 1px solid var(--border);
  font-size: 10px;
}
body.mob-active .v43-cust-stat-lbl { color: var(--text3); }
body.mob-active .v43-cust-stat-val {
  color: var(--text); margin-top: 2px; font-weight: 600;
}
body.mob-active .v43-cust-stat-val.cyan { color: var(--cyan, #22d3ee); }

/* === V43 — Pipeline title badge: keep, just shrink slightly on mobile === */
body.mob-active #pl-forecast-badge {
  font-size: 10px !important;
  padding: 2px 7px !important;
}

/* === V43 — Hide noisy decorations on small screens === */
body.mob-active .fhero-img,
body.mob-active .billing-hero-img {
  display: none !important;
}

/* === V43 — Native form controls polish (Android-friendly) === */
body.mob-active select,
body.mob-active input[type="date"],
body.mob-active input[type="text"],
body.mob-active input[type="number"] {
  font-size: 16px !important;  /* Prevents iOS zoom + Android consistent */
  min-height: 40px;
}
body.mob-active .v43-sheet select,
body.mob-active .v43-sheet input {
  font-size: 14px !important;  /* Inside sheet, smaller is OK */
  min-height: 0;
}

/* === V43 — Search input in compact filter bar (slide-down) === */
body.mob-active .v43-search-wrap {
  display: none;
  padding: 0 12px 8px;
}
body.mob-active .v43-search-wrap.open { display: block; }
body.mob-active .v43-search-wrap input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 14px;
}

/* === V43.6 — Mobile PWA layout: no horizontal page scroll, nav/header fit === */
@media (max-width: 767px) {
  html {
    overflow-x: hidden;
    max-width: 100%;
  }
  body.mob-active {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
    scroll-padding-top: calc(
      var(--mobile-header-h, 54px) + 52px + env(safe-area-inset-top, 0)
    );
  }
  body.mob-active #app-shell,
  body.mob-active #v37-shell,
  body.mob-active .v37-app-main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  body.mob-active .content {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
}

body.mob-active .header {
  max-width: 100vw;
  width: 100%;
  min-width: 0;
  overflow: visible;
  box-sizing: border-box;
}
body.mob-active .v37-sidebar {
  display: none !important;
}
body.mob-active #v37-shell {
  display: block !important;
  width: 100% !important;
}
body.mob-active .logo-wrap {
  min-width: 0;
  flex: 0 1 auto;
  max-width: 42%;
  overflow: hidden;
}
body.mob-active .logo-text {
  min-width: 0;
  overflow: hidden;
}
body.mob-active .logo-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
body.mob-active .header-actions {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 58%;
  flex-shrink: 1;
  overflow: visible;
  justify-content: flex-end;
}
body.mob-active #h-excel-btn,
body.mob-active #current-user-badge {
  display: none !important;
}
body.mob-active #lang-btn {
  min-width: 36px;
  max-width: 44px;
  padding: 0 6px !important;
  flex-shrink: 0;
}
body.mob-active .notif-bell-wrap {
  flex-shrink: 0;
  position: relative;
  z-index: 62;
  overflow: visible;
}

body.mob-active .mob-top-tab {
  max-width: 100vw;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}
body.mob-active .mob-top-tab .tab-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
body.mob-active .mob-top-tab .tab-title #mob-tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
body.mob-active .mob-top-tab .tab-actions {
  flex-shrink: 0;
}

body.mob-active .mob-bottom-nav {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  justify-content: space-between;
  gap: 0;
  padding-top: 4px;
  padding-left: max(2px, env(safe-area-inset-left, 0));
  padding-right: max(2px, env(safe-area-inset-right, 0));
}
body.mob-active .mob-nav-item {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  padding: 4px 1px 0;
  height: auto;
  min-height: 44px;
  gap: 2px;
}
body.mob-active .mob-nav-item > span:not(.mob-nav-icon):not(.mob-nav-badge) {
  font-size: 9px;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
body.mob-active .mob-nav-item .mob-nav-icon {
  font-size: 20px;
}
body.mob-active .mob-nav-item.fab-slot {
  flex: 0 0 48px;
  min-width: 48px;
  max-width: 48px;
  width: 48px;
  padding: 0;
  visibility: hidden;
  pointer-events: none;
}
body.mob-active .mob-nav-badge {
  left: calc(50% + 6px);
  min-width: 16px;
  height: 16px;
  font-size: 8px;
  padding: 0 4px;
}

body.mob-active .content {
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}
body.mob-active .kpi-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
body.mob-active .kpi-card {
  min-width: 0;
}
body.mob-active .stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
body.mob-active .stat-card {
  min-width: 0;
}
body.mob-active .bar-row {
  min-width: 0;
  gap: 6px;
}
body.mob-active .bar-label {
  width: auto !important;
  flex: 0 1 38%;
  min-width: 0;
}
body.mob-active .bar-val {
  min-width: 0 !important;
  flex-shrink: 1;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.mob-active .fhero,
body.mob-active .fhero-sticky {
  max-width: 100%;
  overflow: hidden;
}
body.mob-active .v43-chips-strip {
  max-width: 100%;
}

@media (max-width: 480px) {
  body.mob-active .logo-name {
    font-size: 12px !important;
  }
  body.mob-active .app-version-badge {
    display: none;
  }
  body.mob-active .mob-nav-item .mob-nav-icon {
    font-size: 18px;
  }
  body.mob-active .mob-nav-item > span:not(.mob-nav-icon):not(.mob-nav-badge) {
    font-size: 8px;
    letter-spacing: 0;
  }
  body.mob-active .mob-nav-item.fab-slot {
    flex: 0 0 44px;
    min-width: 44px;
    max-width: 44px;
    width: 44px;
  }
  body.mob-active .kpi-value {
    font-size: 17px !important;
  }
  body.mob-active .header-actions .icon-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }
}

/* === V43.7 — Mobile PWA follow-up (video review) === */

/* FAB: sit clearly above bottom nav + safe area */
body.mob-active .mob-fab-container {
  bottom: calc(var(--mobile-bottom-nav-h, 56px) + 12px + env(safe-area-inset-bottom, 0)) !important;
}

/* Content clearance for FAB + bottom nav (KPI cards not hidden) */
body.mob-active .content,
body.mob-active .v37-app-main > .content {
  padding-bottom: calc(
    var(--mobile-bottom-nav-h, 56px) + var(--mobile-fab-size, 56px) * 0.45 + 20px + env(safe-area-inset-bottom, 0)
  ) !important;
  box-sizing: border-box;
}

/* Orphan V37 header chip bleeds on mobile — mob-top-tab + v43 bar are enough */
body.mob-active #v37-page-title-chip,
body.mob-active .v37-page-title-chip {
  display: none !important;
}

/* Duplicate chrome: tabs with V43 compact filter bar */
body.mob-active[data-mob-tab="dashboard"] #mob-top-tab,
body.mob-active[data-mob-tab="pipeline"] #mob-top-tab,
body.mob-active[data-mob-tab="reports"] #mob-top-tab,
body.mob-active[data-mob-tab="kanban"] #mob-top-tab,
body.mob-active[data-mob-tab="customers"] #mob-top-tab,
body.mob-active[data-mob-tab="billing"] #mob-top-tab {
  display: none !important;
}
body.mob-active #tab-dashboard > .fhero.fhero-sticky,
body.mob-active #tab-pipeline > .fhero.fhero-sticky,
body.mob-active #tab-reports > .fhero.fhero-sticky,
body.mob-active #tab-kanban > .fhero.fhero-sticky,
body.mob-active #tab-billing > .fhero.fhero-sticky {
  display: none !important;
  margin: 0 !important;
  min-height: 0 !important;
}
body.mob-active .v43-filter-bar {
  top: calc(54px + env(safe-area-inset-top, 0));
  margin-top: 0;
}

/* More drawer: keep sheet clipped; vertical scroll lives on .mob-drawer-body (iOS-safe) */
body.mob-active .mob-drawer {
  overflow: hidden;
}
body.mob-active .mob-drawer-body {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
body.mob-active .mob-drawer-list {
  overflow-x: hidden;
  max-width: 100%;
}
body.mob-active .mob-drawer-item {
  padding-inline: 16px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
body.mob-active .mob-drawer-item > span:not(.item-icon):not(.item-arrow):not(.item-count) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.mob-active .mob-drawer-section-title {
  padding-inline: 16px;
}

/* Sector performance summary: scroll inside table wrap only; hide Cycle + Collected */
body.mob-active #dash-sector-section {
  max-width: 100%;
  overflow-x: hidden;
}
body.mob-active #dash-sector-section .table-wrap {
  max-width: 100%;
  overflow-x: hidden;
}
body.mob-active #dash-sector-section div:has(#sec-summary-table) {
  max-width: 100%;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}
body.mob-active #sec-summary-table {
  min-width: 0;
  width: 100%;
}
body.mob-active #sec-summary-table th:nth-child(5),
body.mob-active #sec-summary-table td:nth-child(5),
body.mob-active #sec-summary-table th:nth-child(6),
body.mob-active #sec-summary-table td:nth-child(6) {
  display: none;
}

/* Closing forecast: horizontal scroll inside widget, smaller quarter cells */
body.mob-active #dash-forecast-body {
  overflow-x: hidden;
  max-width: 100%;
}
body.mob-active #dash-forecast-body > div:first-child {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 100%;
  grid-template-columns: unset !important;
}
body.mob-active #dash-forecast-body > div:first-child::-webkit-scrollbar {
  display: none;
}
body.mob-active #dash-forecast-body > div:first-child > div {
  flex: 0 0 50px !important;
  min-width: 50px !important;
  max-width: 56px !important;
  padding: 8px 4px !important;
  font-size: 9px !important;
}
body.mob-active #dash-forecast-body > div:first-child > div [style*="font-size:10px"] {
  font-size: 8px !important;
}
body.mob-active #dash-forecast-body > div:first-child > div [style*="font-size:13px"] {
  font-size: 11px !important;
}

@media (max-width: 767px) {
  body.mob-active #app-shell,
  body.mob-active #v37-shell,
  body.mob-active .v37-app-main {
    overflow-x: hidden;
  }
}

/* === V43.8 — Mobile dashboard: filter bar clearance + sector comparison fit === */
body.mob-active {
  --v43-filter-bar-h: 52px;
}

@media (max-width: 767px) {
  body.mob-active {
    scroll-padding-top: calc(
      var(--mobile-header-h, 54px) + var(--v43-filter-bar-h, 52px) + env(safe-area-inset-top, 0) + 8px
    );
  }
}

/* Sticky filter bar: sit below header only (mob-top-tab hidden on dashboard) */
body.mob-active .v43-filter-bar {
  top: calc(var(--mobile-header-h, 54px) + env(safe-area-inset-top, 0)) !important;
  z-index: 48;
  background: var(--bg2);
  box-shadow: 0 1px 0 var(--border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

body.mob-active #tab-dashboard > .v43-chips-strip:not(:empty) {
  position: sticky;
  top: calc(var(--mobile-header-h, 54px) + var(--v43-filter-bar-h, 52px) + env(safe-area-inset-top, 0));
  z-index: 47;
  background: var(--bg);
  margin-bottom: 8px;
}

/* KPI grid starts below sticky chrome, not underneath it */
body.mob-active #tab-dashboard > #kpi-grid {
  scroll-margin-top: calc(
    var(--mobile-header-h, 54px) + var(--v43-filter-bar-h, 52px) + env(safe-area-inset-top, 0) + 12px
  );
  margin-top: 4px;
  position: relative;
  z-index: 1;
  overflow: visible;
}
body.mob-active #tab-dashboard > #kpi-grid .kpi-card,
body.mob-active #tab-dashboard > #kpi-grid .kpi-value {
  overflow: visible;
}
body.mob-active #tab-dashboard > #kpi-grid .kpi-value {
  line-height: 1.2 !important;
}

body.mob-active #tab-dashboard > .fhero.fhero-sticky {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow: hidden !important;
}

/* Sector comparison — no horizontal page scroll */
body.mob-active #dash-sector-section {
  max-width: 100%;
  overflow-x: hidden !important;
}
body.mob-active #dash-sector-section > .table-wrap {
  overflow-x: hidden !important;
  max-width: 100%;
}
body.mob-active #dash-sector-section > .table-wrap > div[style*="padding"] {
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Donut + legend: stack vertically on mobile */
body.mob-active .v43-sector-donut-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
  align-items: center !important;
  max-width: 100%;
  overflow-x: hidden;
}
body.mob-active .v43-sector-donut-grid > div:first-child {
  position: relative;
  height: 180px !important;
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
}
body.mob-active .v43-sector-donut-grid canvas {
  max-width: 100% !important;
}
body.mob-active #sec-total-legend {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
body.mob-active #sec-total-legend > div {
  min-width: 0;
  max-width: 100%;
}

/* Sector KPI cards: 2-col then 1-col on very narrow */
body.mob-active #sec-kpi-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  max-width: 100%;
  overflow-x: hidden;
}
@media (max-width: 420px) {
  body.mob-active #sec-kpi-cards {
    grid-template-columns: 1fr !important;
  }
}

/* Win/cycle + count/coll chart rows: single column */
body.mob-active .v43-sector-split-grid {
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  max-width: 100%;
  overflow-x: hidden;
}

body.mob-active #dash-sector-section [style*="position:relative"] {
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}
body.mob-active #dash-sector-section canvas {
  max-width: 100% !important;
}

/* V43.2 set sector section overflow-x:auto — keep charts inside, not the page */
body.mob-active #dash-sector-section.dash-chart-card,
body.mob-active #dash-sector-section {
  overflow-x: hidden !important;
}

/* === V43.9 — Mobile dashboard: filter clearance + sector charts fit (no H-scroll) === */
body.mob-active #tab-dashboard > .v43-filter-bar {
  margin-bottom: 12px !important;
}

body.mob-active #tab-dashboard > #kpi-grid {
  padding-top: 8px !important;
  margin-top: 0 !important;
}

body.mob-active #tab-dashboard > #kpi-grid,
body.mob-active #tab-dashboard > #dash-charts-row1,
body.mob-active #tab-dashboard > #dash-charts-row2,
body.mob-active #tab-dashboard > #dash-forecast-section,
body.mob-active #tab-dashboard > #dash-sector-section {
  scroll-margin-top: calc(
    var(--mobile-header-h, 54px) + var(--v43-filter-bar-h, 52px) + env(safe-area-inset-top, 0) + 16px
  );
  max-width: 100%;
  box-sizing: border-box;
}

body.mob-active #dash-charts-row1,
body.mob-active #dash-charts-row2 {
  grid-template-columns: 1fr !important;
  overflow-x: hidden !important;
}

body.mob-active #dash-sector-section .table-header {
  flex-wrap: wrap !important;
  align-items: flex-start !important;
  gap: 4px !important;
}
body.mob-active #dash-sector-subtitle {
  flex: 1 1 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  white-space: normal !important;
  line-height: 1.35;
}

body.mob-active #sec-kpi-cards {
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}
body.mob-active #sec-kpi-cards > div {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

body.mob-active #sec-total-legend > div {
  flex-wrap: wrap !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}
body.mob-active #sec-total-legend > div span {
  min-width: 0 !important;
}

body.mob-active #dash-sector-section > .table-wrap > div[style*="padding"] {
  padding-left: 12px !important;
  padding-right: 12px !important;
}

/* === V43.10 — Mobile stacking: header → alerts → filters → content (no overlap) === */

/* Hide ALL sticky fhero filter rows on mobile — mob-top-tab + v43-filter-bar replace them */
body.mob-active .fhero.fhero-sticky {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* Dashboard notification banners sit above the filter bar, never behind it */
body.mob-active #notif-dashboard-banner {
  position: relative;
  z-index: 49;
  margin: 0 0 10px !important;
  scroll-margin-top: calc(var(--mobile-header-h, 54px) + env(safe-area-inset-top, 0) + 8px);
}
body.mob-active #notif-dashboard-banner .notif-banner-card {
  position: relative;
  z-index: 1;
}

/* Filter bar below alerts; sticky under header when mob-top-tab is hidden */
body.mob-active .v43-filter-bar {
  z-index: 48;
  margin-top: 2px;
}

/* Tabs using mob-top-tab: give page content room below the sticky tab strip */
body.mob-active #tab-followups > .two-col,
body.mob-active #tab-today > #today-content,
body.mob-active #tab-activity > .table-wrap,
body.mob-active #tab-leads > .table-wrap,
body.mob-active #tab-leadactivity > .table-wrap,
body.mob-active #tab-myperf > .table-wrap,
body.mob-active #tab-funnel > .table-wrap,
body.mob-active #tab-audit > .table-wrap {
  scroll-margin-top: calc(var(--mobile-header-h, 54px) + 49px + env(safe-area-inset-top, 0) + 10px);
  padding-top: 6px;
}

body.mob-active #tab-followups > .two-col {
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}

/* First screen: small gap between header and scrollable content */
body.mob-active .content {
  padding-top: 10px !important;
}

/* mob-top-tab: consistent height for scroll-margin calculations */
body.mob-active .mob-top-tab {
  min-height: 49px;
  box-sizing: border-box;
}

/* === V43.11 — Customers 360 + Pipeline: filter stack clearance (no overlap) === */

/* Pipeline: hide empty desktop table shell on mobile; cards only */
body.mob-active #tab-pipeline > .table-wrap {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: none !important;
}

/* Customers: filter bar already shows title — hide duplicate v36 header title */
body.mob-active #tab-customers > .v36-screen-header {
  margin: 0 0 8px !important;
  padding: 0 !important;
  gap: 8px !important;
}
body.mob-active #tab-customers > .v36-screen-header .v36-screen-title,
body.mob-active #tab-customers > .v36-screen-header .v36-screen-sub,
body.mob-active #tab-customers > .v36-screen-header #cust-subtitle {
  display: none !important;
}
body.mob-active #tab-customers > .v36-period-tabs {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
  max-width: 100%;
  box-sizing: border-box;
}

/* Duplicate v43 card host not used — cust-list-container renders cards */
body.mob-active #tab-customers > .v43-cust-cards {
  display: none !important;
}

/* Shared sticky filter stack offset for tabs without mob-top-tab */
body.mob-active #tab-pipeline > .v43-deal-cards,
body.mob-active #tab-customers > .v36-screen-header,
body.mob-active #tab-customers > .v36-period-tabs,
body.mob-active #tab-customers #cust-list-container,
body.mob-active #tab-pipeline > .v43-chips-strip,
body.mob-active #tab-customers > .v43-chips-strip {
  scroll-margin-top: calc(
    var(--mobile-header-h, 54px) + var(--v43-filter-bar-h, 52px) + env(safe-area-inset-top, 0) + 14px
  );
}

body.mob-active #tab-pipeline > .v43-deal-cards,
body.mob-active #tab-customers #cust-list-container {
  position: relative;
  z-index: 1;
  padding-top: 6px;
}

body.mob-active #tab-pipeline > .v43-filter-bar,
body.mob-active #tab-customers > .v43-filter-bar {
  margin-bottom: 12px !important;
}

/* Chips on pipeline/customers scroll with page (avoid double-sticky stack) */
body.mob-active #tab-pipeline > .v43-chips-strip,
body.mob-active #tab-customers > .v43-chips-strip {
  position: relative !important;
  top: auto !important;
  z-index: 1;
  margin-bottom: 8px;
}

body.mob-active #tab-customers .v36-cust-grid {
  gap: 10px !important;
}
body.mob-active #tab-customers .v36-cust-card {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* === V43.8 — Analog clock time picker (Activity Log) === */
.v43-date-time-wrap {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
}
.v43-analog-time-host {
  position: relative;
  min-width: 90px;
}
.v43-at-btn {
  width: 100%;
  height: 32px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text3);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.v43-at-btn.has-value {
  color: var(--text);
  border-color: var(--border);
}
.v43-at-btn:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 1px;
}
.v43-at-btn-ico {
  opacity: 0.55;
  font-size: 11px;
}
.v43-at-popover {
  display: none;
  position: fixed;
  z-index: 12050;
  width: 280px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.v43-at-popover.open {
  display: block;
}
.v43-at-head {
  padding: 12px 14px 8px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.v43-at-head-lbl {
  font-size: 10px;
  color: var(--text3);
  margin-bottom: 8px;
}
.v43-at-digital {
  display: flex;
  align-items: center;
  gap: 4px;
}
.v43-at-seg {
  border: none;
  background: transparent;
  color: var(--text2);
  font-size: 22px;
  font-weight: 700;
  font-family: inherit;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.v43-at-seg.active {
  background: var(--blue);
  color: #fff;
}
.v43-at-colon {
  font-size: 20px;
  color: var(--text3);
}
.v43-at-ampm {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.v43-at-ampm-btn {
  border: 1px solid var(--border2);
  background: var(--bg2);
  color: var(--text2);
  border-radius: 6px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.v43-at-ampm-btn.active {
  background: rgba(59, 130, 246, 0.18);
  border-color: var(--blue);
  color: #60a5fa;
}
.v43-at-hint {
  font-size: 10px;
  color: var(--text3);
  margin-top: 8px;
}
.v43-at-dial-wrap {
  padding: 6px 8px 10px;
  display: flex;
  justify-content: center;
}
.v43-at-dial {
  display: block;
  max-width: 100%;
  height: auto;
}
.v43-at-face {
  fill: var(--bg3);
  stroke: var(--border2);
  stroke-width: 1.5;
}
.v43-at-hub {
  fill: var(--blue);
}
.v43-at-hand {
  stroke: var(--blue);
  stroke-width: 3;
  stroke-linecap: round;
}
.v43-at-hand-dot {
  fill: var(--blue);
}
.v43-at-num-bg {
  fill: transparent;
}
.v43-at-num-bg.sel {
  fill: var(--blue);
}
.v43-at-num-txt {
  fill: var(--text2);
  font-size: 12px;
  font-family: inherit;
  pointer-events: none;
}
.v43-at-num-txt.sel {
  fill: #fff;
  font-weight: 600;
}
.v43-at-num-g {
  cursor: pointer;
}
.v43-at-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 12px 12px;
}
.v43-at-cancel {
  color: var(--text2);
}
body.mob-active .v43-at-popover {
  width: min(300px, calc(100vw - 24px));
  left: 12px !important;
  right: 12px;
  margin: 0 auto;
}
body.mob-active .v43-at-btn {
  min-height: 40px;
  font-size: 14px;
}
