/**
 * Sneat V2 — layout shell (sidebar + header + content)
 */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800&display=swap');

body.bb-theme-v2 .thetop {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 100vh;
  width: 100%;
  background: var(--bb-v2-bg);
}

body.bb-theme-v2 .thetop > main {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.bb-theme-v2 #scrollable-container,
body.bb-theme-v2 .content-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.bb-theme-v2.bb-v2-hnav .thetop {
  flex-direction: column !important;
}

/* Sidebar */
body.bb-theme-v2 #main-sidebar.bb-v2-sidebar {
  position: relative;
  flex: 0 0 var(--bb-v2-sidebar-w);
  width: var(--bb-v2-sidebar-w) !important;
  min-width: var(--bb-v2-sidebar-w);
  max-width: var(--bb-v2-sidebar-w);
  height: 100vh;
  max-height: 100vh;
  display: flex !important;
  flex-direction: column;
  visibility: visible !important;
  opacity: 1 !important;
  background: var(--bb-v2-sidebar-bg);
  border-inline-end: 1px solid var(--bb-v2-border);
  box-shadow: var(--bb-v2-shadow);
  z-index: var(--bb-v2-z-sidebar);
  overflow: hidden;
}

body.bb-theme-v2 .sidebar-brand-link {
  min-height: var(--bb-v2-header-h);
  border-bottom: 1px solid var(--bb-v2-border);
  background: var(--bb-v2-surface);
  text-decoration: none;
}

body.bb-theme-v2 .sidebar-brand-link .rb-sidebar__brand-icon {
  background: linear-gradient(135deg, var(--bb-v2-primary), #8c57ff) !important;
  color: #fff !important;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.bb-theme-v2 .sidebar-brand-link .side-bar-heading {
  color: var(--bb-v2-text-strong) !important;
  font-weight: 600 !important;
}

body.bb-theme-v2 #side-bar {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Header (داخل .bb-v2-shell يُدار الموضع من bb-sneat-v2-nav.css) */
body.bb-theme-v2 .bb-v2-header {
  position: relative;
  top: auto;
  z-index: 1;
  flex-shrink: 0;
  min-height: var(--bb-v2-header-h);
  background: var(--bb-v2-surface);
  border-bottom: 1px solid var(--bb-v2-border);
  box-shadow: none;
}

body.bb-theme-v2:not(.bb-v2-hnav) .bb-v2-header {
  position: sticky;
  top: 0;
  z-index: var(--bb-v2-z-header);
  box-shadow: var(--bb-v2-shadow);
}

body.bb-theme-v2 .bb-v2-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--bb-v2-header-h);
  padding: 0.5rem 1rem;
}

body.bb-theme-v2 .bb-v2-header__left,
body.bb-theme-v2 .bb-v2-header__right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

body.bb-theme-v2 .bb-v2-header__right {
  flex: 1 1 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
}

body.bb-theme-v2 .bb-v2-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: 1px solid var(--bb-v2-border);
  border-radius: var(--bb-v2-radius);
  background: var(--bb-v2-surface);
  color: var(--bb-v2-text-strong);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

body.bb-theme-v2 .bb-v2-sidebar-toggle:hover {
  background: var(--bb-v2-primary-soft);
  border-color: var(--bb-v2-primary);
  color: var(--bb-v2-primary);
}

body.bb-theme-v2 .bb-v2-brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  min-width: 0;
}

body.bb-theme-v2 .bb-brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 0;
}

body.bb-theme-v2 .bb-brand-logo__img {
  display: block;
  width: auto;
  object-fit: contain;
}

body.bb-theme-v2 .bb-brand-logo--header.bb-v2-brand .bb-brand-logo__img {
  height: clamp(2rem, 2vw + 1.2rem, 2.65rem);
  max-width: min(9.5rem, 28vw);
}

body.bb-theme-v2 .bb-v2-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, var(--bb-v2-primary), #8c57ff);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
}

body.bb-theme-v2 .bb-v2-brand__text {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--bb-v2-text-strong);
  white-space: nowrap;
}

/* Header actions — Sneat surfaces */
body.bb-theme-v2 .bb-v2-header .bb-hdr-surface,
body.bb-theme-v2 .bb-v2-header .rb-hdr-action,
body.bb-theme-v2 .bb-v2-header .rb-hdr-menu-trigger,
body.bb-theme-v2 .bb-v2-header .notifications-menu > a,
body.bb-theme-v2 .bb-v2-header .header-secondary-actions > a,
body.bb-theme-v2 .bb-v2-header .header-secondary-actions > button {
  background: var(--bb-v2-surface) !important;
  border: 1px solid var(--bb-v2-border) !important;
  color: var(--bb-v2-text) !important;
  box-shadow: none !important;
  border-radius: var(--bb-v2-radius) !important;
  min-height: 2.5rem;
}

body.bb-theme-v2 .bb-v2-header .bb-hdr-surface:hover,
body.bb-theme-v2 .bb-v2-header .rb-hdr-action:hover,
body.bb-theme-v2 .bb-v2-header .rb-hdr-menu-trigger:hover {
  background: var(--bb-v2-primary-soft) !important;
  border-color: var(--bb-v2-primary) !important;
  color: var(--bb-v2-primary-strong) !important;
}

body.bb-theme-v2 .bb-v2-header .rb-hdr-action--pos {
  background: var(--bb-v2-primary) !important;
  border-color: var(--bb-v2-primary) !important;
  color: #fff !important;
}

body.bb-theme-v2 .bb-v2-header .rb-hdr-action--pos:hover {
  background: var(--bb-v2-primary-strong) !important;
  border-color: var(--bb-v2-primary-strong) !important;
  color: #fff !important;
}

/* Header actions row — single horizontal line */
body.bb-theme-v2 .bb-v2-header__right {
  flex-wrap: nowrap;
  overflow: visible;
}

body.bb-theme-v2 .bb-v2-header__right > .header-secondary-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
}

body.bb-theme-v2 .bb-v2-header .header-secondary-actions,
body.bb-theme-v2 .bb-v2-header .header-primary-plus,
body.bb-theme-v2 .bb-v2-header .rb-hdr-menu-wrap {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}

body.bb-theme-v2 .bb-v2-header .notifications-menu {
  display: inline-flex !important;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

body.bb-theme-v2 .bb-v2-header .notifications-menu .label {
  position: absolute;
  top: 0.15rem;
  inset-inline-end: 0.1rem;
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
}

/* Closed flyout menus must not expand the header */
body.bb-theme-v2 .bb-v2-header ul.rb-hdr-menu:not(.rb-hdr-menu--open),
body.bb-theme-v2 ul.rb-hdr-menu[aria-hidden="true"]:not(.rb-hdr-menu--open) {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  pointer-events: none !important;
}

/* Open flyout panel (moved to body by rb-header-flyout.js) */
body.bb-theme-v2 ul.rb-hdr-menu.rb-hdr-menu--open,
body.bb-theme-v2 ul.rb-hdr-menu.rb-sneat-dropdown.rb-hdr-menu--open {
  display: block !important;
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  min-width: 16rem;
  max-width: min(22rem, calc(100vw - 1.5rem));
  background: var(--bb-v2-surface) !important;
  border: 1px solid var(--bb-v2-border) !important;
  border-radius: var(--bb-v2-radius-lg) !important;
  box-shadow: var(--bb-v2-shadow-lg) !important;
}

body.bb-theme-v2 .rb-sneat-dropdown__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--bb-v2-border);
  margin-bottom: 0.25rem;
}

body.bb-theme-v2 .rb-sneat-dropdown__bar-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--bb-v2-text-strong);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body.bb-theme-v2 .rb-sneat-dropdown__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--bb-v2-border);
}

body.bb-theme-v2 .rb-sneat-dropdown__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--bb-v2-primary-soft);
  color: var(--bb-v2-primary-strong);
  font-weight: 700;
  font-size: 0.75rem;
}

body.bb-theme-v2 .rb-sneat-dropdown__name {
  display: block;
  color: var(--bb-v2-text-strong);
  font-size: 0.9rem;
}

body.bb-theme-v2 .rb-sneat-dropdown__role {
  display: block;
  color: var(--bb-v2-muted);
  font-size: 0.75rem;
}

body.bb-theme-v2 .rb-sneat-dropdown__divider {
  height: 1px;
  margin: 0.25rem 0;
  background: var(--bb-v2-border);
  list-style: none;
}

body.bb-theme-v2 .rb-sneat-dropdown__link,
body.bb-theme-v2 .rb-hdr-menu > li > a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 0;
  background: transparent;
  color: var(--bb-v2-text);
  text-decoration: none;
  font-size: 0.875rem;
  text-align: start;
  cursor: pointer;
}

body.bb-theme-v2 .rb-sneat-dropdown__link:hover,
body.bb-theme-v2 .rb-hdr-menu > li > a:hover {
  background: #f8f8fb;
  color: var(--bb-v2-text-strong);
}

body.bb-theme-v2 .rb-sneat-dropdown__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  color: var(--bb-v2-primary);
}

body.bb-theme-v2 .rb-sneat-dropdown__icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

body.bb-theme-v2 .rb-sneat-dropdown__label {
  flex: 1;
  min-width: 0;
}

body.bb-theme-v2 .rb-sneat-dropdown--notif {
  min-width: 18rem;
}

body.bb-theme-v2 .rb-sneat-dropdown__body {
  max-height: 18rem;
  overflow-y: auto;
  padding: 0;
  list-style: none;
}

/* Overlay */
body.bb-theme-v2 .bb-v2-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(47, 51, 73, 0.45);
  z-index: var(--bb-v2-z-overlay);
}

body.bb-theme-v2.bb-v2-nav-open .bb-v2-overlay,
body.bb-theme-v2.bb-v2-sidebar-open .bb-v2-overlay {
  display: block;
}

/* Mobile off-canvas */
@media (max-width: 991.98px) {
  body.bb-theme-v2 .bb-v2-sidebar-toggle {
    display: inline-flex;
  }

  body.bb-theme-v2 #main-sidebar.bb-v2-sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    flex: none;
    z-index: var(--bb-v2-z-sidebar);
  }

  html[dir="rtl"] body.bb-theme-v2 #main-sidebar.bb-v2-sidebar {
    transform: translateX(105%);
  }

  body.bb-theme-v2.bb-v2-sidebar-open #main-sidebar.bb-v2-sidebar {
    transform: translateX(0);
  }

  body.bb-theme-v2 .bb-v2-brand__text {
    display: none;
  }

  body.bb-theme-v2 .bb-v2-header__right {
    gap: 0.35rem;
  }

  body.bb-theme-v2 .bb-v2-header .rb-hdr-label-user,
  body.bb-theme-v2 .bb-v2-header .rb-hdr-label-pos {
    display: none !important;
  }
}

/* —— Top header bar (above menu only) —— dark trial */
body.bb-theme-v2 .bb-v2-header--top {
  --bb-v2-hdr-dark-bg-top: #1e2332;
  --bb-v2-hdr-dark-bg-bottom: #161a28;
  --bb-v2-hdr-dark-border: rgba(105, 108, 255, 0.14);
  --bb-v2-hdr-dark-text: rgba(226, 230, 244, 0.9);
  --bb-v2-hdr-dark-text-strong: #f4f6fb;
  --bb-v2-hdr-dark-hover: rgba(255, 255, 255, 0.06);

  background:
    linear-gradient(180deg, var(--bb-v2-hdr-dark-bg-top) 0%, var(--bb-v2-hdr-dark-bg-bottom) 100%);
  border-bottom: 1px solid var(--bb-v2-hdr-dark-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 28px rgba(0, 0, 0, 0.18);
  backdrop-filter: none;
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-header__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 0.75rem;
  min-height: 3.75rem;
  padding: 0.45rem clamp(0.85rem, 2vw, 1.35rem);
  direction: ltr;
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-header__left {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  position: relative;
  z-index: 3;
  max-width: 100%;
  display: flex;
  flex: 0 0 auto;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-header__brand-slot {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  z-index: 2;
  pointer-events: none;
  max-width: min(94vw, 36rem);
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-header__right {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  position: relative;
  z-index: 3;
  max-width: 100%;
  display: flex;
  flex: 0 0 auto;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  margin-inline-start: 0;
}

body.bb-theme-v2 .bb-v2-header-brand {
  pointer-events: auto;
  display: inline-flex;
  text-decoration: none;
  outline: none;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

body.bb-theme-v2 .bb-v2-header-brand:hover {
  transform: scale(1.025);
}

body.bb-theme-v2 .bb-v2-header-brand:focus-visible .bb-v2-header-brand__plate {
  box-shadow:
    0 0 0 3px rgba(105, 108, 255, 0.35),
    0 16px 40px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body.bb-theme-v2 .bb-v2-header-brand__plate {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.55rem 1.85rem 0.62rem;
  border-radius: 999px;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(145deg, #161a28 0%, #0b0d14 48%, #1a1f2e 100%);
  border: 1px solid rgba(196, 30, 58, 0.38);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
  animation: bb-v2-brand-plate-glow 18s ease-in-out infinite;
}

body.bb-theme-v2 .bb-v2-header-brand__plate::before {
  content: '';
  position: absolute;
  inset: -40% -50%;
  background: linear-gradient(105deg, transparent 28%, rgba(255, 255, 255, 0.16) 50%, transparent 72%);
  animation: bb-v2-brand-plate-sheen 14s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

body.bb-theme-v2 .bb-v2-header-brand__plate::after {
  content: '';
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.38rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #c41e3a, #ff8fa3, #696cff, #ff8fa3, #c41e3a, transparent);
  background-size: 240% 100%;
  opacity: 0.9;
  animation: bb-v2-brand-underline 16s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

body.bb-theme-v2 .bb-v2-header-brand__spark {
  position: absolute;
  top: 0.48rem;
  inset-inline-start: 0.85rem;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff8fa3 0%, #c41e3a 100%);
  box-shadow:
    0 0 12px rgba(255, 107, 129, 0.65),
    0 0 4px rgba(196, 30, 58, 0.45);
  animation: bb-v2-brand-spark 24s ease-in-out infinite;
  pointer-events: none;
  z-index: 4;
}

body.bb-theme-v2 .bb-v2-header-brand__name {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: baseline;
  flex-wrap: nowrap;
  white-space: nowrap;
  padding-inline-start: 0.65rem;
  font-family: 'Cinzel', 'Segoe UI', system-ui, sans-serif;
  font-size: clamp(1rem, 0.82rem + 0.72vw, 1.38rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  animation: bb-v2-brand-float 20s ease-in-out infinite;
}

body.bb-theme-v2 .bb-v2-header-brand__word-gap {
  display: inline-block;
  width: 0.55em;
}

body.bb-theme-v2 .bb-v2-header-brand__letter {
  display: inline-block;
  animation:
    bb-v2-brand-letter-wave 22s ease-in-out infinite,
    bb-v2-brand-letter-fade 24s ease-in-out infinite;
  animation-delay:
    calc(var(--bb-brand-i, 0) * 0.12s),
    calc(var(--bb-brand-i, 0) * 0.16s);
}

body.bb-theme-v2 .bb-v2-header-brand__letter--black {
  color: #f8fafc;
  animation:
    bb-v2-brand-letter-wave 22s ease-in-out infinite,
    bb-v2-brand-letter-fade 24s ease-in-out infinite,
    bb-v2-brand-black-shimmer 20s ease-in-out infinite;
  animation-delay:
    calc(var(--bb-brand-i, 0) * 0.12s),
    calc(var(--bb-brand-i, 0) * 0.16s),
    calc(var(--bb-brand-i, 0) * 0.08s);
}

body.bb-theme-v2 .bb-v2-header-brand__letter--books {
  color: #ffffff;
  animation:
    bb-v2-brand-letter-wave 22s ease-in-out infinite,
    bb-v2-brand-letter-fade 24s ease-in-out infinite,
    bb-v2-brand-books-accent 18s ease-in-out infinite;
  animation-delay:
    calc(var(--bb-brand-i, 0) * 0.12s),
    calc(var(--bb-brand-i, 0) * 0.16s),
    calc((var(--bb-brand-i, 0) - 5) * 0.1s);
}

body.bb-theme-v2 .bb-v2-header-brand__letter--erp {
  color: #ff8fa3;
  font-weight: 900;
  font-size: 0.92em;
  letter-spacing: 0.16em;
  animation:
    bb-v2-brand-letter-wave 22s ease-in-out infinite,
    bb-v2-brand-letter-fade 24s ease-in-out infinite,
    bb-v2-brand-erp-pulse 16s ease-in-out infinite;
  animation-delay:
    calc(var(--bb-brand-i, 0) * 0.12s),
    calc(var(--bb-brand-i, 0) * 0.16s),
    calc((var(--bb-brand-i, 0) - 11) * 0.14s);
}

body.bb-theme-v2 .bb-v2-header-brand:hover .bb-v2-header-brand__name,
body.bb-theme-v2 .bb-v2-header-brand:hover .bb-v2-header-brand__letter,
body.bb-theme-v2 .bb-v2-header-brand:hover .bb-v2-header-brand__plate,
body.bb-theme-v2 .bb-v2-header-brand:hover .bb-v2-header-brand__plate::before,
body.bb-theme-v2 .bb-v2-header-brand:hover .bb-v2-header-brand__plate::after,
body.bb-theme-v2 .bb-v2-header-brand:hover .bb-v2-header-brand__spark {
  animation-play-state: paused;
}

@keyframes bb-v2-brand-plate-glow {
  0%,
  100% {
    box-shadow:
      0 14px 34px rgba(0, 0, 0, 0.24),
      0 0 0 1px rgba(255, 255, 255, 0.04) inset,
      inset 0 1px 0 rgba(255, 255, 255, 0.09);
    border-color: rgba(196, 30, 58, 0.32);
  }
  50% {
    box-shadow:
      0 18px 42px rgba(0, 0, 0, 0.26),
      0 0 28px rgba(105, 108, 255, 0.1),
      0 0 18px rgba(196, 30, 58, 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 143, 163, 0.48);
  }
}

@keyframes bb-v2-brand-plate-sheen {
  0%,
  100% {
    transform: translateX(-18%) rotate(0.001deg);
    opacity: 0.15;
  }
  50% {
    transform: translateX(18%) rotate(0.001deg);
    opacity: 0.55;
  }
}

@keyframes bb-v2-brand-underline {
  0%,
  100% {
    background-position: 0% 50%;
    opacity: 0.55;
  }
  50% {
    background-position: 100% 50%;
    opacity: 1;
  }
}

@keyframes bb-v2-brand-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
}

@keyframes bb-v2-brand-letter-wave {
  0%,
  72%,
  100% {
    transform: translateY(0);
  }
  76% {
    transform: translateY(-3px);
  }
  80% {
    transform: translateY(0);
  }
}

@keyframes bb-v2-brand-letter-fade {
  0%,
  8%,
  88%,
  100% {
    opacity: 1;
  }
  12% {
    opacity: 0.72;
  }
  16% {
    opacity: 1;
  }
}

@keyframes bb-v2-brand-black-shimmer {
  0%,
  100% {
    color: #f8fafc;
    text-shadow: 0 0 0 transparent;
  }
  50% {
    color: #ffffff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
  }
}

@keyframes bb-v2-brand-books-accent {
  0%,
  100% {
    color: #ffffff;
  }
  50% {
    color: #fecdd3;
  }
}

@keyframes bb-v2-brand-erp-pulse {
  0%,
  100% {
    color: #ff8fa3;
    text-shadow: none;
  }
  50% {
    color: #ffffff;
    text-shadow: 0 0 16px rgba(255, 143, 163, 0.55);
  }
}

@keyframes bb-v2-brand-spark {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.55;
  }
  25% {
    transform: translate(-0.15rem, 0.08rem) scale(1.15);
    opacity: 1;
  }
  50% {
    transform: translate(0.08rem, -0.06rem) scale(0.9);
    opacity: 0.65;
  }
  75% {
    transform: translate(0.12rem, 0.1rem) scale(1.1);
    opacity: 0.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.bb-theme-v2 .bb-v2-header-brand__plate,
  body.bb-theme-v2 .bb-v2-header-brand__plate::before,
  body.bb-theme-v2 .bb-v2-header-brand__plate::after,
  body.bb-theme-v2 .bb-v2-header-brand__spark,
  body.bb-theme-v2 .bb-v2-header-brand__name,
  body.bb-theme-v2 .bb-v2-header-brand__letter {
    animation: none !important;
  }
}

@media (max-width: 991.98px) {
  body.bb-theme-v2 .bb-v2-header--top .bb-v2-header__brand-slot {
    max-width: min(78vw, 22rem);
  }

  body.bb-theme-v2 .bb-v2-header-brand__plate {
    min-height: 2.55rem;
    padding: 0.42rem 1.25rem 0.48rem;
  }

  body.bb-theme-v2 .bb-v2-header-brand__name {
    font-size: clamp(0.88rem, 0.78rem + 0.5vw, 1.05rem);
    letter-spacing: 0.09em;
  }

  body.bb-theme-v2 .bb-v2-header-brand__spark {
    top: 0.4rem;
    inset-inline-start: 0.65rem;
    width: 0.36rem;
    height: 0.36rem;
  }
}

@media (max-width: 767.98px) {
  body.bb-theme-v2 .bb-v2-header--top .bb-v2-header__brand-slot {
    max-width: min(62vw, 14.5rem);
  }

  body.bb-theme-v2 .bb-v2-header-brand__plate {
    min-height: 2.15rem;
    padding: 0.32rem 0.95rem 0.38rem;
  }

  body.bb-theme-v2 .bb-v2-header-brand__name {
    font-size: 0.78rem;
    letter-spacing: 0.07em;
  }

  body.bb-theme-v2 .bb-v2-header-brand__word-gap {
    width: 0.35em;
  }
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-header__left .header-secondary-actions {
  flex: 0 0 auto;
  justify-content: flex-start;
  width: auto;
  max-width: none;
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-sub-chip-wrap {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  justify-content: flex-end;
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-sub-chip {
  border: 1px solid rgba(105, 108, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 4px 14px rgba(0, 0, 0, 0.18);
  color: var(--bb-v2-hdr-dark-text-strong, #f4f6fb);
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-sub-chip--version {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.14);
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-sub-chip--version:hover {
  border-color: rgba(105, 108, 255, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 6px 16px rgba(105, 108, 255, 0.12);
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-sub-chip--active {
  border-color: rgba(3, 195, 172, 0.35);
  background: rgba(3, 195, 172, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 4px 14px rgba(3, 195, 172, 0.1);
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-sub-chip--urgent {
  border-color: rgba(255, 62, 29, 0.4);
  background: rgba(255, 62, 29, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 6px 18px rgba(255, 62, 29, 0.16);
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-sub-chip--ended {
  border-color: rgba(255, 62, 29, 0.45);
  background: rgba(185, 28, 28, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 6px 18px rgba(185, 28, 28, 0.14);
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-sub-chip__label {
  color: rgba(185, 188, 255, 0.62);
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-sub-chip__sep {
  color: rgba(105, 108, 255, 0.45);
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-sub-chip__value {
  color: var(--bb-v2-hdr-dark-text-strong, #f4f6fb);
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-sub-chip__meta {
  background: rgba(105, 108, 255, 0.18);
  color: #c5c7ff;
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-sub-chip__warn {
  color: #ff8a75;
}

body.bb-theme-v2 .bb-v2-sub-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  max-width: min(100%, 26rem);
  min-height: 2.15rem;
  padding: 0.28rem 0.62rem 0.28rem 0.42rem;
  border-radius: 999px;
  border: 1px solid rgba(105, 108, 255, 0.16);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 244, 255, 0.94) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 6px 18px rgba(105, 108, 255, 0.1);
  color: var(--bb-v2-text-strong, #32475c);
  box-sizing: border-box;
}

body.bb-theme-v2 .bb-v2-sub-chip--version {
  cursor: pointer;
  flex: 0 0 auto;
  border-color: rgba(67, 89, 113, 0.12);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 248, 252, 0.95) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 6px 16px rgba(67, 89, 113, 0.07);
}

body.bb-theme-v2 .bb-v2-sub-chip--version:hover {
  border-color: rgba(105, 108, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 8px 20px rgba(105, 108, 255, 0.12);
}

body.bb-theme-v2 .bb-v2-sub-chip--active {
  border-color: rgba(3, 195, 172, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 255, 251, 0.94) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 6px 18px rgba(3, 195, 172, 0.1);
}

body.bb-theme-v2 .bb-v2-sub-chip--active .bb-v2-sub-chip__icon {
  background: rgba(3, 195, 172, 0.14);
  color: #03c3ac;
}

body.bb-theme-v2 .bb-v2-sub-chip--urgent {
  border-color: rgba(255, 62, 29, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 242, 240, 0.96) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 8px 22px rgba(255, 62, 29, 0.14);
  animation: bb-v2-sub-chip-urgent 2.6s ease-in-out infinite;
}

body.bb-theme-v2 .bb-v2-sub-chip--urgent .bb-v2-sub-chip__icon {
  background: rgba(255, 62, 29, 0.14);
  color: #ff3e1d;
}

body.bb-theme-v2 .bb-v2-sub-chip--ended {
  border-color: rgba(255, 62, 29, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 245, 245, 0.98) 0%, rgba(254, 226, 226, 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 8px 22px rgba(185, 28, 28, 0.12);
}

body.bb-theme-v2 .bb-v2-sub-chip--ended .bb-v2-sub-chip__icon {
  background: rgba(185, 28, 28, 0.14);
  color: #b91c1c;
}

body.bb-theme-v2 .bb-v2-sub-chip__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: rgba(105, 108, 255, 0.12);
  color: var(--bb-v2-primary, #696cff);
  font-size: 0.95rem;
}

body.bb-theme-v2 .bb-v2-sub-chip__line {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.32rem;
  min-width: 0;
  white-space: nowrap;
}

body.bb-theme-v2 .bb-v2-sub-chip__label {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--bb-v2-muted, #697a8d);
  line-height: 1;
}

body.bb-theme-v2 .bb-v2-sub-chip__sep {
  flex: 0 0 auto;
  color: rgba(105, 108, 255, 0.35);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

body.bb-theme-v2 .bb-v2-sub-chip__value {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--bb-v2-text-strong, #32475c);
  overflow: hidden;
  text-overflow: ellipsis;
}

body.bb-theme-v2 .bb-v2-sub-chip__meta {
  flex: 0 0 auto;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  background: rgba(105, 108, 255, 0.1);
  color: var(--bb-v2-primary-strong, #5f61e6);
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.1;
}

body.bb-theme-v2 .bb-v2-sub-chip--active .bb-v2-sub-chip__meta {
  background: rgba(3, 195, 172, 0.12);
  color: #029e8a;
}

body.bb-theme-v2 .bb-v2-sub-chip--urgent .bb-v2-sub-chip__meta {
  background: rgba(255, 62, 29, 0.12);
  color: #ff3e1d;
}

body.bb-theme-v2 .bb-v2-sub-chip__warn {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.1;
  color: #b42318;
}

body.bb-theme-v2 .bb-v2-sub-chip--ended .bb-v2-sub-chip__value {
  font-size: 0.68rem;
  font-weight: 600;
}

@keyframes bb-v2-sub-chip-urgent {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.92),
      0 8px 22px rgba(255, 62, 29, 0.14);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.92),
      0 10px 26px rgba(255, 62, 29, 0.22);
  }
}

html[dir='rtl'] body.bb-theme-v2 .bb-v2-header--top .bb-v2-header__right {
  direction: rtl;
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-header__right .bb-v2-sub-chip-wrap {
  justify-content: flex-end;
  margin-inline-start: 0;
}

body.bb-theme-v2 .bb-v2-header--top .header-secondary-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-nav-toggle {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border: 1px solid rgba(105, 108, 255, 0.22);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--bb-v2-hdr-dark-text-strong, #f4f6fb);
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

body.bb-theme-v2 .bb-v2-header--top .bb-v2-nav-toggle:hover {
  background: rgba(105, 108, 255, 0.14);
  border-color: rgba(105, 108, 255, 0.38);
  color: #dfe1ff;
  box-shadow: 0 4px 14px rgba(105, 108, 255, 0.18);
}

body.bb-theme-v2 .bb-v2-header--top .rb-hdr-menu-trigger,
body.bb-theme-v2 .bb-v2-header--top .rb-hdr-action,
body.bb-theme-v2 .bb-v2-header--top .notifications-menu > button {
  min-height: 2.5rem !important;
  min-width: 2.5rem !important;
  height: 2.5rem !important;
  padding: 0 !important;
  border: 1px solid transparent !important;
  border-radius: 0.55rem !important;
  background: transparent !important;
  color: var(--bb-v2-hdr-dark-text, rgba(226, 230, 244, 0.9)) !important;
  box-shadow: none !important;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

body.bb-theme-v2 .bb-v2-header--top .rb-hdr-menu-trigger:hover,
body.bb-theme-v2 .bb-v2-header--top .rb-hdr-action:hover,
body.bb-theme-v2 .bb-v2-header--top .notifications-menu > button:hover {
  background: var(--bb-v2-hdr-dark-hover, rgba(255, 255, 255, 0.06)) !important;
  border-color: rgba(105, 108, 255, 0.28) !important;
  color: var(--bb-v2-hdr-dark-text-strong, #f4f6fb) !important;
  box-shadow: none !important;
  transform: none;
}

body.bb-theme-v2 .bb-v2-header--top .rb-hdr-action--tile,
body.bb-theme-v2 .bb-v2-header--top .rb-hdr-action--plus,
body.bb-theme-v2 .bb-v2-header--top .notifications-menu > button.rb-hdr-action--tile,
body.bb-theme-v2 .bb-v2-header--top .header-primary-pos > a.rb-hdr-action--tile {
  min-width: 2.5rem !important;
  width: 2.5rem !important;
  padding: 0 !important;
  background: linear-gradient(135deg, var(--bb-v2-primary, #696cff) 0%, #5f61e6 100%) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(105, 108, 255, 0.22) !important;
  text-decoration: none !important;
}

body.bb-theme-v2 .bb-v2-header--top .rb-hdr-action--tile:hover,
body.bb-theme-v2 .bb-v2-header--top .rb-hdr-action--plus:hover,
body.bb-theme-v2 .bb-v2-header--top .notifications-menu > button.rb-hdr-action--tile:hover,
body.bb-theme-v2 .bb-v2-header--top .header-primary-pos > a.rb-hdr-action--tile:hover {
  background: linear-gradient(135deg, #5f61e6 0%, #4f51d8 100%) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(105, 108, 255, 0.28) !important;
}

/* ترتيب الشريط من اليسار لليمين: مستخدم → إشعار → + → نقطة بيع */
body.bb-theme-v2 .bb-v2-header--top .header-secondary-actions {
  flex-direction: row;
  direction: ltr;
  flex: 0 0 auto;
}

html[dir='rtl'] body.bb-theme-v2 .bb-v2-header--top .header-secondary-actions .rb-hdr-user-wrap {
  direction: rtl;
}

body.bb-theme-v2 .bb-v2-header--top .header-secondary-actions .rb-hdr-user-wrap {
  order: 1;
}

body.bb-theme-v2 .bb-v2-header--top .header-secondary-actions .notifications-menu {
  order: 2;
}

body.bb-theme-v2 .bb-v2-header--top .header-secondary-actions .header-primary-plus {
  order: 3;
}

body.bb-theme-v2 .bb-v2-header--top .header-secondary-actions .header-primary-pos {
  order: 4;
}

body.bb-theme-v2 .bb-v2-header--top .header-secondary-actions .bb-hdr-badge,
body.bb-theme-v2 .bb-v2-header--top .header-secondary-actions .rb-hdr-menu-wrap:not(.rb-hdr-user-wrap):not(.header-primary-plus):not(.notifications-menu):not(.header-primary-pos) {
  order: 5;
}

body.bb-theme-v2 .bb-v2-header--top .notifications-menu .label,
body.bb-theme-v2 .bb-v2-header--top .notifications-menu .notifications_count {
  display: none !important;
}

body.bb-theme-v2 .bb-v2-header--top .notifications-menu > button.rb-hdr-notif--unread {
  background: linear-gradient(135deg, var(--bb-v2-primary, #696cff) 0%, #5f61e6 100%) !important;
}

body.bb-theme-v2 .bb-v2-header--top .notifications-menu > button.rb-hdr-notif--unread .rb-hdr-notif-icon {
  color: #ff3e1d !important;
  stroke: #ff3e1d !important;
  animation: bb-v2-hdr-notif-pulse 1.35s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(255, 62, 29, 0.55));
}

@keyframes bb-v2-hdr-notif-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.12);
    opacity: 0.88;
  }
}

body.bb-theme-v2 .bb-v2-header--top .rb-hdr-action--pos .rb-hdr-pos-icon {
  font-size: 1.15rem;
  line-height: 1;
}

body.bb-theme-v2 .bb-v2-header--top .rb-hdr-action--user {
  min-width: auto !important;
  width: auto !important;
  height: 2.5rem !important;
  padding: 0 0.55rem 0 0.4rem !important;
  gap: 0.4rem !important;
  margin-inline-start: 0;
  border-inline-start: 0 !important;
  border-radius: 0.55rem !important;
}

body.bb-theme-v2 .bb-v2-header--top .rb-hdr-user-chip__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--bb-v2-primary, #696cff) 0%, #8c57ff 100%);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: none;
}

body.bb-theme-v2 .bb-v2-header--top .rb-hdr-label-user {
  max-width: 9.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--bb-v2-hdr-dark-text-strong, #f4f6fb);
}

body.bb-theme-v2 .bb-v2-header--top .rb-hdr-user-chip__icon-fallback {
  display: none;
}

body.bb-theme-v2 .bb-v2-header--top .notifications-menu .label:not(.tw-sr-only) {
  top: 0.05rem;
  inset-inline-end: 0.05rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ff3e1d !important;
  border: 2px solid #1a1f2e;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 991.98px) {
  body.bb-theme-v2 .bb-v2-header--top .header-secondary-actions {
    gap: 0.25rem;
    padding: 0;
  }

  body.bb-theme-v2 .bb-v2-header--top .rb-hdr-action--user {
    margin-inline-start: 0;
    padding-inline: 0.35rem !important;
    border-inline-start: 0 !important;
  }

  body.bb-theme-v2 .bb-v2-header--top .rb-hdr-user-chip__icon-fallback {
    display: inline-flex;
  }

  body.bb-theme-v2 .bb-v2-header--top .rb-hdr-user-chip__avatar {
    display: none;
  }
}

@media (min-width: 992px) {
  body.bb-theme-v2 .bb-v2-header--top .bb-v2-nav-toggle {
    display: none;
  }
}

@media (min-width: 992px) {
  body.bb-theme-v2 .bb-v2-overlay {
    display: none !important;
  }
}

/* Prayer / weather widgets — keep in flow, not floating over UI */
body.bb-theme-v2 .prayer-weather-widget,
body.bb-theme-v2 #prayer-weather-container {
  position: relative !important;
  inset: auto !important;
  float: none !important;
  z-index: 1 !important;
}

/* Print */
@media print {
  body.bb-theme-v2 #main-sidebar.bb-v2-sidebar,
  body.bb-theme-v2 .bb-v2-header {
    display: none !important;
  }
}
