/* Global cream canvas — root token for the whole admin UI */
:root {
  --sf-bg-cream: #FCF9F3;
  --sf-bg-cream-border: #EDE8DF;
  --tt-page-bg: var(--sf-bg-cream);
}

html,
body#main-body.sf-app-body,
body#main-body.ndb-dashboard-body {
  background: var(--sf-bg-cream) !important;
}

body.sf-app-body > .flex,
body.ndb-dashboard-body > .flex,
body.sf-app-body #main-content,
body.ndb-dashboard-body #main-content,
body.sf-app-body #main-content > main,
body.ndb-dashboard-body #main-content > main,
body.sf-app-body .tt-admin,
#main-content.tt-admin {
  background: var(--sf-bg-cream) !important;
}

/* Superadmin / any non-POS admin body without sf-app-body still gets cream */
body#main-body:not(:has(#pos-container)) > .flex.bg-gray-50,
body#main-body:not(:has(#pos-container)) #main-content.bg-gray-50 {
  background: var(--sf-bg-cream) !important;
}

/* SaFood-style header brand (non-dashboard pages) */
.sf-header-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: fit-content;
}
.sf-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none !important;
  line-height: 1;
}
.sf-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #A78BFA;
  color: #fff;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  border-radius: 8px;
  flex-shrink: 0;
  user-select: none;
}
.sf-brand-name {
  display: none;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  background: #3B82F6;
  color: #fff;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: lowercase;
  border-radius: 8px;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (min-width: 1024px) {
  .sf-brand-name { display: inline-flex; }
}
.sf-brand-collapse {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: #6B7280;
  border-radius: 6px;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}
.sf-brand-collapse:hover {
  color: #111827;
  background: #F3F4F6;
}
.dark .sf-brand-collapse {
  color: #9CA3AF;
}
.dark .sf-brand-collapse:hover {
  color: #F9FAFB;
  background: #374151;
}
.menu-collapsed .sf-brand-name {
  display: none !important;
}

/* Sidebar logo row (theme logo + gold hamburger) */
.fm-sb-logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 64px;
  box-sizing: border-box;
}
.fm-sb-logo-link {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  flex: 1;
  text-decoration: none !important;
}
.fm-sb-logo-img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}
.fm-sb-ham {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s ease;
}
.fm-sb-ham:hover {
  background: rgba(196, 165, 99, 0.12);
}
html.menu-collapsed body.sf-app-body #sidebar .fm-sb-logo {
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 14px 8px;
}
html.menu-collapsed body.sf-app-body #sidebar .fm-sb-logo-link {
  flex: 0;
  justify-content: center;
}
html.menu-collapsed body.sf-app-body #sidebar .fm-sb-logo-img {
  height: 28px;
  max-width: 36px;
}

body.sf-app-body #sidebar {
  padding-top: 0 !important;
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  max-height: none !important;
  background: linear-gradient(180deg, #5A5039 0%, #4A412F 50%, #2D271C 100%) !important;
  border: none !important;
}
body.sf-app-body #sidebar > div {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  height: 100% !important;
  min-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}
body.sf-app-body #sidebar .fm-sb-logo {
  border-bottom-color: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
body.sf-app-body #sidebar [sidebar-bottom-menu] {
  background: rgba(0, 0, 0, 0.25) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
body.sf-app-body #sidebar [sidebar-bottom-menu] a {
  color: rgba(255, 255, 255, 0.75) !important;
}
body.sf-app-body #sidebar [sidebar-bottom-menu] a:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}
body.sf-app-body #sidebar .divide-y {
  background: transparent !important;
  --tw-divide-opacity: 1;
  border-color: rgba(255, 255, 255, 0.1);
}
body.sf-app-body #sidebar .divide-y > :not([hidden]) ~ :not([hidden]) {
  border-color: rgba(255, 255, 255, 0.1);
}

/* Branch picker dropdown — solid white panel (sidebar .divide-y rule must not make this transparent) */
body.sf-app-body #sidebar #changeBranchDropdown {
  background: #ffffff !important;
  border: 1px solid #e7ddcc !important;
  box-shadow: 0 10px 28px rgba(44, 36, 22, 0.14) !important;
  z-index: 40;
  opacity: 1 !important;
  --tw-divide-opacity: 1;
  border-color: #ede8df !important;
}
body.sf-app-body #sidebar #changeBranchDropdown ul {
  background: #ffffff !important;
}
body.sf-app-body #sidebar #changeBranchDropdown li a {
  color: #2c2416 !important;
  background: #ffffff !important;
}
body.sf-app-body #sidebar #changeBranchDropdown li a:hover {
  color: #2c2416 !important;
  background: #f5f1ea !important;
}
body.sf-app-body #sidebar #changeBranchButton {
  background: #ffffff !important;
  color: #524934 !important;
  border-color: #e7ddcc !important;
}

/* Light text/icons on dark gradient */
body.sf-app-body #sidebar li > a,
body.sf-app-body #sidebar li > button,
body.sf-app-body #sidebar .text-gray-500,
body.sf-app-body #sidebar .text-gray-400 {
  color: rgba(255, 255, 255, 0.72) !important;
}
body.sf-app-body #sidebar li > a:hover,
body.sf-app-body #sidebar li > button:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08) !important;
}
body.sf-app-body #sidebar li > a.text-skin-base,
body.sf-app-body #sidebar li > button.text-skin-base,
body.sf-app-body #sidebar li > a.bg-skin-base\/\[\.20\],
body.sf-app-body #sidebar li > a[class*="bg-skin-base"],
body.sf-app-body #sidebar li > button[class*="bg-skin-base"] {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.14) !important;
}
body.sf-app-body #sidebar li > span.block.px-2 {
  color: rgba(255, 255, 255, 0.45) !important;
}
body.sf-app-body #sidebar svg {
  color: inherit;
  fill: currentColor;
}
body.sf-app-body #sidebar [sidebar-toggle-item] {
  color: inherit !important;
}
@media (min-width: 1024px) {
  /* App bar always starts after the sidebar — never full width on desktop */
  body.sf-app-body .sf-top-header {
    left: 14rem;
    right: 0;
    width: auto;
  }
  html[dir="rtl"] body.sf-app-body .sf-top-header {
    left: 0;
    right: 14rem;
  }
  body.sf-app-body .sf-appbar-brand {
    display: none !important;
  }

  /* Collapsed: narrow icon rail — keep icons, hide labels */
  html.menu-collapsed body.sf-app-body #sidebar {
    display: flex !important;
    width: 4.5rem !important;
    min-width: 4.5rem !important;
    transform: none !important;
  }
  html.menu-collapsed body.sf-app-body #sidebar .fm-sb-logo-img {
    height: 28px;
    max-width: 36px;
  }
  html.menu-collapsed body.sf-app-body #sidebar .fm-sb-logo {
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 14px 8px;
  }
  /* Keep nav list visible; center icon-only items */
  html.menu-collapsed body.sf-app-body #sidebar .fm-sb-logo ~ div {
    display: flex !important;
    flex-direction: column;
  }
  html.menu-collapsed body.sf-app-body #sidebar ul {
    padding-left: 0;
    padding-right: 0;
  }
  /* Hide section labels (CORE, etc.) */
  html.menu-collapsed body.sf-app-body #sidebar li.pt-3,
  html.menu-collapsed body.sf-app-body #sidebar li > span.block.px-2 {
    display: none !important;
  }
  /* Menu / dropdown buttons: icon only */
  html.menu-collapsed body.sf-app-body #sidebar li > a,
  html.menu-collapsed body.sf-app-body #sidebar li > button {
    justify-content: center !important;
    gap: 0 !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    font-size: 0 !important;
    line-height: 0 !important;
  }
  html.menu-collapsed body.sf-app-body #sidebar li > a > span,
  html.menu-collapsed body.sf-app-body #sidebar li > button > span.w-4 {
    font-size: 9px !important;
    line-height: 1 !important;
    flex-shrink: 0;
  }
  /* Hide item text, chevrons, nested dropdown lists, branch picker text */
  html.menu-collapsed body.sf-app-body #sidebar [sidebar-toggle-item],
  html.menu-collapsed body.sf-app-body #sidebar li > button > svg,
  html.menu-collapsed body.sf-app-body #sidebar li > ul,
  html.menu-collapsed body.sf-app-body #sidebar .divide-y > div:first-child {
    display: none !important;
  }
  html.menu-collapsed body.sf-app-body .sf-top-header {
    left: 4.5rem;
  }
  html[dir="rtl"].menu-collapsed body.sf-app-body .sf-top-header {
    left: 0;
    right: 4.5rem;
  }
  html.menu-collapsed body.sf-app-body #main-content {
    margin-left: 4.5rem !important;
    margin-right: 0 !important;
  }
  html[dir="rtl"].menu-collapsed body.sf-app-body #main-content {
    margin-right: 4.5rem !important;
    margin-left: 0 !important;
  }
}

/* ===== Complete dashboard welcome header ===== */
.sf-top-header {
  background: var(--sf-bg-cream) !important;
  border-bottom: 1px solid var(--sf-bg-cream-border);
  font-family: 'DM Sans', system-ui, sans-serif;
}
.sf-top-header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.sf-top-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.sf-header-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none !important;
  flex-shrink: 0;
  line-height: 1;
}
.sf-header-logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.sf-top-header .sf-brand-name {
  display: none;
}
@media (min-width: 768px) {
  .sf-top-header .sf-brand-name { display: inline-flex; }
}
.menu-collapsed .sf-top-header .sf-brand-name {
  display: none !important;
}
.sf-sidebar-toggles {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.sf-mobile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: #6E665A;
  border-radius: 8px;
  cursor: pointer;
}
.sf-mobile-toggle:hover,
.sf-brand-collapse:hover {
  color: #2C2416;
  background: rgba(82,73,52,.08);
}
.sf-top-header .sf-brand-collapse {
  display: inline-flex;
  color: #6E665A;
}
.sf-welcome-text { min-width: 0; }
.sf-welcome-hi {
  margin: 0 0 2px;
  color: #887E72;
  font-size: 14px;
  font-weight: 500;
  background: transparent !important;
}
.sf-welcome-title {
  margin: 0;
  color: #2C2416 !important;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.15;
  background: transparent !important;
  padding: 0 !important;
  display: block !important;
  height: auto !important;
  max-width: none !important;
  border-radius: 0 !important;
  text-transform: none !important;
}
.sf-top-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-left: auto;
}
.sf-trial-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: #FFF8EB;
  border: 1px solid #F0D9A8;
  color: #9A6B16;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  box-shadow: 0 1px 20px rgba(0,0,0,.03);
}
.sf-trial-badge:hover { background: #FFF3D9; color: #7A5210; }
.sf-trial-badge--expired {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #B91C1C;
}
.sf-trial-badge--expired:hover { background: #FEE2E2; color: #991B1B; }
.sf-upgrade-badge { background: #F5F1EA; border-color: #E7DDCC; color: #524934; }

/* Trial expired — full page (replaces dashboard) */
.sf-trial-expired-page {
  min-height: calc(100vh - 5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: #FCF9F3;
}
.sf-trial-expired-page-card {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(44, 36, 22, 0.12);
  padding: 32px 28px 28px;
  color: #2C2416;
  font-family: 'DM Sans', system-ui, sans-serif;
}

/* Legacy modal styles kept for reuse */
.sf-trial-expired-root {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.sf-trial-expired-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 36, 22, 0.45);
}
.sf-trial-expired-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(44, 36, 22, 0.22);
  padding: 28px 28px 24px;
  color: #2C2416;
  font-family: 'DM Sans', system-ui, sans-serif;
}
.sf-trial-expired-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #887E72;
  cursor: pointer;
}
.sf-trial-expired-greeting {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: #2C2416;
}
.sf-trial-expired-body {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.55;
  color: #3F3828;
}
.sf-trial-expired-regards {
  margin: 0 0 20px;
  font-size: 14px;
  font-weight: 600;
  color: #2C2416;
}
.sf-trial-expired-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.sf-trial-expired-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  background: #524934;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
}
.sf-trial-expired-btn:hover { background: #3f3828; }
.sf-trial-expired-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid #E7DDCC;
  background: #F5F1EA;
  color: #524934;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.sf-icon-dd { position: relative; }
.sf-icon-btn {
  width: 50px;
  height: 50px;
  background: #fff;
  border-radius: 14px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  box-shadow: 0 1px 20px rgba(0,0,0,.03);
}
.sf-notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #DC2626;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.sf-lang-trigger {
  height: 50px;
  padding: 0 18px;
  background: #fff;
  border-radius: 14px;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #2C2416;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 1px 20px rgba(0,0,0,.03);
}
.sf-user-block {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: 'DM Sans', system-ui, sans-serif;
}
.sf-user-role { color: #2C2416; font-size: 16px; font-weight: 500; }
.sf-user-avatar {
  width: 40px;
  height: 40px;
  background: rgba(82,73,52,.10);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #524934;
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}
.sf-user-avatar-img {
  object-fit: cover;
  display: block;
  padding: 0;
}
.sf-panel-list,
.sf-lang-dropdown,
.sf-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  z-index: 1000;
  border: 1px solid rgba(231,221,204,.5);
  display: none;
}
.sf-icon-dd.open .sf-panel-list,
.sf-icon-dd.open .sf-lang-dropdown,
.sf-icon-dd.open .sf-user-dropdown { display: block; }
.sf-panel-list { width: 320px; max-height: 400px; overflow: hidden; }
.sf-panel-list-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(231,221,204,.5);
  font-size: 15px;
  font-weight: 600;
  color: #2C2416;
}
.sf-panel-list-body { max-height: 320px; overflow-y: auto; padding: 8px; }
.sf-empty-panel { padding: 20px; text-align: center; color: #887E72; font-size: 13px; }
.sf-notif-live-wrap { display: flex; flex-direction: column; gap: 6px; }
.sf-notif-live-item > .relative { width: 100%; }
.sf-notif-live-item a {
  display: flex !important;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px !important;
  border-radius: 10px !important;
  border: 1px solid #EDE8DF !important;
  background: #FBF9F4 !important;
  color: #2C2416 !important;
  box-shadow: none !important;
  text-decoration: none;
}
.sf-notif-live-item a:hover { background: #F5F0E6 !important; }
.sf-notif-live-item a span {
  margin-left: auto !important;
  background: #524934 !important;
  color: #fff !important;
  border-radius: 999px !important;
  min-width: 24px;
  justify-content: center;
}
.sf-notif-live-item [role="tooltip"] { display: none !important; }
.sf-lang-dropdown { min-width: 200px; padding: 8px; }
.sf-lang-list { display: flex; flex-direction: column; gap: 2px; }
.sf-lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  background: transparent;
  color: #6E665A;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.sf-lang-item:hover { background: rgba(231,221,204,.35); color: #2C2416; }
.sf-lang-flag { width: 16px; height: 16px; border-radius: 999px; object-fit: cover; flex-shrink: 0; }
/* Legacy nested Flowbite markup (if any) */
.sf-lang-dropdown > div > button[data-dropdown-toggle] { display: none !important; }
.sf-lang-dropdown #language-dropdown {
  display: block !important;
  position: static !important;
  box-shadow: none !important;
  background: transparent !important;
  margin: 0 !important;
}
.sf-lang-dropdown #language-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: #6E665A;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
}
.sf-lang-dropdown #language-dropdown a:hover { background: rgba(231,221,204,.2); color: #2C2416; }

/* Theme confirm modal (cream / gold) */
.sf-confirm-overlay{
  position:fixed;inset:0;z-index:10050;background:rgba(28,26,22,.45);backdrop-filter:blur(4px);
  display:flex;align-items:center;justify-content:center;padding:16px;
}
.sf-confirm-card{
  width:420px;max-width:96vw;background:#FFFDF9;border-radius:20px;
  box-shadow:0 24px 64px rgba(28,26,22,.18);overflow:hidden;
  transform:scale(.96) translateY(10px);opacity:0;
  transition:transform .22s ease,opacity .18s ease;
}
.sf-confirm-card.is-in{transform:scale(1) translateY(0);opacity:1}
.sf-confirm-body{padding:22px 22px 8px}
.sf-confirm-title{margin:0 0 8px;font-size:20px;font-weight:700;color:#2C2416;line-height:1.3}
.sf-confirm-msg{margin:0;font-size:14px;color:#6E665A;line-height:1.5}
.sf-confirm-actions{
  display:flex;gap:12px;padding:16px 22px 22px;border-top:1px solid rgba(231,221,204,.4);
}
.sf-confirm-btn{
  flex:1;min-height:48px;border-radius:14px;font-size:13px;font-weight:600;cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;gap:8px;font-family:inherit;
  transition:transform .12s ease,box-shadow .15s ease,background .15s ease;
}
.sf-confirm-btn:active{transform:scale(.98)}
.sf-confirm-btn--cancel{
  background:#fff;color:#2C2416;border:1px solid rgba(231,221,204,.9);
}
.sf-confirm-btn--cancel:hover{background:#FAF7F0}
.sf-confirm-btn--ok{
  background:linear-gradient(180deg,#D4B575 0%,#B8954A 55%,#A8873F 100%);
  color:#fff;border:1px solid rgba(255,255,255,.2);
  box-shadow:0 4px 16px rgba(184,149,74,.32);
}
.sf-confirm-btn--ok:hover{box-shadow:0 8px 22px rgba(184,149,74,.4)}
.sf-confirm-btn--danger{
  background:#fff;color:#B91C1C;border:1px solid #FECACA;
}
.sf-confirm-btn--danger:hover{background:#FEF2F2;border-color:#F87171}
.sf-user-dropdown { min-width: 220px; padding: 8px; }
.sf-user-menu-meta {
  padding: 10px 14px 12px;
  border-bottom: 1px solid rgba(231,221,204,.5);
  margin-bottom: 6px;
}
.sf-user-menu-name { font-size: 14px; font-weight: 600; color: #2C2416; }
.sf-user-menu-email { font-size: 12px; color: #887E72; margin-top: 2px; word-break: break-all; }
.sf-user-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: #6E665A;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: 'DM Sans', system-ui, sans-serif;
}
.sf-user-menu-link:hover { background: rgba(231,221,204,.2); }

/* Shared SaFood app bar spacing (all admin pages) */
body.sf-app-body > .flex,
body.ndb-dashboard-body > .flex {
  padding-top: 88px !important;
  background: var(--sf-bg-cream) !important;
}
body.sf-app-body .sf-top-header ~ .flex,
body.sf-app-body > div.flex.pt-16,
body.ndb-dashboard-body .sf-top-header ~ .flex,
body.ndb-dashboard-body > div.flex.pt-16 {
  padding-top: 88px !important;
  background: var(--sf-bg-cream) !important;
}
@media (max-width: 640px) {
  .sf-welcome-title { font-size: 20px; }
  .sf-user-role { display: none; }
  .sf-top-header-inner { padding: 12px 16px; }
  .sf-trial-badge span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
  body.sf-app-body > .flex,
  body.ndb-dashboard-body > .flex { padding-top: 100px !important; }
}

/* =====================================================
   RTL App Bar — Mirror of English LTR layout
   English: [welcome....LEFT]  [actions....RIGHT]
   Arabic:  [actions...LEFT]   [...welcome.RIGHT]
   ===================================================== */

/* 1. The header inner bar: keep flex-row, just flip margin logic */
html[dir="rtl"] .sf-top-header-inner {
  direction: ltr; /* keep physical left=left so we can control exactly */
  padding-right: 28px !important; /* match default padding-left so welcome text isn't flush against sidebar */
}

/* 2. Actions group: sits on the LEFT, items ordered RIGHT-TO-LEFT */
html[dir="rtl"] .sf-top-right {
  margin-left: 0 !important;
  margin-right: 0 !important;
  order: 1;
  flex-direction: row-reverse; /* [N Admin] [language] [bell] [trial] [spy] */
}

/* 3. Welcome group: sits on the RIGHT (auto margin pushes it right) */
html[dir="rtl"] .sf-top-left {
  margin-left: auto !important;  /* pushes to the right */
  order: 2;
  flex-direction: row-reverse;   /* brand icon to the right of welcome text */
  justify-content: flex-end;
}

/* 4. Welcome text — right-aligned Arabic */
html[dir="rtl"] .sf-welcome-text {
  text-align: right;
  padding-right: 0;
}
html[dir="rtl"] .sf-welcome-hi,
html[dir="rtl"] .sf-welcome-title {
  direction: rtl;
  unicode-bidi: embed;
}

/* Remove any extra right gap on sf-top-left in RTL */
html[dir="rtl"] .sf-top-left {
  padding-right: 0 !important;
  margin-right: 0 !important;
}

/* 5. User block: avatar LEFT, role text RIGHT */
html[dir="rtl"] .sf-user-block {
  flex-direction: row-reverse;
}

/* 6. Language trigger: keep same order as English (globe LEFT, label MIDDLE, chevron RIGHT) */
html[dir="rtl"] .sf-lang-trigger {
  flex-direction: row;
}

/* 7. Trial badge: keep same order as English (icon LEFT, text RIGHT) */
html[dir="rtl"] .sf-trial-badge {
  flex-direction: row;
}

/* 8. Dropdown panels open to the RIGHT of their trigger in RTL
      (trigger is on the left side now, so panel opens leftward = left:0) */
html[dir="rtl"] .sf-panel-list,
html[dir="rtl"] .sf-lang-dropdown,
html[dir="rtl"] .sf-user-dropdown {
  right: auto !important;
  left: 0 !important;
}

/* 9. Notification badge pin flips side */
html[dir="rtl"] .sf-notif-badge {
  right: auto !important;
  left: -4px !important;
}

/* 10. Dropdown content — text right-aligned */
html[dir="rtl"] .sf-panel-list-head {
  flex-direction: row-reverse;
}
html[dir="rtl"] .sf-user-menu-link,
html[dir="rtl"] .sf-lang-option {
  text-align: right;
  flex-direction: row-reverse;
}
html[dir="rtl"] .sf-user-menu-meta {
  text-align: right;
}
