/*
 * Biloo mobile workspace footer.
 * Final X-style authority: compact, flat, edge-to-edge icon-and-label tabs.
 */

@media (max-width: 760px) {
  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell {
    --biloo-mobile-x-footer-height: 57px;
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* The mobile app title sits directly beside the menu trigger. */
  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-workspace-header {
    grid-template-columns: 46px minmax(0, 1fr) 50px !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-workspace-header .mobile-workspace-brand {
    display: none !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-workspace-header .mobile-workspace-title {
    grid-column: 2 !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav {
    position: fixed !important;
    inset: auto 0 0 0 !important;
    z-index: 175 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-height: calc(var(--biloo-mobile-x-footer-height) + env(safe-area-inset-bottom)) !important;
    margin: 0 !important;
    padding: 0 0 env(safe-area-inset-bottom) !important;
    overflow: visible !important;
    border: 0 !important;
    border-top: 1px solid #eff3f4 !important;
    border-radius: 0 !important;
    color: #536471 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    isolation: isolate !important;
    contain: layout paint !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav::before,
  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav::after {
    content: none !important;
    display: none !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button) {
    position: relative !important;
    z-index: 1 !important;
    display: grid !important;
    grid-template-rows: 24px 11px !important;
    place-items: center !important;
    align-content: center !important;
    gap: 2px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: var(--biloo-mobile-x-footer-height) !important;
    margin: 0 !important;
    padding: 4px 1px 3px !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: #536471 !important;
    -webkit-text-fill-color: currentColor !important;
    background: transparent !important;
    box-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    font: inherit !important;
    text-decoration: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  /* X uses a transient circular touch response, not a persistent active pill. */
  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button)::before {
    content: "" !important;
    position: absolute !important;
    z-index: -1 !important;
    top: 4px !important;
    left: 50% !important;
    display: block !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 999px !important;
    background: transparent !important;
    box-shadow: none !important;
    opacity: 1 !important;
    transform: translateX(-50%) scale(1) !important;
    transition: background-color 120ms ease, transform 120ms ease, box-shadow 120ms ease !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button)::after {
    content: none !important;
    display: none !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button):active::before {
    background: rgba(15, 20, 25, 0.08) !important;
    transform: translateX(-50%) scale(0.92) !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button):focus-visible {
    outline: none !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button):focus-visible::before {
    background: rgba(29, 155, 240, 0.1) !important;
    box-shadow: 0 0 0 2px #1d9bf0 !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button) svg {
    position: relative !important;
    z-index: 1 !important;
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    margin: 0 !important;
    color: currentColor !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.85 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    filter: none !important;
    transform: none !important;
    transition: color 120ms ease, stroke-width 120ms ease !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button) > span {
    position: static !important;
    z-index: 1 !important;
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 2px !important;
    overflow: hidden !important;
    clip: auto !important;
    clip-path: none !important;
    border: 0 !important;
    color: currentColor !important;
    -webkit-text-fill-color: currentColor !important;
    font-family: var(--font-biloo-manrope), Manrope, "Segoe UI", sans-serif !important;
    font-size: 8.5px !important;
    font-weight: 620 !important;
    line-height: 1 !important;
    letter-spacing: -0.015em !important;
    text-align: center !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* Active tabs are darker and slightly heavier, with no card, underline or color fill. */
  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > a[aria-current="page"],
  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > button.active,
  body[data-workspace-system="financial-os-v1"] .erp-shell[data-mobile-nav-open="true"] > .mobile-bottom-nav > button,
  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > button:last-child.active,
  body[data-workspace-system="financial-os-v1"] .erp-shell[data-mobile-nav-open="true"] > .mobile-bottom-nav > button:last-child {
    color: #0f1419 !important;
    -webkit-text-fill-color: #0f1419 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > a[aria-current="page"]::before,
  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > button.active::before,
  body[data-workspace-system="financial-os-v1"] .erp-shell[data-mobile-nav-open="true"] > .mobile-bottom-nav > button::before,
  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > button:last-child.active::before,
  body[data-workspace-system="financial-os-v1"] .erp-shell[data-mobile-nav-open="true"] > .mobile-bottom-nav > button:last-child::before {
    background: transparent !important;
    box-shadow: none !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > a[aria-current="page"] svg,
  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > button.active svg,
  body[data-workspace-system="financial-os-v1"] .erp-shell[data-mobile-nav-open="true"] > .mobile-bottom-nav > button svg,
  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > button:last-child.active .app-icon,
  body[data-workspace-system="financial-os-v1"] .erp-shell[data-mobile-nav-open="true"] > .mobile-bottom-nav > button:last-child .app-icon {
    color: #0f1419 !important;
    fill: none !important;
    stroke: #0f1419 !important;
    stroke-width: 2.35 !important;
    filter: none !important;
    transform: none !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > a[aria-current="page"] > span,
  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > button.active > span,
  body[data-workspace-system="financial-os-v1"] .erp-shell[data-mobile-nav-open="true"] > .mobile-bottom-nav > button > span {
    color: #0f1419 !important;
    -webkit-text-fill-color: #0f1419 !important;
    font-weight: 780 !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .workspace {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    padding-bottom: calc(var(--biloo-mobile-x-footer-height) + env(safe-area-inset-bottom) + 10px) !important;
    scroll-padding-bottom: calc(var(--biloo-mobile-x-footer-height) + env(safe-area-inset-bottom) + 14px) !important;
  }

  /* The drawer and backdrop remain above the tab bar. */
  body[data-workspace-system="financial-os-v1"] .erp-shell[data-mobile-nav-open="true"] > .mobile-bottom-nav {
    z-index: 175 !important;
    filter: none !important;
    pointer-events: none !important;
  }
}

@media (max-width: 370px) {
  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button) > span {
    padding-inline: 1px !important;
    font-size: 8px !important;
    letter-spacing: -0.025em !important;
  }
}

@media (max-width: 760px) and (orientation: landscape) and (max-height: 560px) {
  body[data-workspace-system="financial-os-v1"] .erp-shell {
    --biloo-mobile-x-footer-height: 50px;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button) {
    grid-template-rows: 21px 9px !important;
    gap: 1px !important;
    padding-block: 2px !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button)::before {
    top: 2px !important;
    width: 30px !important;
    height: 30px !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button) svg {
    width: 20px !important;
    height: 20px !important;
  }

  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button) > span {
    font-size: 7.5px !important;
  }
}

html[data-theme="dark"] body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav,
html.dark body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav,
body[data-theme="dark"][data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav {
  border-top-color: #2f3336 !important;
  color: #8b98a5 !important;
  background: #000000 !important;
}

html[data-theme="dark"] body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button),
html.dark body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button),
body[data-theme="dark"][data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button) {
  color: #8b98a5 !important;
  -webkit-text-fill-color: #8b98a5 !important;
}

html[data-theme="dark"] body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button):active::before,
html.dark body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button):active::before,
body[data-theme="dark"][data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > :is(a, button):active::before {
  background: rgba(239, 243, 244, 0.1) !important;
}

html[data-theme="dark"] body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > a[aria-current="page"],
html[data-theme="dark"] body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > button.active,
html[data-theme="dark"] body[data-workspace-system="financial-os-v1"] .erp-shell[data-mobile-nav-open="true"] > .mobile-bottom-nav > button,
html.dark body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > a[aria-current="page"],
html.dark body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > button.active,
html.dark body[data-workspace-system="financial-os-v1"] .erp-shell[data-mobile-nav-open="true"] > .mobile-bottom-nav > button,
body[data-theme="dark"][data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > a[aria-current="page"],
body[data-theme="dark"][data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > button.active,
body[data-theme="dark"][data-workspace-system="financial-os-v1"] .erp-shell[data-mobile-nav-open="true"] > .mobile-bottom-nav > button {
  color: #f2f2f2 !important;
  -webkit-text-fill-color: #f2f2f2 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > a[aria-current="page"] svg,
html[data-theme="dark"] body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > button.active svg,
html[data-theme="dark"] body[data-workspace-system="financial-os-v1"] .erp-shell[data-mobile-nav-open="true"] > .mobile-bottom-nav > button svg,
html.dark body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > a[aria-current="page"] svg,
html.dark body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > button.active svg,
html.dark body[data-workspace-system="financial-os-v1"] .erp-shell[data-mobile-nav-open="true"] > .mobile-bottom-nav > button svg,
body[data-theme="dark"][data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > a[aria-current="page"] svg,
body[data-theme="dark"][data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav > button.active svg,
body[data-theme="dark"][data-workspace-system="financial-os-v1"] .erp-shell[data-mobile-nav-open="true"] > .mobile-bottom-nav > button svg {
  color: #f2f2f2 !important;
  stroke: #f2f2f2 !important;
}

@media (min-width: 761px) {
  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav,
  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav *,
  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav *::before,
  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  body[data-workspace-system="financial-os-v1"] .erp-shell > .mobile-bottom-nav {
    display: none !important;
  }
}
