/**
 * IMDTEC Account UI Skin
 * Google Admin-inspired layout
 *
 * v9 (2026-01)
 * - Sidebar fixed & flush-left (desktop)
 * - Main content scrolls; sidebar stays pinned
 * - Sidebar has its own vertical scroll when menu is long
 * - Removes pill radii (no 999px)
 * - Submenus: chevrons + indentation, no icons for sub-items
 * - Header/sidebar icon sizes aligned
 */

/* ------------------------------
   Base + Variables
-------------------------------*/

body.imdtec-site-account {
  /* Keep as a single source of truth */
  --imdtec-account-max-width: 1345px;

  /* Google Admin header height */
  --ps-topbar-h: 64px;
  --ps-top-offset: 0px;

  --ps-account-page-pad: 24px;
  --ps-account-header-left-pad: 12px;

  --ps-account-sidebar-w: 256px;
  --ps-account-sidebar-w-collapsed: 72px;

  --ps-account-border: rgba(60, 64, 67, 0.12);
  --ps-account-text: #1f1f1f;
  --ps-account-muted: #5f6368;

  --ps-account-blue: #1a73e8;
  --ps-account-blue-bg: #e8f0fe;

  --ps-account-item-h: 40px;
  --ps-account-item-h-collapsed: 48px;
  --ps-account-item-radius: 0px;
  --ps-account-icon-size: 24px;

  /* Page spacing (Google-like breathing room under header) */
  --ps-page-pad-top: 24px;
  --ps-page-title-gap: 18px;

  /* Typography tokens (single source of truth) */
  --ps-font-family: "Roboto", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --ps-font-size: 14px;
  --ps-line-height: 1.5;
}

body.admin-bar.imdtec-site-account {
  /* WP admin bar (desktop) */
  --ps-top-offset: 32px;
}

body.imdtec-site-account {
  overflow-x: hidden;
  color: var(--ps-account-text);
}

body.imdtec-site-account *,
body.imdtec-site-account *::before,
body.imdtec-site-account *::after {
  box-sizing: border-box;
}

/* ------------------------------
   Topbar (Header)
-------------------------------*/

body.imdtec-site-account .ps-topbar--account {
  position: sticky;
  top: var(--ps-top-offset);
  z-index: 1600;
  height: var(--ps-topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--ps-account-border);
}

/* Override parent theme header styles (some rules set .main-header to a column layout). */
body.imdtec-site-account .ps-topbar--account .main-header {
  display: block !important;
  height: var(--ps-topbar-h);
  min-height: var(--ps-topbar-h) !important;
  padding: 0 !important;
}

body.imdtec-site-account .ps-topbar--account .main-header > .container-header {
  height: 100%;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between;
}

/* IMPORTANT: header must NOT be width-constrained; it should align with sidebar */
body.imdtec-site-account .container-header {
  max-width: none;
  width: 100%;
  height: 100%;
  margin: 0;
  /* Match Google-style breathing room in the header */
  padding-left: 16px;
  padding-right: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Topbar internals (Google Admin alignment) */
body.imdtec-site-account .brand-cluster,
body.imdtec-site-account .brand-cluster .logo,
body.imdtec-site-account .main-nav,
body.imdtec-site-account .header-icons {
  display: flex;
  align-items: center;
}

body.imdtec-site-account .header-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  text-decoration: none;
}

body.imdtec-site-account .header-icons a:hover {
  background: rgba(60, 64, 67, 0.08);
}

body.imdtec-site-account .header-icons svg {
  width: var(--ps-account-icon-size);
  height: var(--ps-account-icon-size);
}

body.imdtec-site-account .header-icons img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: block;
}


body.imdtec-site-account .brand-cluster {
  gap: 8px;
  min-width: var(--ps-account-sidebar-w);
}

body.imdtec-site-account .brand-cluster .brand-logo,
body.imdtec-site-account .brand-cluster .logo {
  display: inline-flex;
  align-items: center;
}

body.imdtec-site-account .brand-cluster .brand-logo img,
body.imdtec-site-account .brand-cluster .logo img {
  height: 28px;
  width: auto;
  display: block;
}

body.imdtec-site-account .main-nav ul.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

body.imdtec-site-account .main-nav ul.nav-menu > li {
  margin: 0;
  padding: 0;
}

body.imdtec-site-account .main-nav ul.nav-menu > li > a {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #202124;
  font-weight: 500;
}

body.imdtec-site-account .main-nav ul.nav-menu > li > a:hover {
  background: rgba(60, 64, 67, 0.08);
}

body.imdtec-site-account .header-icons {
  margin-left: auto;
  gap: 6px;
}


/* Sidebar toggle — match Google (48px button / 24px icon) */
body.imdtec-site-account #ps-sidebar-toggle {
  width: 48px;
  height: 48px;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

body.imdtec-site-account #ps-sidebar-toggle svg {
  width: var(--ps-account-icon-size);
  height: var(--ps-account-icon-size);
}

body.imdtec-site-account #ps-sidebar-toggle:hover {
  background: rgba(60, 64, 67, 0.08);
}

body.imdtec-site-account #ps-sidebar-toggle:focus-visible {
  outline: none;
  /* Avoid the squared focus-outline artifact in some browsers */
  box-shadow: 0 0 0 2px var(--ps-account-blue);
}



/* Hard-disable the default WP accessibility skip link (requested) */
body.imdtec-site-account a.skip-link {
  display: none !important;
}

/* Ensure header content is perfectly vertically centered */
body.imdtec-site-account .ps-topbar--account .main-header {
  height: var(--ps-topbar-h) !important;
  min-height: var(--ps-topbar-h) !important;
}
body.imdtec-site-account .ps-topbar--account .main-header > .container-header {
  height: 100% !important;
  align-items: center !important;
}
body.imdtec-site-account .ps-topbar--account .brand-cluster,
body.imdtec-site-account .ps-topbar--account .header-icons,
body.imdtec-site-account .ps-topbar--account .main-nav {
  align-items: center !important;
}

/* Make the hamburger button match Google style (no square frame) */
body.imdtec-site-account #ps-sidebar-toggle {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.imdtec-site-account #ps-sidebar-toggle:focus {
  outline: none !important;
}
body.imdtec-site-account #ps-sidebar-toggle svg {
  width: 24px;
  height: 24px;
}

/* Reduce logo size slightly to match Google proportions */
body.imdtec-site-account .ps-topbar--account .site-logo {
  height: 28px;
  width: auto;
}

/* Force header menu items to align vertically */
body.imdtec-site-account .ps-topbar--account .main-nav .nav-menu > li > a {
  height: var(--ps-topbar-h);
  display: flex;
  align-items: center;
}

/* Mobile: hide the top horizontal menu to prevent wrapping */
@media (max-width: 980px) {
  body.imdtec-site-account .ps-topbar--account .main-nav {
    display: none !important;
  }
}

/* Footer links (Support / Copyright) must match sidebar menu typography */
body.imdtec-site-account .ps-account-sidebar-footer {
  font-size: 14px;
}
body.imdtec-site-account .ps-account-footer-links a {
  display: flex;
  align-items: center;
  gap: var(--ps-icon-gap);
  padding: 10px 14px;
  color: var(--ps-fg);
  font-size: 14px;
}
body.imdtec-site-account .ps-account-footer-links a::before {
  content: '';
  width: var(--ps-icon-size);
  height: var(--ps-icon-size);
  flex: 0 0 var(--ps-icon-size);
  background-repeat: no-repeat;
  background-position: center;
  background-size: var(--ps-icon-size) var(--ps-icon-size);
}
body.imdtec-site-account .ps-account-footer-links a.ps-footer-support::before {
  background-image: url('../icons/icon-support.svg');
}
/* Give the right cluster the same breathing room as page content */
body.imdtec-site-account .main-header {
  padding-right: 0;
}

/* ------------------------------
   Account Layout (Sidebar + Main)
-------------------------------*/

/* Avoid flex issues with fixed sidebar */
body.imdtec-site-account .ps-account-layout {
  position: relative;
  display: block;
}

/* Sidebar pinned like Google Admin */
body.imdtec-site-account .ps-account-sidebar {
  position: fixed;
  left: 0;
  top: calc(var(--ps-top-offset) + var(--ps-topbar-h));
  bottom: 0;
  width: var(--ps-account-sidebar-w);
  background: #fff;
  border-right: 1px solid var(--ps-account-border);
  border-radius: 0; /* no rounding */
  z-index: 1500;
  display: flex;
  flex-direction: column;
}

/* Nav area scrolls if it has many items */
body.imdtec-site-account .ps-account-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
}

/* Footer inside sidebar (copyright) */
body.imdtec-site-account .ps-account-sidebar-footer {
  padding: 12px 0 16px 0;
  border-top: 1px solid #dadce0;
  font-size: 14px;
  color: #5f6368;
}

body.imdtec-site-account .ps-account-footer-links {
  padding: 10px 16px 0 16px;
}

body.imdtec-site-account .ps-account-footer-copy {
  margin: 0;
  font-size: 12px;
  color: var(--ps-account-muted);
}

/* Main content shifts to the right of the fixed sidebar */
body.imdtec-site-account .ps-account-main {
  margin-left: var(--ps-account-sidebar-w);
  width: calc(100% - var(--ps-account-sidebar-w));
  min-height: calc(100vh - var(--ps-top-offset) - var(--ps-topbar-h));
  padding-bottom: 40px;
}

/* Make page content width consistent + right padding (screen right, not inside sidebar) */
body.imdtec-site-account .ps-account-main .ps-page__container,
body.imdtec-site-account .ps-account-main .ps-container {
  max-width: var(--imdtec-account-max-width);
  margin-left: 0;
  margin-right: auto;
  padding-left: var(--ps-account-page-pad);
  padding-right: var(--ps-account-page-pad);
}

/* Top spacing under sticky header (Google-like) */
body.imdtec-site-account .ps-account-main .ps-page__container{
  padding-top: var(--ps-page-pad-top);
}

/* Page title (consistent & not glued to header) */
body.imdtec-site-account .ps-page-title{
  margin: 0 0 var(--ps-page-title-gap);
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: #202124;
}

/* ------------------------------
   Sidebar Menu
-------------------------------*/

body.imdtec-site-account .ps-account-menu,
body.imdtec-site-account .ps-account-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.imdtec-site-account .ps-account-menu > li {
  position: relative;
}

/* Main item */
body.imdtec-site-account .ps-account-menu li > a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--ps-account-item-h);
  padding: 0 44px 0 24px; /* extra right padding to avoid overlapping the chevron */
  margin: 2px 0;
  width: 100%;
  border-radius: var(--ps-account-item-radius);
  text-decoration: none;
  color: var(--ps-account-muted);
  font-weight: 500;
  line-height: 1;
  user-select: none;
  transition: background 0.12s ease, color 0.12s ease;
}

body.imdtec-site-account .ps-account-menu li > a:hover {
  background: rgba(60, 64, 67, 0.08);
  color: var(--ps-account-text);
}

/* Active / current item */

body.imdtec-site-account .ps-account-menu li.current-menu-item > a,
body.imdtec-site-account .ps-account-menu li.current_page_item > a {
  background: var(--ps-account-blue-bg);
  color: var(--ps-account-blue);
}

/* Ancestors/parents: neutral (no blue background) */
body.imdtec-site-account .ps-account-menu li.current-menu-ancestor > a,
body.imdtec-site-account .ps-account-menu li.current-menu-parent > a,
body.imdtec-site-account .ps-account-menu li.current_page_ancestor > a,
body.imdtec-site-account .ps-account-menu li.current_page_parent > a {
  background: transparent;
  color: var(--ps-account-muted);
}


/* Icons (MAIN ITEMS ONLY) */
body.imdtec-site-account .ps-account-menu li > a::before{
  content: "";
  width: var(--ps-account-icon-size);
  height: var(--ps-account-icon-size);
  flex: 0 0 auto;
  background: transparent;
  -webkit-mask: none;
          mask: none;
}

/* Icon map (add these classes in WP Menu item "CSS Classes") */
body.imdtec-site-account .ps-account-menu li.icon-home > a::before{
  background-color: currentColor;
  -webkit-mask: url('../icons/icon-home.svg') no-repeat center / contain;
          mask: url('../icons/icon-home.svg') no-repeat center / contain;
}
body.imdtec-site-account .ps-account-menu li.icon-apps > a::before{
  background-color: currentColor;
  -webkit-mask: url('../icons/icon-apps.svg') no-repeat center / contain;
          mask: url('../icons/icon-apps.svg') no-repeat center / contain;
}
body.imdtec-site-account .ps-account-menu li.icon-ai > a::before{
  background-color: currentColor;
  -webkit-mask: url('../icons/icon-ai.svg') no-repeat center / contain;
          mask: url('../icons/icon-ai.svg') no-repeat center / contain;
}
body.imdtec-site-account .ps-account-menu li.icon-reporting > a::before{
  background-color: currentColor;
  -webkit-mask: url('../icons/icon-apps.svg') no-repeat center / contain;
          mask: url('../icons/icon-apps.svg') no-repeat center / contain;
}
body.imdtec-site-account .ps-account-menu li.icon-billing > a::before{
  background-color: currentColor;
  -webkit-mask: url('../icons/icon-billing.svg') no-repeat center / contain;
          mask: url('../icons/icon-billing.svg') no-repeat center / contain;
}
body.imdtec-site-account .ps-account-menu li.icon-account > a::before,
body.imdtec-site-account .ps-account-menu li.icon-rules > a::before{
  background-color: currentColor;
  -webkit-mask: url('../icons/icon-account.svg') no-repeat center / contain;
          mask: url('../icons/icon-account.svg') no-repeat center / contain;
}
body.imdtec-site-account .ps-account-menu li.icon-learnhub > a::before{
  background-color: currentColor;
  -webkit-mask: url('../icons/icon-learnhub.svg') no-repeat center / contain;
          mask: url('../icons/icon-learnhub.svg') no-repeat center / contain;
}

/* Submenu: indentation, NO icons */
body.imdtec-site-account .ps-account-menu .sub-menu {
  display: none;
  padding: 4px 0 8px;
  margin: 0;
}

body.imdtec-site-account .ps-account-menu li.is-open > .sub-menu {
  display: block;
}

body.imdtec-site-account .ps-account-menu .sub-menu a {
  min-height: 36px;
  padding: 0 16px 0 64px;
  font-weight: 400;
  color: #3c4043;
  border-radius: 0;
  margin: 1px 0;
  width: 100%;
}

body.imdtec-site-account .ps-account-menu .sub-menu a::before {
  content: none;
  display: none;
}

/* Submenu toggle (chevron) — auto injected by JS */
body.imdtec-site-account .ps-submenu-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: var(--ps-account-icon-btn);
  height: var(--ps-account-icon-btn);
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0.75;
}

body.imdtec-site-account .ps-submenu-toggle::before {
  content: none;
}

body.imdtec-site-account .ps-submenu-toggle svg {
  width: var(--ps-account-icon-size);
  height: var(--ps-account-icon-size);
  display: block;
  transition: transform 0.12s ease;
}

body.imdtec-site-account .ps-account-menu li.is-open > .ps-submenu-toggle svg {
  transform: rotate(90deg); /* down */
}

body.imdtec-site-account .ps-submenu-toggle:hover {
  background: rgba(60, 64, 67, 0.08);
}

body.imdtec-site-account .ps-submenu-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ps-account-blue);
}

/* ------------------------------
   Collapsed Sidebar (desktop)
-------------------------------*/

body.imdtec-site-account.ps-account-sidebar-collapsed .ps-account-sidebar {
  width: var(--ps-account-sidebar-w-collapsed);
}

body.imdtec-site-account.ps-account-sidebar-collapsed .ps-account-main {
  margin-left: var(--ps-account-sidebar-w-collapsed);
  width: calc(100% - var(--ps-account-sidebar-w-collapsed));
}

/* Compact rail: center icons, hide labels, hide submenu tree */
body.imdtec-site-account.ps-account-sidebar-collapsed .ps-account-menu li > a {
  justify-content: center;
  height: var(--ps-account-item-h-collapsed);
  width: 48px;
  padding: 0;
  margin: 4px auto;
  gap: 0;
  font-size: 0; /* hide label */
}


body.imdtec-site-account.ps-account-sidebar-collapsed .ps-submenu-toggle,
body.imdtec-site-account.ps-account-sidebar-collapsed .ps-account-menu .sub-menu {
  display: none !important;
}

/* In collapsed (rail) mode, keep footer icons but hide copyright text */
body.imdtec-site-account.ps-account-sidebar-collapsed .ps-account-footer-copy {
  display: none;
}

body.imdtec-site-account.ps-account-sidebar-collapsed .ps-account-sidebar-footer {
  padding: 8px 0;
}

/* ------------------------------
   Hidden Sidebar (desktop)
-------------------------------*/

body.imdtec-site-account.ps-account-sidebar-hidden .ps-account-sidebar {
  display: none;
}

body.imdtec-site-account.ps-account-sidebar-hidden .ps-account-main {
  margin-left: 0;
  width: 100%;
}

/* ------------------------------
   Mobile (off-canvas sidebar)
-------------------------------*/

@media (max-width: 1024px) {
  body.imdtec-site-account .ps-account-sidebar {
    width: var(--ps-account-sidebar-w);
    transform: translateX(-105%);
    transition: transform 0.18s ease;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  }

  body.imdtec-site-account.ps-account-sidebar-open .ps-account-sidebar {
    transform: translateX(0);
  }

  body.imdtec-site-account .ps-account-backdrop {
    position: fixed;
    left: 0;
    right: 0;
    top: calc(var(--ps-top-offset) + var(--ps-topbar-h));
    bottom: 0;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 1400;
  }

  body.imdtec-site-account.ps-account-sidebar-open .ps-account-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* On mobile, content always takes full width */
  body.imdtec-site-account .ps-account-main {
    margin-left: 0;
    width: 100%;
  }

  /* Avoid rail behaviour on mobile */
  body.imdtec-site-account.ps-account-sidebar-collapsed .ps-account-sidebar-footer {
    display: block;
  }
}

/* ------------------------------
   Footer note
-------------------------------*/
/* Account pages have NO page footer by design (only sidebar copyright). */


/* Footer menu tweaks */
body.imdtec-site-account .ps-account-menu--footer > li > a {
  font-weight: 500;
  font-size: 15px;
}


body.imdtec-site-account .ps-account-menu > li.icon-support > a::before {
  -webkit-mask: url("../icons/icon-support.svg") no-repeat center / contain;
  mask: url("../icons/icon-support.svg") no-repeat center / contain;
}

/* =====================================================================
   v10 patch (2026-01): Google-perfect header + sidebar alignment
   - Fixes hamburger "boxed" look (targets .ps-sidebar-toggle)
   - Fixes submenu chevron positioning on nested items (li position + left chevrons)
   - Adds fixed workspace label styling
===================================================================== */

/* Token patch: ensure icon button sizing exists + keep typography consistent */
body.imdtec-site-account {
  --ps-account-icon-btn: 32px;
  --ps-submenu-pad-l2: 64px;
  --ps-submenu-pad-l3: 80px;

  /* Fallbacks used by some footer rules (keeps cascade stable) */
  --ps-icon-gap: 16px;
  --ps-icon-size: var(--ps-account-icon-size);
  --ps-fg: var(--ps-account-muted);

  font-family: var(--ps-font-family);
  font-size: var(--ps-font-size);
  line-height: var(--ps-line-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header hamburger (no square frame) */
body.imdtec-site-account .ps-sidebar-toggle {
  width: 48px;
  height: 48px;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  box-shadow: none !important;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

body.imdtec-site-account .ps-sidebar-toggle:hover {
  background: rgba(60, 64, 67, 0.08) !important;
}

body.imdtec-site-account .ps-sidebar-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ps-account-blue);
}

body.imdtec-site-account .ps-sidebar-toggle svg {
  width: var(--ps-account-icon-size);
  height: var(--ps-account-icon-size);
}

/* Top header menu: keep items compact like Google */
body.imdtec-site-account .ps-topbar--account .main-nav .nav-menu > li > a {
  height: 40px !important;
  display: inline-flex;
  align-items: center;
}

/* Workspace title (fixed, clean) */
body.imdtec-site-account .ps-workspace-label {
  flex: 0 0 auto;
  padding: 16px 16px 8px 24px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ps-account-muted);
  border-bottom: 1px solid var(--ps-account-border);
  background: #fff;
}

body.imdtec-site-account .ps-account-nav {
  padding-top: 8px;
}

body.imdtec-site-account.ps-account-sidebar-collapsed .ps-workspace-label {
  display: none;
}

/* Submenu chevrons: ensure correct containing block at ALL depths */
body.imdtec-site-account .ps-account-menu li {
  position: relative;
}

/* Ensure sub-items keep room on the right for chevron when needed */
body.imdtec-site-account .ps-account-menu .sub-menu a {
  padding: 0 44px 0 var(--ps-submenu-pad-l2);
}

body.imdtec-site-account .ps-account-menu .sub-menu .sub-menu a {
  padding-left: var(--ps-submenu-pad-l3);
}

/* Ensure chevron button has stable hit area and stays clickable */
body.imdtec-site-account .ps-submenu-toggle {
  width: var(--ps-account-icon-btn);
  height: var(--ps-account-icon-btn);
  z-index: 2;
}

/* Nudge top-level chevron slightly inward (closer to Google) */
body.imdtec-site-account .ps-account-menu > li > .ps-submenu-toggle {
  right: 12px;
}

/* Google-like: nested groups show chevron on the LEFT (close to label) */
body.imdtec-site-account .ps-account-menu .sub-menu li.ps-has-children > .ps-submenu-toggle {
  left: calc(var(--ps-submenu-pad-l2) - var(--ps-account-icon-btn));
  right: auto;
}

body.imdtec-site-account .ps-account-menu .sub-menu .sub-menu li.ps-has-children > .ps-submenu-toggle {
  left: calc(var(--ps-submenu-pad-l3) - var(--ps-account-icon-btn));
}

/* ============================================================
   PATCH: Google-like sidebar chevron
   - Chevron at the START of the item (not at the end)
   - Chevron stays aligned with the PARENT row even when submenu is open
   ============================================================ */

body.imdtec-site-account {
  /* Level-1 link padding start (reserves a slot for the chevron) */
  --ps-account-item-pad-l1: 40px;

  /* Keep submenu labels aligned with level-1 label start */
  --ps-submenu-pad-l2: 80px;
  --ps-submenu-pad-l3: 96px;

  /* Sub-item row height (used to pin the chevron vertically) */
  --ps-account-subitem-h: 36px;
}

/* Level-1 links: remove the “right chevron space” and reserve start slot */
body.imdtec-site-account .ps-account-menu > li > a {
  padding: 0 16px 0 var(--ps-account-item-pad-l1);
}

/* Level-1 chevron: move to START + pin to the parent row center */
body.imdtec-site-account .ps-account-menu > li.ps-has-children > .ps-submenu-toggle {
  left: 4px;
  right: auto;

  /* IMPORTANT: pin to the first row (do NOT use 50% of li height) */
  top: calc(2px + (var(--ps-account-item-h) / 2));
  transform: translateY(-50%);
}

/* Submenu links: reclaim wasted right padding (chevron is no longer on the right) */
body.imdtec-site-account .ps-account-menu .sub-menu a {
  padding-right: 16px;
}

/* Submenu chevrons: keep their LEFT positioning (already handled in your CSS),
   but pin them vertically to the sub-item row (so they don’t drift when expanded) */
body.imdtec-site-account .ps-account-menu .sub-menu li.ps-has-children > .ps-submenu-toggle {
  top: calc(1px + (var(--ps-account-subitem-h) / 2));
  transform: translateY(-50%);
}

/* Workspace label alignment with the new start padding */
body.imdtec-site-account .ps-workspace-label {
  padding-left: var(--ps-account-item-pad-l1);
}

/* UX parity: hovering the chevron should highlight the whole row */
body.imdtec-site-account
.ps-account-menu > li.ps-has-children:not(.current-menu-item):not(.current-menu-ancestor):hover > a {
  background: rgba(60, 64, 67, 0.08);
  color: var(--ps-account-text);
}

/* Optional: RTL support (only إذا كانت صفحاتك RTL فعلاً) */
html[dir="rtl"] body.imdtec-site-account .ps-account-menu > li.ps-has-children > .ps-submenu-toggle {
  right: 4px;
  left: auto;
}
html[dir="rtl"] body.imdtec-site-account .ps-account-menu > li > a {
  padding: 0 var(--ps-account-item-pad-l1) 0 16px;
}

/* =========================================================
   Submenu3 (Formations) — Google-like tiles (3 per column)
   Scoped to #submenu3Dropdown only
   ========================================================= */

/* خلي بلوك العناصر يأخذ مساحة الأعمدة المتبقية (مع إبقاء العمود الأول كما هو) */
#submenu3Dropdown .submenu3-allcats{
  grid-column: 2 / -1;
}

/* Grid: يعبّي العناصر عموديًا (3 عناصر في العمود) ثم يفتح عمود جديد */
#submenu3Dropdown .imd-submenu3-solutions{
  display: grid;
  grid-template-rows: repeat(3, auto);    /* كل ثلاث عناصر تحت بعض */
  grid-auto-flow: column;                /* التعبئة عموديًا أولاً */
  grid-auto-columns: minmax(200px, 1fr); /* عرض العمود */
  column-gap: 24px;
  row-gap: 18px;

  margin: 0;
  padding: 0;
  list-style: none;
}

/* Tile layout */
#submenu3Dropdown .imd-submenu3-solutions .imd-solution-item{
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0; /* override any old margins */
}

/* Icon sizing (مثل Google: أيقونة صغيرة بجانب العنوان) */
#submenu3Dropdown .imd-submenu3-solutions .chip-icon{
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  margin-top: 2px;
}

/* Text block */
#submenu3Dropdown .imd-solution-text{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Title link */
#submenu3Dropdown .imd-solution-title{
  font-size: 16px;
  font-weight: 700;
  color: #17488A;
  text-decoration: none;
  padding-right: 0; /* لا نحتاج مساحة للسهم */
}

/* إلغاء سهم الروابط في submenu3 فقط (لو كان مفعّل من قواعد عامة) */
#submenu3Dropdown .imd-solution-title::after{
  content: none !important;
}

#submenu3Dropdown .imd-solution-title:hover{
  text-decoration: underline;
}

/* Summary under title */
#submenu3Dropdown .imd-solution-summary{
  font-size: 14px;
  line-height: 1.5;
  color: #555;

  /* اختيارياً: قصّ الوصف لسطرين مثل Google */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
