/* ──────────────────────────────────────────────────────────
 * Baraka Portal — Design System v2 (2026-05-09)
 * Refined: tighter shadows, calmer borders, better hierarchy.
 * Brand palette stays — green/gold — but with broader scale.
 * ────────────────────────────────────────────────────────── */

:root {
  /* ATEN Brand — purple + gold */
  --brand-green:      #4B52C8;        /* purple (kept var name for backward compat) */
  --brand-green-dark: #3B40A0;
  --brand-green-50:   #eef0fd;
  --brand-green-100:  #d8dcf8;
  --brand-gold:       #D4A017;
  --brand-gold-light: #E5B042;
  --brand-gold-50:    #fdf6e3;
  --brand-cream:      #F5F3FF;
  --brand-brown:      #3B40A0;

  /* ── Semantic brand aliases (added 2026-07 identity-unification pass) ──
   * Canonical --brand-green / --brand-gold are KEPT for backward compat (no mass
   * rename). These aliases give clearer names + a gradient/on-color/display-font
   * hook that theme-boot.js and vertical-labels.js applyBranding() override per
   * tenant. Default values below reproduce the current ATEN-purple look exactly. */
  --brand-primary:        var(--brand-green);        /* #4B52C8 default */
  --brand-primary-dark:   var(--brand-green-dark);   /* #3B40A0 default (unchanged) */
  --brand-primary-darker: #333788;                   /* only consumed once a tenant sets it */
  --brand-accent:         var(--brand-gold);
  --brand-accent-light:   var(--brand-gold-light);
  --brand-on-primary:     #ffffff;                   /* text/icon color on the brand surface */
  --brand-grad:           linear-gradient(150deg, var(--brand-green), var(--brand-green-dark));
  /* a11y GUARD: the Smart Group gold #C9A227 is ~2.9:1 on white — use it ONLY for
   * large text / borders / icons / text-on-navy, NEVER body text on a light surface. */
  --brand-font-display:   'Cairo', sans-serif;       /* tenants (e.g. Smart Group) override → 'Reem Kufi' */

  /* Surface */
  --bg:               #FAFAFC;
  --surface:          #FFFFFF;
  --surface-alt:      #F7F7FB;

  /* Borders */
  --border:           #E5E5EF;
  --border-strong:    #C7C7D6;
  --border-soft:      #F0F0F7;

  /* Ink */
  --ink:              #1A1A1A;
  --ink-2:            #555;
  --ink-3:            #64707F;   /* a11y: darkened from #888 → WCAG 4.5:1 on light surfaces (worst case 4.60:1 on --brand-cream (#F5F3FF); --bg = 4.84:1).
                                    GUARD: do NOT use --ink-3 for text on --brand-green-50 (#eef0fd) or any lighter/comparable tint — contrast drops to 4.445:1 (< 4.5). Use --ink-2 or --ink there. */
  --ink-4:            #AAA;

  /* Focus ring (keyboard a11y) — derives from brand color, adapts per tenant */
  --focus-ring:       var(--brand-green);

  /* Accent (status) */
  --success:          #16a34a;
  --warning:          #C8921A;
  --danger:           #DC2626;
  --info:             #2563eb;

  /* Shadows */
  --shadow-1: 0 1px 2px rgba(20, 30, 10, .04);
  --shadow-2: 0 2px 6px rgba(20, 30, 10, .06), 0 1px 2px rgba(20, 30, 10, .04);
  --shadow-3: 0 8px 24px rgba(20, 30, 10, .08), 0 2px 6px rgba(20, 30, 10, .05);
  --shadow-modal: 0 20px 60px rgba(0, 0, 0, .25);

  /* Radii */
  --r-sm: .5rem;
  --r-md: .75rem;
  --r-lg: 1rem;
  --r-xl: 1.25rem;
  --r-pill: 999px;

  /* Spacing scale (4/8/12/16/24/32/48) */
  --s-1: .25rem;
  --s-2: .5rem;
  --s-3: .75rem;
  --s-4: 1rem;
  --s-6: 1.5rem;
  --s-8: 2rem;
  --s-12: 3rem;
}

* { font-family: 'Cairo', sans-serif; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
/* Clip any horizontal overflow at the viewport root so the off-canvas mobile
 * drawer (.bp-drawer, position:fixed + translateX(100%)) — and any stray wide
 * element — can never create a horizontal scrollbar. `clip` (not `hidden`) does
 * NOT establish a scroll container, so the sticky .bp-nav keeps sticking and
 * vertical scrolling is untouched. Applies at every width; desktop content lives
 * inside the viewport and legitimately-wide tables scroll inside their own
 * .overflow-x-auto wrappers, so nothing meaningful is ever clipped. */
html { overflow-x: clip; }
body { background: var(--bg); color: var(--ink); line-height: 1.55; overflow-x: clip; }

/* ─── Typography ─── */
h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; font-weight: 700; }
.text-eyebrow { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); }
.text-mono-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ─── Brand utilities ─── */
.bg-brand-green       { background-color: var(--brand-green); }
.bg-brand-green-dark  { background-color: var(--brand-green-dark); }
.bg-brand-gold        { background-color: var(--brand-gold); }
.bg-brand-gold-light  { background-color: var(--brand-gold-light); }
.bg-brand-cream       { background-color: var(--brand-cream); }
.bg-brand-bg          { background-color: var(--bg); }
.text-brand-green     { color: var(--brand-green); }
.text-brand-gold      { color: var(--brand-gold); }
.text-brand-gold-light{ color: var(--brand-gold-light); }
.text-brand-brown     { color: var(--brand-brown); }
.border-brand-green   { border-color: var(--brand-green); }
.border-brand-gold    { border-color: var(--brand-gold); }

/* ─── Animations ─── */
@keyframes bp-fade-up { from { opacity:0; transform:translateY(6px);} to { opacity:1; transform:translateY(0);} }
@keyframes bp-fade-in { from { opacity:0;} to { opacity:1;} }
@keyframes bp-skeleton-pulse { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.animate-fadeUp { animation: bp-fade-up .25s cubic-bezier(.4, 0, .2, 1) both; }
.animate-fadeIn { animation: bp-fade-in .2s ease both; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-green); }

/* ─── Card ─── */
.bp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: var(--shadow-1);
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.bp-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.bp-card.is-clickable { cursor: pointer; }
.bp-card.is-clickable:active { transform: scale(.995); }
.bp-card.is-flat { box-shadow: none; }
.bp-card.is-strong { border-width: 2px; border-color: var(--brand-green); }

/* Hero/greeting card — brand-gradient surface (variant that survives baraka.css
 * load order; replaces the old .bp-card + tailwind gradient combo the bp-card
 * background shorthand was resetting to white). Same box metrics as .bp-card. */
.bp-hero-card {
  background: var(--brand-grad);
  color: var(--brand-on-primary);
  border: 0;
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: var(--shadow-1);
}

/* Stale highlight (CRM lead aging) */
.stale-amber { border-color: var(--brand-gold) !important; box-shadow: inset 4px 0 0 var(--brand-gold), var(--shadow-1); }
.stale-red   { border-color: var(--danger) !important; box-shadow: inset 4px 0 0 var(--danger), var(--shadow-1); }

/* ─── Section heading (above a card group) ─── */
.bp-section-title {
  font-size: .9rem; font-weight: 800; color: var(--brand-green);
  display: flex; align-items: center; gap: var(--s-2);
  margin-bottom: var(--s-2);
}
.bp-section-title .count { color: var(--ink-3); font-weight: 600; font-size: .75rem; }

/* ─── Buttons ─── */
.bp-btn-primary, .bp-btn-gold, .bp-btn-ghost, .bp-btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  font-weight: 700;
  border-radius: var(--r-md);
  transition: background .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease;
  cursor: pointer;
  user-select: none;
}
.bp-btn-primary {
  background: var(--brand-green); color: white;
  padding: .65rem 1.1rem;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), inset 0 -1px 0 rgba(0,0,0,.1);
}
.bp-btn-primary:hover { background: var(--brand-green-dark); }
.bp-btn-primary:active { transform: scale(.97); }
.bp-btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.bp-btn-gold {
  background: var(--brand-gold); color: var(--brand-green-dark);
  padding: .55rem 1rem;
  box-shadow: 0 1px 0 rgba(0,0,0,.05), inset 0 -1px 0 rgba(0,0,0,.08);
}
.bp-btn-gold:hover { background: var(--brand-gold-light); }
.bp-btn-gold:active { transform: scale(.97); }

.bp-btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: .5rem .9rem;
}
.bp-btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-alt); }
.bp-btn-ghost:active { transform: scale(.97); }

.bp-btn-danger {
  background: #fef2f2; color: var(--danger);
  border: 1px solid #fecaca;
  padding: .5rem .9rem;
}
.bp-btn-danger:hover { background: #fee2e2; border-color: #fca5a5; }

.bp-btn-sm { font-size: .75rem; padding: .4rem .75rem; }
.bp-btn-lg { font-size: 1rem; padding: .85rem 1.5rem; }

/* ─── Inputs ─── */
.bp-input, .bp-select, .bp-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: .65rem .9rem;
  font-size: .95rem;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  background: var(--surface);
  color: var(--ink);
}
.bp-input:focus, .bp-select:focus, .bp-textarea:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(75, 82, 200, .15); /* fallback for browsers without color-mix */
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-green) 22%, transparent);
}
.bp-input::placeholder { color: var(--ink-4); }
.bp-textarea { min-height: 5rem; resize: vertical; }

/* ─── Keyboard focus (a11y — WCAG 2.2 SC 2.4.7 / 2.4.13) ───
 * Visible ring only for keyboard/AT users (:focus-visible), never on mouse click.
 * :where() keeps specificity 0 so page-level styles can still override.
 * Ring color derives from the brand var → auto-adapts per tenant branding. */
:where(a, button, input, select, textarea, summary, [role="button"], [tabindex]:not([tabindex="-1"]),
  .bp-btn-primary, .bp-btn-gold, .bp-btn-ghost, .bp-btn-danger,
  .bp-nav-tab, .bp-drawer-item, .bp-bottom-tab, .bp-fab):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
/* On the dark brand-colored top nav, a brand-colored ring would be invisible → use a light ring. */
.bp-nav :where(a, button):focus-visible,
.bp-nav-tab:focus-visible,
.bp-hamburger:focus-visible {
  outline-color: #fff;
}

/* ─── Badges / pills ─── */
.bp-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.bp-pill-green { background: var(--brand-green-50); color: var(--brand-green); }
.bp-pill-gold  { background: var(--brand-gold-50); color: var(--brand-brown); }
.bp-pill-blue  { background: #eff6ff; color: var(--info); }
.bp-pill-red   { background: #fef2f2; color: var(--danger); }
.bp-pill-gray  { background: #f3f4f6; color: #4b5563; }
.bp-pill-purple{ background: #f5f3ff; color: #7c3aed; }
.bp-pill-amber { background: #fffbeb; color: #b45309; }

/* ─── Divider ─── */
.bp-divider { height: 1px; background: var(--border-soft); margin: var(--s-3) 0; }

/* ─── KPI tile (used on home/manager) ─── */
.bp-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-3);
  text-align: center;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.bp-kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow-1); }
.bp-kpi-value { font-size: 1.5rem; font-weight: 800; color: var(--brand-green); line-height: 1.1; font-variant-numeric: tabular-nums; }
.bp-kpi-label { font-size: 11px; color: var(--ink-3); margin-top: 4px; font-weight: 600; }

/* ─── Skeleton (loading state) ─── */
.bp-skeleton {
  display: inline-block;
  background: linear-gradient(90deg, #eee 25%, #f8f8f8 50%, #eee 75%);
  background-size: 200% 100%;
  animation: bp-skeleton-pulse 1.4s ease-in-out infinite;
  border-radius: 4px;
  color: transparent !important;
  user-select: none;
}
.bp-skeleton-text { height: .9em; width: 4ch; vertical-align: -0.1em; }
.bp-skeleton-line { height: .9em; width: 100%; display: block; margin: .25em 0; }

/* ─── Empty state ─── */
.bp-empty {
  padding: var(--s-8) var(--s-4);
  text-align: center;
  color: var(--ink-3);
}
.bp-empty-icon { font-size: 2.75rem; margin-bottom: var(--s-2); display: block; opacity: .65; }
.bp-empty-title { font-weight: 800; color: var(--ink-2); margin-bottom: 4px; }
.bp-empty-sub { font-size: .85rem; }

/* ─── Modal sheet (works on mobile + desktop) ─── */
.bp-modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, .55);
  display: flex; align-items: flex-end; justify-content: center;
  padding: var(--s-3);
  animation: bp-fade-in .15s ease both;
}
@media (min-width: 640px) {
  .bp-modal-backdrop { align-items: center; }
}
.bp-modal {
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%;
  max-width: 32rem;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  animation: bp-fade-up .2s cubic-bezier(.4, 0, .2, 1) both;
}
@media (min-width: 640px) {
  .bp-modal { border-radius: var(--r-xl); }
}

/* ─── Print ─── */
@media print {
  .no-print { display: none !important; }
  body { background: white !important; padding-bottom: 0 !important; }
  .bp-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}

/* ──────────────────────────────────────────────────────────
 *  NAVIGATION (top bar + drawer + bottom bar)
 * ────────────────────────────────────────────────────────── */

.bp-nav {
  background: var(--brand-green);
  color: white;
  padding: .7rem 1rem;
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
  position: sticky; top: 0; z-index: 40;
}
.bp-nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.bp-nav-brand { font-weight: 800; font-size: 1.05rem; color: white; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: .5rem; }
.bp-nav-brand .gold { color: var(--brand-gold-light); }
.bp-nav-logo { height: 26px; width: 26px; object-fit: contain; background: white; border-radius: 4px; padding: 2px; }
.bp-drawer-logo { height: 30px; width: 30px; object-fit: contain; background: #f4f4f4; border-radius: 4px; padding: 3px; }
.bp-nav-tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.bp-nav-tab {
  padding: .4rem .8rem;
  border-radius: .5rem;
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.bp-nav-tab:hover  { background: rgba(255,255,255,.1); color: white; }
.bp-nav-tab.active { background: var(--brand-gold); color: var(--brand-green-dark); font-weight: 700; }

/* Hamburger */
.bp-hamburger {
  background: rgba(255,255,255,.12);
  color: white;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: .5rem;
  cursor: pointer;
  transition: background .15s ease;
}
.bp-hamburger:hover { background: rgba(255,255,255,.2); }
.bp-hamburger:active { transform: scale(.94); }

/* Mobile drawer */
.bp-drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 49;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.bp-drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.bp-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 84%; max-width: 320px;
  background: var(--surface);
  z-index: 50;
  transform: translateX(100%);
  /* closed: hidden so this off-canvas fixed panel can't extend the layout viewport
     (a fixed element escapes html/body overflow clipping, so translateX alone leaks
     ~97px of horizontal scroll on mobile — visibility:hidden removes it from layout). */
  visibility: hidden;
  transition: transform .25s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .25s;
  display: flex; flex-direction: column;
  box-shadow: -8px 0 30px rgba(0,0,0,.12);
}
.bp-drawer.open { transform: translateX(0); visibility: visible; transition: transform .25s cubic-bezier(.4, 0, .2, 1), visibility 0s linear 0s; }

.bp-drawer-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.bp-drawer-close {
  position: absolute;
  top: .85rem; left: .85rem;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #f3f4f6;
  color: #555;
  font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s ease;
}
.bp-drawer-close:hover { background: #e5e7eb; }

.bp-drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-2) 0;
  display: flex; flex-direction: column;
}
.bp-drawer-item {
  display: flex; align-items: center;
  gap: .85rem;
  padding: .85rem 1.25rem;
  font-weight: 600; font-size: .95rem;
  color: var(--ink);
  border-right: 3px solid transparent;
  transition: background .15s ease, border-color .15s ease;
  min-height: 48px;
}
.bp-drawer-item:hover { background: var(--surface-alt); }
.bp-drawer-item.active {
  background: var(--brand-cream);
  color: var(--brand-green);
  border-right-color: var(--brand-green);
  font-weight: 700;
}
.bp-drawer-icon { font-size: 1.2rem; width: 1.5rem; text-align: center; }

/* Drawer sections (grouped nav) */
.bp-drawer-section { padding: .5rem 0 .25rem; border-bottom: 1px solid var(--border); }
.bp-drawer-section:last-child { border-bottom: none; }
.bp-drawer-section-title {
  padding: .65rem 1.25rem .35rem;
  font-size: .72rem;
  font-weight: 800;
  color: var(--ink-mute, #6b7280);
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .7;
}

/* "More" button on top bar */
.bp-nav-more {
  background: rgba(255,255,255,.18) !important;
  border: 1px dashed rgba(255,255,255,.3);
  cursor: pointer;
  font-family: inherit;
}
.bp-nav-more:hover { background: rgba(255,255,255,.28) !important; }

.bp-drawer-footer {
  padding: var(--s-3) 1.25rem;
  border-top: 1px solid var(--border);
}
.bp-drawer-signout {
  width: 100%;
  background: #fef2f2; color: #991b1b;
  font-weight: 700;
  padding: .75rem;
  border-radius: var(--r-md);
  font-size: .9rem;
  border: 1px solid #fecaca;
  transition: background .15s ease;
}
.bp-drawer-signout:hover { background: #fee2e2; }

/* Mobile bottom bar */
.bp-bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255, 255, 255, .98);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-top: 1px solid var(--border);
  padding: .3rem .25rem;
  padding-bottom: max(.3rem, env(safe-area-inset-bottom));
  display: flex; justify-content: space-around;
  z-index: 30;
}
.bp-bottom-tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
  padding: .45rem .2rem;
  font-size: .7rem;
  font-weight: 600;
  color: var(--ink-3);
  border-radius: var(--r-sm);
  min-width: 0; min-height: 56px;
  justify-content: center;
  transition: color .15s ease, background .15s ease;
}
.bp-bottom-tab:hover { background: var(--surface-alt); }
.bp-bottom-tab.active { color: var(--brand-green); background: rgba(45, 80, 22, 0.06); }
.bp-bottom-tab.active .bp-bottom-icon { transform: scale(1.15); }
.bp-bottom-icon { font-size: 1.45rem; line-height: 1; transition: transform .15s ease; }
.bp-bottom-label {
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
  font-weight: 700;
}

/* ─── Floating Action Button (FAB) ─── */
.bp-fab {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  right: 16px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D4A017, #B8881F);
  color: #1F3A0F;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(212, 160, 23, .4), 0 2px 6px rgba(0,0,0,.15);
  z-index: 35;
  border: none;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.4, 0, .2, 1), box-shadow .2s ease;
}
.bp-fab:hover { transform: scale(1.05); box-shadow: 0 8px 20px rgba(212, 160, 23, .5); }
.bp-fab:active { transform: scale(.95); }
.bp-fab.open { transform: rotate(45deg); background: linear-gradient(135deg, #C4302B, #A02622); color: white; }
.bp-fab.open:hover { transform: rotate(45deg) scale(1.05); }

@media (min-width: 768px) {
  .bp-fab { bottom: 24px; right: 24px; }
}

.bp-fab-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
  z-index: 33;
}
.bp-fab-backdrop.open { opacity: 1; pointer-events: auto; }

.bp-fab-sheet {
  position: fixed;
  bottom: calc(140px + env(safe-area-inset-bottom, 0px));
  right: 16px;
  display: flex; flex-direction: column; gap: 12px;
  align-items: flex-end;
  z-index: 34;
  opacity: 0; pointer-events: none;
  transform: translateY(12px);
  transition: opacity .25s ease, transform .25s cubic-bezier(.4, 0, .2, 1);
}
.bp-fab-sheet.open { opacity: 1; pointer-events: auto; transform: translateY(0); }

@media (min-width: 768px) {
  .bp-fab-sheet { bottom: 92px; right: 24px; }
}

.bp-fab-action {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  animation: bp-fade-up .25s ease both;
}
.bp-fab-sheet.open .bp-fab-action:nth-child(1) { animation-delay: .03s; }
.bp-fab-sheet.open .bp-fab-action:nth-child(2) { animation-delay: .06s; }
.bp-fab-sheet.open .bp-fab-action:nth-child(3) { animation-delay: .09s; }

.bp-fab-action-label {
  background: white;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .85rem;
  color: var(--ink-1);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  white-space: nowrap;
}
.bp-fab-action-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* Mobile-first body padding for bottom bar */
@media (max-width: 767px) {
  body { padding-bottom: 76px; }
  .bp-nav-tab  { padding: .35rem .6rem; font-size: .75rem; }
  .bp-nav-brand { font-size: 1rem; }
  .bp-btn-primary, .bp-btn-gold, .bp-btn-ghost, .bp-btn-danger { min-height: 44px; }
  .bp-input, .bp-select, .bp-textarea { min-height: 44px; font-size: 16px; /* prevents iOS zoom */ }
  /* Touch target ≥44px (Apple HIG / WCAG 2.5.5) for the mobile drawer trigger. */
  .bp-hamburger { width: 44px; height: 44px; }
  h1 { font-size: 1.25rem; }
  h2 { font-size: 1.1rem; }
}

@media print {
  .bp-bottom-bar, .bp-drawer, .bp-drawer-backdrop, .bp-hamburger { display: none !important; }
}

/* ──────────────────────────────────────────────────────────
 *  DESKTOP SHELL (≥1024px) — fixed sidebar + topbar
 *  Unifies every nav.js page with the desktop.html SaaS look WITHOUT touching a
 *  single page body. Rendered by bpRenderNav(); shown ONLY ≥1024px. Below that it
 *  is hidden and the sticky .bp-nav + drawer + bottom-bar (mobile/tablet) stay
 *  exactly as before. Colors bind to the tenant theme vars (navy for Smart Group,
 *  purple default); the neutral greys are the fixed semantic tokens from
 *  desktop.html. body.bp-shell scope keeps pages with their own shell that also
 *  load baraka.css (e.g. manager.html) from being pushed.
 * ────────────────────────────────────────────────────────── */
.bp-shell-sidebar, .bp-shell-topbar { display: none; }

@media (min-width: 1024px) {
  body.bp-shell { padding-right: 252px; padding-top: 70px; }
  body.bp-shell .bp-nav { display: none; }
  body.bp-shell .bp-bottom-bar,
  body.bp-shell .bp-fab,
  body.bp-shell .bp-fab-backdrop,
  body.bp-shell .bp-fab-sheet { display: none; }

  .bp-shell-sidebar {
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; right: 0;
    width: 252px;
    background: #fff;
    border-left: 1px solid #E9EDF3;
    padding: 20px 16px;
    z-index: 45;
    overflow: hidden;
  }
  .bp-shell-topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; top: 0; right: 252px; left: 0;
    height: 70px;
    background: #fff;
    border-bottom: 1px solid #E9EDF3;
    padding: 0 26px;
    z-index: 44;
  }
}

/* ── Sidebar: brand ── */
.bp-shell-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; text-decoration: none; flex-shrink: 0; }
.bp-shell-logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(150deg, #FDB813, #F5821F);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 17px; flex-shrink: 0;
  font-family: var(--brand-font-display);
}
.bp-shell-brand-text { display: flex; flex-direction: column; min-width: 0; }
.bp-shell-brand-name {
  font-size: 16px; font-weight: 700; color: var(--app-ink, #0F1B2D); line-height: 1;
  font-family: var(--brand-font-display);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bp-shell-brand-sub { font-size: 11px; color: #64707F; margin-top: 3px; }

/* ── Sidebar: nav ── */
.bp-shell-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; min-height: 0; overflow-y: auto; }
.bp-shell-nav-title { font-size: 11px; font-weight: 600; color: #64707F; padding: 14px 10px 6px; }
.bp-shell-nav-title:first-child { padding-top: 4px; }
.bp-shell-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 11px;
  font-size: 14px; font-weight: 500; color: #5B6B82;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.bp-shell-nav-item:hover { background: #F2F5FA; }
.bp-shell-nav-item.active { background: #EFF4FE; color: var(--brand-primary-dark); font-weight: 600; }
.bp-shell-nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

/* ── Sidebar: user card ── */
.bp-shell-user {
  display: flex; align-items: center; gap: 11px;
  padding: 11px; border-radius: 13px; background: #F4F6FA;
  margin-top: 8px; flex-shrink: 0;
}
.bp-shell-avatar {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--brand-grad);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.bp-shell-user-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.bp-shell-user-name { font-size: 13px; font-weight: 600; color: var(--app-ink, #0F1B2D); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-shell-user-role { font-size: 11px; color: #64707F; }
.bp-shell-logout {
  background: none; border: none; cursor: pointer; color: #64707F;
  padding: 5px; display: flex; align-items: center; border-radius: 8px;
  transition: background .15s ease, color .15s ease;
}
.bp-shell-logout:hover { background: #FDEAEA; color: #DC2626; }

/* ── Topbar ── */
.bp-shell-titles { min-width: 0; }
.bp-shell-title { font-size: 19px; font-weight: 700; color: var(--app-ink, #0F1B2D); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-shell-subtitle { font-size: 12.5px; color: #64707F; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-shell-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.bp-shell-search {
  display: flex; align-items: center; gap: 9px;
  width: 300px; max-width: 34vw;
  background: #F4F6FA; border: 1px solid #E9EDF3; border-radius: 11px;
  padding: 9px 13px;
}
.bp-shell-search-icon { font-size: 13px; opacity: .55; flex-shrink: 0; }
.bp-shell-search input {
  border: none; outline: none; background: transparent;
  flex: 1; min-width: 0; font-size: 13px; color: var(--app-ink, #0F1B2D);
  text-align: right; font-family: inherit;
}
.bp-shell-bell {
  position: relative; width: 42px; height: 42px; border-radius: 12px;
  background: #F4F6FA; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  transition: background .15s ease;
}
.bp-shell-bell:hover { background: #E9EDF3; }
.bp-shell-bell-count {
  position: absolute; top: 7px; right: 8px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: #FF5A5F; color: #fff;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.bp-shell-bell-count.hidden { display: none; }
.bp-shell-avatar-top { width: 42px; height: 42px; border-radius: 12px; }

@media print {
  body.bp-shell { padding-right: 0 !important; padding-top: 0 !important; }
}
