/* ============================================
   Microsoft Dynamics 365 Unified Service Desk Theme
   TMS Web Application
   ============================================ */

/* === CSS Variables - D365 USD Color Palette === */
:root {
    /* Primary Colors - D365 Blue */
    --d365-primary: #2266e3;
    --d365-primary-dark: #1b52b3;
    --d365-primary-light: #4d8df7;
    --d365-primary-lighter: #e8f0fe;
    
    /* Header - deep navy → royal blue (profile-badge style) */
    --d365-header-bg: #000A3A;
    --d365-header-bg-gradient: linear-gradient(90deg, #002B7F 0%, #001a55 48%, #000A3A 100%);
    --d365-header-secondary: #001435;
    --d365-header-height: 56px;
    
    /* Sidebar Navigation */
    --d365-sidebar-bg: #f8f9fa;
    --d365-sidebar-hover: #e9ecef;
    --d365-sidebar-active: #e3f2fd;
    --d365-sidebar-border: #dee2e6;
    --d365-sidebar-width: 256px;
    --d365-sidebar-collapsed-width: 64px;
    --d365-sidebar-transition: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Accent Colors */
    --d365-success: #107c10;
    --d365-warning: #ff8c00;
    --d365-danger: #d13438;
    --d365-info: #0078d4;
    --d365-orange: #ca5010;
    
    /* Background Colors */
    --d365-bg-primary: #ffffff;
    --d365-bg-secondary: #f3f2f1;
    --d365-bg-tertiary: #edebe9;
    --d365-bg-page: #faf9f8;
    
    /* Border Colors */
    --d365-border: #e1dfdd;
    --d365-border-dark: #c8c6c4;
    --d365-border-light: #f3f2f1;
    
    /* Text Colors */
    --d365-text-primary: #323130;
    --d365-text-secondary: #605e5c;
    --d365-text-muted: #a19f9d;
    --d365-text-inverse: #ffffff;
    --d365-link: #2266e3;
    
    /* Command Bar */
    --d365-commandbar-bg: #f3f2f1;
    --d365-commandbar-border: #e1dfdd;
    
    /* Shadow */
    --d365-shadow-sm: 0 1px 2px rgba(0,0,0,0.1);
    --d365-shadow-md: 0 2px 4px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
    --d365-shadow-lg: 0 4px 8px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.08);
    
    /* Typography - Segoe UI like D365 */
    --d365-font-family: 'Segoe UI', 'Segoe UI Web', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    --d365-font-size-xs: 11px;
    --d365-font-size-sm: 12px;
    --d365-font-size-md: 13px;
    --d365-font-size-lg: 14px;
    --d365-font-size-xl: 17px;
    --d365-font-size-xxl: 20px;
    --d365-form-heading-font: var(--d365-font-family), 'Beyonder', 'Beyonders', sans-serif;
    --d365-form-heading-color: #374151;
    --d365-form-heading-size: var(--ui-heading-font-size, 18px);
    --d365-dashboard-heading-size: 14px;
    
    /* Spacing */
    --d365-spacing-xs: 4px;
    --d365-spacing-sm: 8px;
    --d365-spacing-md: 12px;
    --d365-spacing-lg: 16px;
    --d365-spacing-xl: 24px;
    
    /* Border Radius */
    --d365-radius-sm: 2px;
    --d365-radius-md: 4px;
    --d365-radius-lg: 6px;
    
    /* Transitions */
    --d365-transition: all 0.15s ease;
}

/* === Base Styles === */
html, body {
    font-family: var(--d365-font-family);
    font-size: var(--d365-font-size-md);
    color: var(--d365-text-primary);
    background-color: var(--d365-bg-page);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.4;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--d365-text-primary);
    margin-bottom: var(--d365-spacing-md);
    line-height: 1.3;
}

h1 { font-size: var(--d365-font-size-xxl); }
h1.d365-page-heading-title {
    font-size: var(--d365-form-heading-size);
    font-weight: 700;
    margin-bottom: 0;
}
h2 { font-size: var(--d365-font-size-xl); }
h3 { font-size: var(--d365-font-size-lg); font-weight: 600; }
h4 { font-size: var(--d365-font-size-md); font-weight: 600; }

a { color: var(--d365-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === D365 Header Bar (Top Navigation) — covers hamburger === */
.d365-header {
    background: var(--d365-header-bg-gradient, var(--d365-header-bg));
    height: var(--d365-header-height);
    display: flex;
    align-items: center;
    padding: 0 var(--d365-spacing-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    gap: var(--d365-spacing-sm);
}

.d365-header-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 1.25rem;
    flex-shrink: 0;
}

.d365-header-meta {
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
}

.d365-header-datetime {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.d365-header-meta-top {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.d365-header-date,
.d365-header-time {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.d365-header-date {
    color: rgba(255, 255, 255, 0.82);
    font-size: 11px;
    font-weight: 600;
}

.d365-header-date i {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
}

.d365-header-time {
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.d365-header-time i {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.55);
}

.d365-header-timezone {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.d365-header-timezone i {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    flex-shrink: 0;
}

.d365-header-timezone-select {
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    border: none;
    border-radius: 0;
    font-size: 11px;
    font-weight: 600;
    padding: 0 1rem 0 0;
    cursor: pointer;
    max-width: 9.5rem;
}

.d365-header-timezone-select:hover {
    color: rgba(255, 255, 255, 0.95);
}

.d365-header-timezone-select:focus {
    outline: none;
    color: #ffffff;
}

.d365-header-timezone-select option {
    background: var(--d365-header-bg);
    color: #ffffff;
}

.d365-header-divider {
    width: 1px;
    height: 2rem;
    background: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

.d365-header-search-btn {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    padding: 0.35rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--d365-transition);
}

.d365-header-home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    padding: 0.35rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--d365-transition);
    text-decoration: none;
}

.d365-header-home-btn:hover,
.d365-header-home-btn:focus-visible,
.d365-header-home-btn.active {
    color: #ffffff;
    outline: none;
    text-decoration: none;
}

.d365-header-search-btn:hover,
.d365-header-search-btn:focus-visible {
    color: #ffffff;
    outline: none;
}

.d365-header-brand {
    display: flex;
    align-items: center;
    gap: var(--d365-spacing-sm);
    color: var(--d365-text-inverse);
    font-size: var(--d365-font-size-lg);
    font-weight: 600;
}

.d365-header-brand i {
    font-size: 18px;
    color: #4d8df7;
}

.d365-header-recent {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
    position: relative;
}

.d365-header-recent-item {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    color: rgba(255,255,255,0.82);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    transition: var(--d365-transition);
}

.d365-header-recent-item i {
    font-size: 16px;
    color: inherit;
}

.d365-header-recent-short {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 10px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: 0.25px;
    text-transform: uppercase;
    color: inherit;
}

.d365-header-recent-item:hover,
.d365-header-recent-item.active {
    color: #ffffff;
    background: transparent;
    border-bottom: 3px solid var(--d365-primary);
    text-decoration: none;
}

.d365-header-recent-more {
    position: relative;
}

.d365-header-recent-chevron {
    width: 28px;
    height: 42px;
    border-radius: 4px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--d365-transition);
}

.d365-header-recent-chevron:hover,
.d365-header-recent-chevron.open {
    background: transparent;
    color: #ffffff;
    border-bottom: 2px solid transparent; /* removed underline hover from chevron */
}

.d365-header-recent-chevron i {
    font-size: 14px;
    color: #ffffff;
}

.d365-header-recent-chevron.open i {
    transform: rotate(180deg);
}

.d365-header-recent-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 190px;
    background: #ffffff;
    border: 1px solid var(--d365-border);
    border-radius: 6px;
    box-shadow: var(--d365-shadow-lg);
    padding: 4px;
    z-index: 1200;
}

.d365-header-recent-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    color: var(--d365-text-primary);
    text-decoration: none;
    font-size: 11px;
}

.d365-header-recent-dropdown-item:hover,
.d365-header-recent-dropdown-item.active {
    background: var(--d365-bg-secondary);
    text-decoration: none;
    color: var(--d365-text-primary);
}

.d365-header-recent-dropdown-item i {
    font-size: 12px;
    color: var(--d365-primary);
}

.d365-header-recent-dropdown-short {
    min-width: 44px;
    font-weight: 700;
    font-size: 10px;
    color: var(--d365-primary);
}

.d365-header-recent-dropdown-title {
    color: var(--d365-text-secondary);
    white-space: nowrap;
}

.d365-header-nav {
    display: flex;
    align-items: center;
    gap: 0;
}

.d365-header-nav-item {
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    padding: 6px 12px;
    transition: var(--d365-transition);
    text-decoration: none;
    font-size: var(--d365-font-size-sm);
    display: flex;
    align-items: center;
    gap: 6px;
    height: 36px;
}

.d365-header-nav-item:hover {
    color: #ffffff;
    background-color: rgba(255,255,255,0.1);
    text-decoration: none;
}

.d365-header-recent-desktop-only {
    display: inline-flex;
}

.d365-header-user {
    display: block;
    position: relative;
    flex-shrink: 0;
}

.d365-header-user-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #60a5fa;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--d365-transition);
    box-shadow: 0 4px 14px rgba(96, 165, 250, 0.25);
}

.d365-header-user-btn:hover,
.d365-header-user-btn:focus-visible {
    background: #3b82f6;
    outline: none;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}

.d365-header-user-avatar {
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1;
}

.d365-header-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: #ffffff;
    border: 1px solid var(--d365-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 8px;
    z-index: 1100;
}

.d365-header-user-name {
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--d365-text-primary);
    border-bottom: 1px solid var(--d365-border-light);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.d365-header-user-theme {
    padding: 4px 2px 8px;
    border-bottom: 1px solid var(--d365-border-light);
    margin-bottom: 4px;
}

.d365-header-user-theme-label {
    padding: 4px 8px 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--d365-text-muted);
}

.d365-header-user-theme-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}

.d365-header-user-theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 54px;
    padding: 8px 4px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--d365-text-secondary);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
}

.d365-header-user-theme-btn i {
    font-size: 16px;
    line-height: 1;
}

.d365-header-user-theme-btn:hover {
    background: var(--d365-bg-secondary);
    color: var(--d365-text-primary);
}

.d365-header-user-theme-btn.is-selected {
    background: var(--d365-primary-lighter);
    border-color: color-mix(in srgb, var(--d365-primary) 35%, transparent);
    color: var(--d365-primary);
}

.d365-header-user-signout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--d365-text-primary);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
}

.d365-header-user-signout:hover {
    background: var(--d365-bg-secondary);
    color: var(--d365-danger);
}

/* Shell appearance — Light / Dark / System (html[data-appearance]) */
html[data-appearance="dark"] {
    color-scheme: dark;
    --d365-primary-lighter: #1a3a5c;
    --d365-sidebar-bg: #1b1a19;
    --d365-sidebar-hover: #292827;
    --d365-sidebar-active: #243447;
    --d365-sidebar-border: #3b3a39;
    --d365-bg-primary: #1f1e1d;
    --d365-bg-secondary: #292827;
    --d365-bg-tertiary: #323130;
    --d365-bg-page: #141414;
    --d365-border: #3b3a39;
    --d365-border-dark: #605e5c;
    --d365-border-light: #292827;
    --d365-text-primary: #f3f2f1;
    --d365-text-secondary: #c8c6c4;
    --d365-text-muted: #a19f9d;
    --d365-commandbar-bg: #292827;
    --d365-commandbar-border: #3b3a39;
    --d365-form-heading-color: #f3f2f1;
    --d365-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
    --d365-shadow-md: 0 2px 4px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.35);
    --d365-shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.55), 0 2px 4px rgba(0, 0, 0, 0.4);
}

html[data-appearance="dark"] .d365-sidebar {
    background-color: var(--d365-sidebar-bg);
    border-right-color: var(--d365-sidebar-border);
}

html[data-appearance="dark"] .d365-header-user-menu {
    background: var(--d365-bg-primary);
    border-color: var(--d365-border);
}

html[data-appearance="dark"] .d365-header-user-theme-btn.is-selected {
    background: color-mix(in srgb, var(--d365-primary) 22%, transparent);
}

/* === D365 Sidebar Navigation (HRMS-inspired) === */
.d365-sidebar {
    width: var(--d365-sidebar-width);
    background-color: #ffffff;
    height: 100%;
    border-right: 1px solid #d1d5db;
    display: flex;
    flex-direction: column;
    transition:
        width var(--d365-sidebar-transition),
        box-shadow var(--d365-sidebar-transition),
        background-color var(--d365-sidebar-transition);
    position: relative;
    flex-shrink: 0;
    overflow: visible;
    will-change: width;
    z-index: 1100;
}

.d365-sidebar-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: visible;
}

/* Full-height nav panel divider — visible through home/top area above CRUD overlap */
.d365-sidebar-shell::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: #d1d5db;
    pointer-events: none;
    z-index: 1204;
}

.d365-sidebar.collapsed {
    width: var(--d365-sidebar-collapsed-width);
}

.d365-sidebar-nav {
    display: flex;
    flex-direction: column;
    /* Grow to the sidebar's full height even when the parent's height is only definite through
       flex: a percentage height alone can resolve to auto, which used to let the footer ride up
       under the last link instead of sitting on the bottom edge. */
    flex: 1 1 auto;
    /* No height:100% here — the shell already stacks a lock button above this panel, so a 100%
       basis made the nav overflow its parent and the footer slid out of the pane. Growing with
       flex and letting the footer use margin-top:auto parks it on the bottom edge instead. */
    min-height: 0;
    min-width: var(--d365-sidebar-collapsed-width);
    transition: opacity 200ms ease;
    overflow: hidden;
}

/* The flyout owns everything between the rail and the footer, so it must grow and let the
   scrolling list take the leftover height. Without this the list grows past the pane and the
   footer floats up under it. */
.d365-nav-flyout {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
}

/* --- D365-style top rail (search + lock) --- */
.d365-nav-top-rail {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 8px;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
    background: #ffffff;
    position: relative;
    z-index: 1;
}

.d365-nav-search {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 8px;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.d365-nav-search:focus-within {
    border-color: #93c5fd;
    background: #ffffff;
}

.d365-nav-search-icon {
    color: #9ca3af;
    font-size: 14px;
    flex-shrink: 0;
}

.d365-nav-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: #111827;
    font-size: 13px;
    line-height: 1.4;
    outline: none;
    caret-color: #111827;
}

.d365-nav-search-input.has-query {
    color: #111827;
    font-weight: 700;
    font-size: 14px;
}

.d365-nav-search-input::placeholder {
    color: #9ca3af;
}

.d365-nav-search-input::-webkit-search-cancel-button {
    display: none;
}

.d365-nav-search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #9ca3af;
    padding: 0;
    cursor: pointer;
}

.d365-nav-search-clear i {
    font-size: 11px;
    line-height: 1;
}

.d365-nav-search-clear:hover {
    background: #e5e7eb;
    color: #374151;
}

.d365-nav-search-hint {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
    padding: 0 12px 8px;
}

.d365-nav-top-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 36px;
    border: none;
    background: transparent;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    padding: 0;
    border-radius: 8px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.d365-nav-top-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.d365-nav-top-btn i {
    font-size: 16px;
    line-height: 1;
}

.d365-nav-top-home {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    min-height: 36px;
    flex-shrink: 0;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.d365-nav-top-home:hover {
    background: #f3f4f6;
    color: #111827;
    text-decoration: none;
}

.d365-nav-top-home i {
    font-size: 18px;
    line-height: 1;
}

.d365-nav-top-home.active {
    color: #0d6efd;
}

/* Lock badge — sits on nav edge, fully visible above content */
.d365-nav-lock-btn {
    position: absolute;
    right: 0;
    top: 52px;
    transform: translateX(50%);
    width: 22px;
    height: 22px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1205;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
    transition: box-shadow 200ms ease, color 200ms ease, background-color 200ms ease, border-color 200ms ease;
    padding: 0;
    color: #6b7280;
    line-height: 0;
    pointer-events: auto;
}

.d365-nav-lock-btn i {
    font-size: 11px;
    line-height: 1;
    display: block;
}

.d365-nav-lock-btn:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
    color: #374151;
}

.d365-nav-lock-btn.is-locked {
    color: #2563eb;
    border-color: #93c5fd;
    background: #eff6ff;
}

.d365-nav-search-hidden {
    display: none !important;
}

.d365-sidebar-nav.is-searching .d365-nav-group:not(:has(.d365-nav-group-items .d365-nav-item)) {
    display: none !important;
}

.d365-sidebar-nav.is-searching .d365-nav-search-trigger {
    display: none !important;
}

.d365-nav-search-trigger {
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

/* Legacy floating lock duplicate (removed) */
.d365-nav-lock-btn.d365-nav-lock-btn-legacy {
    display: none;
}

/* Legacy brand header (unused — kept for reference in collapsed overrides below) */
.d365-nav-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px;
    background: #ffffff;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
    min-height: 58px;
}

.d365-nav-brand-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.d365-nav-brand-logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.d365-nav-brand-logo i {
    font-size: 16px;
    color: #ffffff;
}

.d365-nav-brand-text {
    font-weight: 600;
    font-size: 16px;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 1;
    max-width: 180px;
    transition: opacity 220ms ease, max-width var(--d365-sidebar-transition);
}

.d365-sidebar.collapsed .d365-nav-top-rail {
    align-items: center;
    justify-content: flex-start;
    padding: 10px 12px 8px;
}

.d365-sidebar.collapsed .d365-nav-top-home {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
}

.d365-sidebar.collapsed .d365-nav-lock-btn {
    top: 48px;
}

/* --- Collapse toggle button (legacy — replaced by lock) --- */
.d365-nav-collapse-btn {
    position: absolute;
    right: -12px;
    top: 80px;
    width: 24px;
    height: 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 200ms ease, color 200ms ease;
    padding: 0;
    color: #6b7280;
    font-size: 12px;
}

.d365-nav-collapse-btn:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    color: #374151;
}

.d365-nav-collapse-btn.is-pinned {
    color: #6d28d9;
    border-color: #c4b5fd;
    background: #faf5ff;
}

@media (min-width: 769px) {
    .d365-app-container {
        position: relative;
        width: 100%;
    }

    .d365-page.sidebar-overlay-content .d365-sidebar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100%;
        z-index: 1100;
        flex-shrink: 0;
    }

    .d365-page.sidebar-overlay-content .d365-sidebar.collapsed {
        box-shadow: none;
    }

    .d365-page.sidebar-overlay-content .d365-sidebar:not(.collapsed),
    .d365-page.sidebar-overlay-content .d365-sidebar.pinned {
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.14);
    }

    /* CRUD stays fixed like the form — expanded nav overlays it (no resize) */
    .d365-page.sidebar-overlay-content .d365-main-content > .d365-command-bar {
        margin-left: calc(-1 * var(--d365-spacing-lg) + 1px);
        width: calc(100% + (2 * var(--d365-spacing-lg)) - 1px);
        box-sizing: border-box;
    }

    .d365-page.sidebar-overlay-content .d365-main-content {
        width: 100%;
        max-width: 100%;
        flex: 1 1 auto;
        min-width: 0;
        margin-left: 0;
        padding-left: calc(var(--d365-spacing-lg) + var(--d365-sidebar-collapsed-width));
        box-sizing: border-box;
        transition: padding-left var(--d365-sidebar-transition);
    }

    /* Locked open nav: the working window is only the strip beside the menu.
       The collapsed lock keeps the padding rule above and does not move. */
    .d365-page.sidebar-overlay-content:has(.d365-sidebar.pinned:not(.collapsed)) .d365-app-container {
        padding-left: var(--d365-sidebar-width);
        box-sizing: border-box;
    }

    .d365-page.sidebar-overlay-content:has(.d365-sidebar.pinned:not(.collapsed)) .d365-main-content {
        padding-left: var(--d365-spacing-lg);
        width: 100%;
        max-width: 100%;
        flex: 1 1 auto;
        min-width: 0;
        margin-left: 0;
        height: 100%;
    }

    /* Search keeps the pane open and reserves its width so the page title stays readable.
       Hover overlay is unchanged — only an active search shifts the working pane. */
    .d365-page.sidebar-overlay-content:has(.d365-sidebar.is-nav-searching:not(.collapsed)) {
        --d365-sidebar-width: 300px;
    }

    .d365-page.sidebar-overlay-content:has(.d365-sidebar.is-nav-searching:not(.collapsed)) .d365-app-container {
        padding-left: var(--d365-sidebar-width);
        box-sizing: border-box;
    }

    .d365-page.sidebar-overlay-content:has(.d365-sidebar.is-nav-searching:not(.collapsed)) .d365-main-content {
        padding-left: var(--d365-spacing-lg);
        width: 100%;
        max-width: 100%;
        flex: 1 1 auto;
        min-width: 0;
        margin-left: 0;
    }

    /* Hover-open pane covers the heading. Slide only the title clear of the menu.
       The form body stays put so field widths do not reflow. */
    .d365-page.sidebar-overlay-content:has(.d365-sidebar:not(.collapsed):not(.pinned):not(.is-nav-searching)) .d365-page-heading-wrap {
        margin-left: calc(var(--d365-sidebar-width) - var(--d365-sidebar-collapsed-width));
        transition: margin-left var(--d365-sidebar-transition);
    }

    /* Advanced search only — lift content above overlay sidebar while dialog is open */
    .d365-page.sidebar-overlay-content:has(.adv-search-modal.show) .d365-main-content {
        position: relative;
        z-index: 1200;
    }

    .d365-sidebar.collapsed:not(.pinned) {
        z-index: 1100;
    }
}

/* --- Scrollable nav content --- */
.d365-nav-content {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 12px;
    position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.d365-nav-collapsed-rail {
    display: none;
}

.d365-nav-menu-items {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

/* Hide sidebar scrollbar while keeping scroll */
.d365-nav-content::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* --- Section headers (uppercase gray like HRMS) --- */
.d365-nav-subheader {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.5px;
    padding: 16px 12px 6px 12px;
}

/* --- Nav items (rounded like HRMS) --- */
.d365-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    height: 38px;
    color: #6b7280;
    text-decoration: none;
    font-size: 13px;
    transition: all 200ms ease;
    cursor: pointer;
    border-radius: 8px;
    border: none;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}

.d365-nav-item:hover {
    background-color: #f9fafb;
    color: #111827;
    text-decoration: none;
}

.d365-nav-item.active {
    background-color: #faf5ff;
    color: #6d28d9;
    font-weight: 500;
    border-right: 2px solid #a855f7;
}

.d365-nav-dashboard-wrap {
    padding: 12px 12px 0 12px;
    background: #ffffff;
    flex-shrink: 0;
}

/* Active dot indicator (like HRMS) */
.d365-nav-item.active::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: #a855f7;
    border-radius: 50%;
}

/* The icon slot keeps its fixed 28px width so every label starts on the same x, but it draws no
   tile: no fill, no ring. Only the glyph itself carries colour, exactly like the Dashboard entry. */
.d365-sidebar:not(.collapsed) .d365-nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 0;
    background: transparent;
}

.d365-sidebar:not(.collapsed) .d365-nav-item:hover .d365-nav-icon,
.d365-sidebar:not(.collapsed) .d365-nav-group-header:hover .d365-nav-icon {
    background: transparent;
}

.d365-sidebar:not(.collapsed) .d365-nav-item.active .d365-nav-icon {
    background: transparent;
}

.d365-nav-icon {
    width: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.d365-nav-icon i {
    font-size: 15px;
    color: #9ca3af;
}

.d365-nav-item:hover .d365-nav-icon i {
    color: #6b7280;
}

.d365-nav-item.active .d365-nav-icon i {
    color: #9333ea;
}

.d365-nav-text {
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    white-space: nowrap;
    opacity: 1;
    max-width: 180px;
    transition: opacity 220ms ease, max-width var(--d365-sidebar-transition);
}

.d365-sidebar.collapsed .d365-nav-text {
    opacity: 0;
    max-width: 0;
}

.d365-nav-section-header {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.5px;
    padding: 16px 12px 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    line-height: 1.4;
    white-space: nowrap;
}

.d365-nav-section-header[data-nav-tone]::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #9ca3af;
}

.d365-nav-section-header[data-nav-tone="terminal"]::before { background: #2563eb; }
.d365-nav-section-header[data-nav-tone="cfs"]::before { background: #4f46e5; }
.d365-nav-section-header[data-nav-tone="mnr"]::before { background: #d97706; }
.d365-nav-section-header[data-nav-tone="store"]::before { background: #0d9488; }
.d365-nav-section-header[data-nav-tone="accounts"]::before { background: #16a34a; }
.d365-nav-section-header[data-nav-tone="admin"]::before { background: #475569; }

/* --- Module caption glyph ---------------------------------------------------
   Each module caption carries its own icon (containers, rail, repairs,
   inventory, finance) instead of the old tone dot. The glyph is bare — no tile,
   no pill — and its box is centred on the same gutter axis as the trail line and
   the bullets, so the tree geometry below it is unchanged. */
button.d365-nav-section-header.d365-nav-module-toggle::before {
    content: none;
}

.d365-nav-module-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    /* Centres the glyph on the old dot axis (x = 15.5px) without moving the
       caption label: -3px on each side keeps the gap to the title at 8px. */
    margin: 0 -3px;
    background: none;
    border-radius: 0;
    color: inherit;
}

/* The caption's trail now starts under the glyph instead of under a 7px dot. */
button.d365-nav-section-header.d365-nav-module-toggle.expanded::after {
    top: 28px;
}

.d365-nav-module-icon i {
    font-size: 13px;
    line-height: 1;
    color: inherit;
}

/* Administration Tool header: icon only, no translucent tile behind it.
   A dedicated class (instead of .d365-nav-icon) keeps it free of the tile that
   every nav row icon gets in the expanded sidebar, in both light and dark ink. */
.d365-nav-icon-bare {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Same 28px box the tiled nav icons occupy, so the label beside it does not
       shift left now that there is no background — only the tile is gone. */
    width: 28px;
    flex-shrink: 0;
    background: none;
    border-radius: 0;
    color: inherit;
}

.d365-nav-icon-bare i {
    font-size: 16px;
    line-height: 1;
    color: inherit;
}

/* Administration Tool closes the caption list, so it reads as one of them: same
   glyph axis and size, same label start, same caption typography. Scoped to the
   expanded sidebar — the collapsed rail keeps its own 40px icon button. */
.d365-sidebar:not(.collapsed) .d365-nav-group[data-nav-tone="admin"] > .d365-nav-group-header {
    /* 12px gutter, 13px glyph overhanging 3px on each side and an 8px gap put
       the label on x = 27px — the exact left edge every module caption uses.
       line-height / margin match the captions too, so both rows are 36px tall
       and sit on the same rhythm. */
    gap: 8px;
    height: auto;
    margin: 2px 0 0 0;
    padding: 14px 12px 8px 12px;
    line-height: 1.4;
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.d365-sidebar:not(.collapsed) .d365-nav-group[data-nav-tone="admin"] > .d365-nav-group-header .d365-nav-icon-bare {
    width: 13px;
    margin: 0 -3px;
}

.d365-sidebar:not(.collapsed) .d365-nav-group[data-nav-tone="admin"] > .d365-nav-group-header .d365-nav-icon-bare i {
    font-size: 13px;
}

/* --- Module trail -----------------------------------------------------------
   Every heading and every form inside a module hangs off one hairline: a filled
   bullet on the gutter (module caption, sub-heading, form) with the line running
   down from it, the way a printed address block reads. The line and the bullets
   take the module's own tone, so they follow the sidebar theme (and the on-dark
   ink) instead of introducing a new colour. */
.d365-nav-section-header[data-nav-tone],
.d365-nav-group[data-nav-tone] {
    position: relative;
    --nav-trail-color: rgba(156, 163, 175, 0.45);
    --nav-bullet-color: #9ca3af;
}

/* The bullet sits on top of the trail. */
.d365-nav-section-header[data-nav-tone]::before {
    position: relative;
    z-index: 1;
}

/* Caption -> its links: the line resumes just under the dot. A module that is
   closed keeps only its dot, so no ink is left hanging between captions. */
.d365-nav-section-header[data-nav-tone].expanded::after,
.d365-nav-section-header[data-nav-tone]:not(.d365-nav-module-toggle)::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 21px;
    /* Overhangs by the group stack margin so the caption's line and the module's
       branch meet without a visible break. */
    bottom: -2px;
    width: 1px;
    border-radius: 1px;
    background: var(--nav-trail-color);
    pointer-events: none;
}

/* The module's links hang off one line down the gutter, with every form and
   sub-heading carrying its own bullet on that line. The rows stay to the right
   of the line so it never disappears behind the hover/active pill. */
.d365-nav-group[data-nav-tone]::before {
    content: '';
    position: absolute;
    left: 15px;
    top: -2px;
    /* Ends just past the last bullet instead of running on under the next
       caption, so each module's branch closes with its own list. */
    bottom: 2px;
    width: 1px;
    border-radius: 1px;
    background: var(--nav-trail-color);
    pointer-events: none;
}

/* Consecutive groups of the same module read as one branch. Administration sits
   outside a module, so nothing carries the branch into it. */
.d365-nav-group[data-nav-tone]:has(+ .d365-nav-group[data-nav-tone]:not([data-nav-tone="admin"]))::before {
    bottom: -8px;
}

/* Administration has no module caption above it, so a gutter line beside its
   header would hang from nothing. Its branch starts under the header instead:
   no line while the group is closed, the usual line and bullets once it opens. */
.d365-nav-group[data-nav-tone="admin"]::before {
    content: none;
}

.d365-nav-group[data-nav-tone="admin"] > .d365-nav-group-items {
    position: relative;
}

.d365-nav-group[data-nav-tone="admin"] > .d365-nav-group-items::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 2px;
    width: 1px;
    border-radius: 1px;
    background: var(--nav-trail-color);
    pointer-events: none;
}

.d365-nav-group[data-nav-tone] .d365-nav-group-items .d365-nav-item {
    margin-left: 22px;
    padding-left: 12px;
    /* Lets the bullet sit on the branch line, outside the hover pill. Labels
       still truncate through .d365-nav-text. */
    overflow: visible;
}

.d365-nav-group[data-nav-tone] .d365-nav-group-items .d365-nav-subheader {
    position: relative;
    padding: 16px 12px 6px 26px;
}

/* Bullet on every heading/form in the module, on the same x as the caption dot. */
.d365-nav-group[data-nav-tone] .d365-nav-group-items .d365-nav-item::before,
.d365-nav-group[data-nav-tone] .d365-nav-group-items .d365-nav-subheader::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--nav-bullet-color);
    pointer-events: none;
}

.d365-nav-group[data-nav-tone] .d365-nav-group-items .d365-nav-item::before {
    left: -9.5px;
}

.d365-nav-group[data-nav-tone] .d365-nav-group-items .d365-nav-subheader::before {
    left: 12px;
}

/* The collapsed rail is an icon strip: there is no room for a tree. */
.d365-sidebar.collapsed .d365-nav-section-header[data-nav-tone]::after,
.d365-sidebar.collapsed .d365-nav-group[data-nav-tone]::before,
.d365-sidebar.collapsed .d365-nav-group[data-nav-tone] .d365-nav-group-items .d365-nav-item::before,
.d365-sidebar.collapsed .d365-nav-group[data-nav-tone] .d365-nav-group-items .d365-nav-subheader::before {
    display: none;
}

.d365-sidebar.collapsed .d365-nav-group[data-nav-tone] .d365-nav-group-items .d365-nav-item,
.d365-sidebar.collapsed .d365-nav-group[data-nav-tone] .d365-nav-group-items .d365-nav-subheader {
    margin-left: 0;
    padding-left: 0;
}

:is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone="terminal"] { --nav-trail-color: rgba(37, 99, 235, 0.38); --nav-bullet-color: #2563eb; }
:is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone="cfs"] { --nav-trail-color: rgba(79, 70, 229, 0.38); --nav-bullet-color: #4f46e5; }
:is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone="mnr"] { --nav-trail-color: rgba(217, 119, 6, 0.4); --nav-bullet-color: #d97706; }
:is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone="store"] { --nav-trail-color: rgba(13, 148, 136, 0.38); --nav-bullet-color: #0d9488; }
:is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone="accounts"] { --nav-trail-color: rgba(22, 163, 74, 0.38); --nav-bullet-color: #16a34a; }
:is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone="admin"] { --nav-trail-color: rgba(71, 85, 105, 0.38); --nav-bullet-color: #475569; }


/* On the dark sidebar the same tones lighten so the trail stays a hint, not a stripe. */
html[data-nav-ink="on-dark"] :is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone],
.d365-sidebar[data-nav-ink="on-dark"] :is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone] {
    --nav-trail-color: rgba(255, 255, 255, 0.22);
    --nav-bullet-color: rgba(255, 255, 255, 0.55);
}

html[data-nav-ink="on-dark"] :is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone="terminal"],
.d365-sidebar[data-nav-ink="on-dark"] :is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone="terminal"] {
    --nav-trail-color: rgba(96, 165, 250, 0.55);
    --nav-bullet-color: #60a5fa;
}

html[data-nav-ink="on-dark"] :is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone="cfs"],
.d365-sidebar[data-nav-ink="on-dark"] :is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone="cfs"] {
    --nav-trail-color: rgba(129, 140, 248, 0.55);
    --nav-bullet-color: #818cf8;
}

html[data-nav-ink="on-dark"] :is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone="mnr"],
.d365-sidebar[data-nav-ink="on-dark"] :is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone="mnr"] {
    --nav-trail-color: rgba(251, 191, 36, 0.5);
    --nav-bullet-color: #fbbf24;
}

html[data-nav-ink="on-dark"] :is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone="store"],
.d365-sidebar[data-nav-ink="on-dark"] :is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone="store"] {
    --nav-trail-color: rgba(45, 212, 191, 0.5);
    --nav-bullet-color: #2dd4bf;
}

html[data-nav-ink="on-dark"] :is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone="accounts"],
.d365-sidebar[data-nav-ink="on-dark"] :is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone="accounts"] {
    --nav-trail-color: rgba(74, 222, 128, 0.5);
    --nav-bullet-color: #4ade80;
}

html[data-nav-ink="on-dark"] :is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone="admin"],
.d365-sidebar[data-nav-ink="on-dark"] :is(.d365-nav-section-header, .d365-nav-group)[data-nav-tone="admin"] {
    --nav-trail-color: rgba(203, 213, 225, 0.35);
    --nav-bullet-color: rgba(226, 232, 240, 0.6);
}

/* The module caption IS its accordion. There is only ever one "Transactions / Setup / Reports"
   label on screen — the global segment strip — so the caption owns the chevron and the open state. */
button.d365-nav-section-header.d365-nav-module-toggle {
    width: 100%;
    margin: 2px 0 0 0;
    padding: 14px 12px 8px 12px;
    background: transparent;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: left;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease;
}

button.d365-nav-section-header.d365-nav-module-toggle:hover {
    background: #f9fafb;
    color: #4b5563;
}

button.d365-nav-section-header.d365-nav-module-toggle.expanded {
    color: #374151;
}

.d365-nav-module-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Frozen segment strip (Setup / Transactions / Reports) -----------------
   The strip is a sibling of the scrolling list, so it stays pinned under the
   search box while a long module scrolls. ONE strip for the whole menu: it
   filters every module at once, so it is never repeated inside a module. */
.d365-nav-segment-rail {
    flex-shrink: 0;
    padding: 8px 12px 6px 12px;
    /* Transparent so the pane's own surface (gradient / colour) shows through; the selected
       segment is the only thing that draws ink. */
    background: transparent;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
    z-index: 2;
}

.d365-sidebar.collapsed .d365-nav-segment-rail {
    display: none;
}

.d365-nav-segments {
    display: flex;
    align-items: stretch;
    gap: 6px;
    /* The rail already carries the sidebar gutter, so the strip lines up with the module
       captions below it. The strip itself is chromeless: no pill bar, no border, no inset
       shadow — the selected segment owns the only visible surface. */
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    flex-shrink: 0;
}

.d365-nav-segment {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Three equal segments in a 232px pane: the icon sits above a 9.5px label, so "Transactions"
       stays whole on one line on every theme instead of truncating. */
    gap: 2px;
    padding: 4px 2px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #6b7280;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

/* Circular glyph chip: transparent at rest and on hover, a thin ring while hovered and a
   slightly tighter ring when the segment is selected. Nothing is filled in, so the pane colour
   behind the strip always shows through. */
.d365-nav-segment .bi {
    font-size: 11px;
    line-height: 1;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    /* The glyph is 11px inside a 26px ring, so ~7px of empty chip sits under it. Pull the chip's
       slack up instead of shrinking it, which would deform the circular ring. */
    margin-bottom: -2px;
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.d365-nav-segment-text {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.d365-nav-segment:hover {
    background: transparent;
    color: #374151;
}

.d365-nav-segment:hover .bi {
    background: transparent;
    color: #6d28d9;
    box-shadow: inset 0 0 0 1px rgba(109, 40, 217, 0.35);
}

.d365-nav-segment:focus-visible {
    outline: 2px solid #6d28d9;
    outline-offset: 1px;
}

.d365-nav-segment.active {
    background: transparent;
    color: #6d28d9;
    box-shadow: none;
}

.d365-nav-segment.active .bi {
    background: transparent;
    color: #6d28d9;
    box-shadow: inset 0 0 0 1.5px #6d28d9;
}

.d365-nav-segment.active:hover {
    background: transparent;
    color: #6d28d9;
}

.d365-nav-segment.active:hover .bi {
    background: transparent;
    color: #6d28d9;
    box-shadow: inset 0 0 0 1.5px #6d28d9;
}

/* Collapsed rail has no room for a segmented control. */
.d365-sidebar.collapsed .d365-nav-segments {
    display: none;
}

/* Kept for a segment that ever hides its own accordion header. The global strip names no single
   group, so every module keeps a real header to expand. */
.d365-nav-group-tabbed > .d365-nav-group-header {
    display: none;
}

/* Never in the collapsed rail: there the header is the icon button that opens the module. */
.d365-sidebar.collapsed .d365-nav-group-tabbed > .d365-nav-group-header {
    display: flex;
}

.d365-nav-group-tabbed > .d365-nav-group-items {
    margin-top: 2px;
}

.d365-nav-chevron {
    font-size: 10px;
    color: #d1d5db;
    margin-left: auto;
    flex-shrink: 0;
    opacity: 1;
    max-width: 16px;
    transition: opacity 200ms ease, max-width var(--d365-sidebar-transition);
}

.d365-sidebar.collapsed .d365-nav-chevron {
    opacity: 0;
    max-width: 0;
}

/* --- Group headers --- */
.d365-nav-group {
    margin-bottom: 8px;
}

.d365-nav-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0 12px;
    height: 38px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 4px;
    background: none;
    border: none;
    text-align: left;
}

.d365-nav-group-header:hover {
    background-color: #f9fafb;
}

.d365-nav-group-header .d365-nav-icon i {
    color: #9ca3af;
}

.d365-nav-group-items .d365-nav-item {
    padding-left: 16px;
    font-size: 12px;
}

.d365-nav-group-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.d365-nav-divider {
    height: 1px;
    background-color: #f3f4f6;
    margin: 8px 12px;
}

/* --- Sidebar footer --- */
/* The footer is the last child of the flex column, so `margin-top: auto` parks it on the very
   bottom of the pane no matter how few groups the current segment happens to show. */
.d365-nav-footer {
    border-top: 1px solid #f3f4f6;
    padding: 12px;
    flex-shrink: 0;
    margin-top: auto;
}

.d365-nav-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.d365-nav-footer-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.d365-nav-colors {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.d365-nav-swatch {
    position: relative;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #040C5A;
    flex-shrink: 0;
}

.d365-nav-swatch.is-on {
    outline: 2px solid #6d28d9;
    outline-offset: 1px;
}

.d365-nav-swatch.is-on::after {
    content: "";
    width: 5px;
    height: 3px;
    border-left: 1.5px solid #6d28d9;
    border-bottom: 1.5px solid #6d28d9;
    transform: rotate(-45deg) translateY(-1px);
    pointer-events: none;
}

.d365-nav-colors .d365-nav-swatch:first-child.is-on::after,
.d365-nav-swatch.is-on:not([style*="ffffff"]):not([style*="FFFFFF"])::after {
    border-color: #ffffff;
}

.d365-nav-swatch input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.d365-nav-swatch.is-on::after {
    z-index: 1;
}

.d365-nav-swatch input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.d365-nav-swatch input[type="color"]::-webkit-color-swatch {
    border: 0;
    border-radius: 50%;
}

.d365-nav-footer-row .d365-nav-footer-name {
    max-width: 92px;
}

.d365-nav-footer-actions {
    margin-top: 10px;
}

.d365-nav-footer-logout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.d365-nav-footer-logout:hover {
    background: #f9fafb;
    color: #111827;
}

.d365-nav-footer-logout .d365-nav-icon i {
    color: #9ca3af;
}

.d365-nav-footer-avatar {
    width: 32px;
    height: 32px;
    background: #60a5fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(96, 165, 250, 0.25);
    overflow: hidden;
}

.d365-nav-footer-avatar .d365-header-user-avatar {
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1;
    white-space: nowrap;
}

.d365-nav-footer-name {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 1;
    max-width: 160px;
    transition: opacity 220ms ease, max-width var(--d365-sidebar-transition);
}

.d365-sidebar.collapsed .d365-nav-footer-name {
    opacity: 0;
    max-width: 0;
}

/* --- Collapsed state --- */
.d365-sidebar.collapsed .d365-nav-brand {
    justify-content: center;
    padding: 10px 0;
    min-height: 52px;
}

.d365-sidebar.collapsed .d365-nav-brand-left {
    justify-content: center;
}

.d365-sidebar.collapsed .d365-nav-brand-logo {
    width: 28px;
    height: 28px;
}

.d365-sidebar.collapsed .d365-nav-brand-logo i {
    font-size: 14px;
}

.d365-sidebar.collapsed .d365-nav-content {
    padding: 10px 0;
    justify-content: center;
}

.d365-sidebar.collapsed .d365-nav-collapsed-rail {
    display: none;
}

.d365-sidebar.collapsed .d365-nav-menu-items {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    width: 100%;
}

.d365-sidebar.collapsed .d365-nav-item {
    width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
    margin: 0 auto;
    border-right: none;
    position: relative;
}

.d365-sidebar.collapsed .d365-nav-item.active::after {
    display: none;
}

.d365-sidebar.collapsed .d365-nav-item.active,
.d365-sidebar.collapsed .d365-nav-group-header.active {
    background-color: #ffffff;
    color: #0d6efd;
    box-shadow: none;
}

.d365-sidebar.collapsed .d365-nav-item.active .d365-nav-icon i,
.d365-sidebar.collapsed .d365-nav-group-header.active .d365-nav-icon i {
    color: #0d6efd;
}

.d365-sidebar.collapsed .d365-nav-item.active::before,
.d365-sidebar.collapsed .d365-nav-group-header.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #0d6efd;
    border-radius: 0 1px 1px 0;
    opacity: 1;
    transform: none;
    border: none;
    pointer-events: none;
    z-index: 1;
}

.d365-sidebar.collapsed .d365-nav-item:hover {
    background-color: #f9fafb;
}

.d365-sidebar.collapsed .d365-nav-group-header {
    width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
    margin: 0 auto;
    position: relative;
}

.d365-sidebar.collapsed .d365-nav-group-header:hover {
    background-color: #f9fafb;
}

/* Active module group header (collapsed + expanded) */
.d365-nav-group-header.active {
    background-color: #faf5ff;
    color: #6d28d9;
    font-weight: 600;
}

.d365-nav-group-header.active .d365-nav-icon i {
    color: #9333ea;
}

.d365-sidebar.collapsed .d365-nav-group-header.active {
    background-color: #ffffff;
    color: #0d6efd;
    box-shadow: none;
}

.d365-sidebar.collapsed .d365-nav-group-header.active .d365-nav-icon i {
    color: #0d6efd;
}

.store-module-page .d365-sidebar.collapsed .d365-nav-group-header.active,
.store-module-page .d365-nav-group-header.active {
    background-color: #f5f3ff;
    color: #5b21b6;
    box-shadow: none;
}

.store-module-page .d365-nav-group-header.active .d365-nav-icon i,
.store-module-page .d365-sidebar.collapsed .d365-nav-group-header.active .d365-nav-icon i {
    color: #7c3aed;
}

/* === Page heading card (HRM-style, below top nav in main content) === */
.d365-page-heading-wrap {
    padding: 0;
}

.d365-page-heading-card {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.d365-page-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.d365-page-heading-titles {
    min-width: 0;
    flex: 0 1 auto;
    width: fit-content;
    max-width: 100%;
    padding: 5px 0 10px 0;
    display: flex;
    flex-direction: column;
}

.d365-page-heading-breadcrumb-block {
    margin: 0 0 13px -14px;
    /* PPCT logo navy (#040C5A) — rounded right like the profile badge */
    background: linear-gradient(90deg, #040C5A 0%, #0a1a6e 48%, #002B7F 100%);
    border-radius: 0 999px 999px 0;
    padding: 1px 1.5rem 1px 16px;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(4, 12, 90, 0.28);
    align-self: flex-start;
}

.d365-page-heading-breadcrumb-block .d365-header-breadcrumb {
    min-height: 20px;
}

.d365-page-heading-title {
    margin: 0;
    font-family: var(--d365-form-heading-font);
    font-size: var(--d365-form-heading-size);
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #040C5A;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.d365-page-heading-title-icon {
    font-size: 1.05em;
    line-height: 1;
    color: #040C5A;
    flex-shrink: 0;
}

.d365-page-heading-card.is-dashboard h1.d365-page-heading-title,
.d365-page-heading-card.is-dashboard .d365-page-heading-title {
    font-size: var(--d365-dashboard-heading-size);
    font-weight: 400;
}

@media (min-width: 1200px) {
    h1.d365-page-heading-title,
    .d365-page-heading-title {
        font-size: var(--d365-form-heading-size);
    }

    .d365-page-heading-card.is-dashboard h1.d365-page-heading-title,
    .d365-page-heading-card.is-dashboard .d365-page-heading-title {
        font-size: var(--d365-dashboard-heading-size);
    }
}

.d365-page-heading-subtitle {
    margin: 0.35rem 0 0 0;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #605e5c;
}

.d365-page-heading-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.d365-page-heading-page-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex: 1 1 auto;
    min-width: 0;
    margin-left: auto;
    margin-right: 1rem;
    align-self: center;
}

.d365-page-heading-tools-inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.d365-record-nav-header {
    padding: 0.15rem 0.35rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
}

.d365-page-heading-page-tools .d365-badge {
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
}

.d365-page-heading-action-group {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 7rem;
}

.d365-page-heading-action-label {
    margin: 0 0 0.15rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #4b5563;
}

.d365-page-heading-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: none;
    background: transparent;
    color: #2563eb;
    font-size: 0.875rem;
    padding: 0;
    cursor: pointer;
    position: relative;
}

.d365-page-heading-action-btn:hover {
    text-decoration: underline;
}

.d365-page-heading-action-btn .bi-chevron-down {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.d365-page-heading-action-btn .bi-chevron-down.rotated {
    transform: rotate(180deg);
}

.d365-page-heading-badge {
    position: absolute;
    top: -0.55rem;
    right: -0.35rem;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.25rem;
    text-align: center;
}

.d365-page-heading-action-divider {
    width: 1px;
    align-self: stretch;
    min-height: 3rem;
    background: #d1d5db;
}

.d365-page-heading-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 20rem;
    max-height: 24rem;
    overflow: auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    z-index: 1100;
}

.d365-page-heading-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.875rem;
    border-bottom: 1px solid #f3f4f6;
}

.d365-page-heading-dropdown-close {
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.15rem;
}

.d365-page-heading-dropdown-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    width: 100%;
    text-align: left;
    padding: 0.75rem 0.875rem;
    border: none;
    border-bottom: 1px solid #f9fafb;
    background: #ffffff;
    cursor: pointer;
}

.d365-page-heading-dropdown-item.unread {
    background: #eff6ff;
}

.d365-page-heading-dropdown-item strong {
    font-size: 0.875rem;
    color: #111827;
}

.d365-page-heading-dropdown-item span {
    font-size: 0.75rem;
    color: #4b5563;
    line-height: 1.35;
}

.d365-page-heading-dropdown-item small {
    font-size: 0.6875rem;
    color: #9ca3af;
}

.d365-page-heading-card.is-store .d365-page-heading-title,
.d365-page-heading-card.is-store .d365-page-heading-title-icon {
    color: #000000;
}

@media (max-width: 768px) {
    .d365-page-heading-row {
        flex-direction: column;
        align-items: stretch;
    }

    .d365-page-heading-page-tools {
        margin-left: 0;
        margin-right: 0;
        justify-content: flex-start;
    }

    .d365-page-heading-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .d365-page-heading-action-group {
        min-width: 6.5rem;
    }

    .d365-page-heading-dropdown {
        width: min(20rem, 88vw);
    }
}

/* === Legacy header breadcrumb bar (unused) === */
.d365-header-breadcrumb-bar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 16px 0;
    position: sticky;
    top: var(--d365-header-height);
    z-index: 999;
}

.d365-header-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 28px;
    font-size: 12px;
    line-height: 1.3;
}

.d365-header-breadcrumb-root,
.d365-header-breadcrumb-home-link {
    display: inline-flex;
    align-items: center;
    color: #111827;
    margin-right: 2px;
    text-decoration: none;
}

.d365-page-heading-card .d365-header-breadcrumb-root,
.d365-page-heading-card .d365-header-breadcrumb-home-link {
    color: #ffffff;
}

.d365-header-breadcrumb-root i,
.d365-header-breadcrumb-home-link i {
    font-size: 13px;
}

.d365-header-breadcrumb-home-link:hover,
.d365-header-breadcrumb-home-link:focus-visible,
.d365-header-breadcrumb-home-link.active {
    color: #000000;
    text-decoration: none;
}

.d365-page-heading-card .d365-header-breadcrumb-home-link:hover,
.d365-page-heading-card .d365-header-breadcrumb-home-link:focus-visible,
.d365-page-heading-card .d365-header-breadcrumb-home-link.active {
    color: #ffffff;
}

.d365-header-breadcrumb-sep {
    font-size: 11px;
    color: #64748b;
    margin: 0 4px;
    font-weight: 700;
    opacity: 1;
}

.d365-page-heading-card .d365-header-breadcrumb-sep {
    color: #ffffff;
}

.d365-header-breadcrumb-link,
.d365-header-breadcrumb-text,
.d365-header-breadcrumb-current {
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-size: 11px;
    color: #9ca3af;
}

.d365-page-heading-card .d365-header-breadcrumb-link,
.d365-page-heading-card .d365-header-breadcrumb-text,
.d365-page-heading-card .d365-header-breadcrumb-current {
    color: #ffffff;
}

.d365-header-breadcrumb-link {
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
}

.d365-header-breadcrumb-link:hover {
    color: #004578;
    text-decoration: underline;
}

.d365-page-heading-card .d365-header-breadcrumb-link:hover {
    color: #fdb913;
}

.d365-header-breadcrumb-text {
    cursor: default;
}

.d365-header-breadcrumb-accent {
    height: 3px;
    margin: 6px 0 0;
    border-radius: 2px;
    background: linear-gradient(90deg, #0078d4 0%, #1e4d78 55%, transparent 100%);
    max-width: 420px;
}

.d365-header-breadcrumb-bar.is-store .d365-header-breadcrumb-link,
.d365-page-heading-card.is-store .d365-header-breadcrumb-link {
    color: #0078d4;
}

.d365-page-heading-card.is-store .d365-header-breadcrumb-link {
    color: #ffffff;
}

.d365-header-breadcrumb-bar.is-store .d365-header-breadcrumb-link:hover,
.d365-page-heading-card.is-store .d365-header-breadcrumb-link:hover {
    color: #004578;
}

.d365-page-heading-card.is-store .d365-header-breadcrumb-link:hover {
    color: #fdb913;
}

.d365-header-breadcrumb-bar.is-store .d365-header-breadcrumb-text,
.d365-page-heading-card.is-store .d365-header-breadcrumb-text,
.d365-header-breadcrumb-bar.is-store .d365-header-breadcrumb-current,
.d365-page-heading-card.is-store .d365-header-breadcrumb-current {
    color: #9ca3af;
}

.d365-page-heading-card.is-store .d365-header-breadcrumb-text,
.d365-page-heading-card.is-store .d365-header-breadcrumb-current {
    color: #ffffff;
}

.d365-header-breadcrumb-bar.is-store .d365-header-breadcrumb-accent,
.d365-page-heading-card.is-store .d365-header-breadcrumb-accent {
    background: linear-gradient(90deg, #7c3aed 0%, #4f46e5 55%, transparent 100%);
}

.d365-page-heading-card .d365-header-breadcrumb-accent {
    background: linear-gradient(90deg, #fdb913 0%, rgba(253, 185, 19, 0.35) 55%, transparent 100%);
}

.d365-header-breadcrumb-bar.is-accounts .d365-header-breadcrumb-accent,
.d365-page-heading-card.is-accounts .d365-header-breadcrumb-accent {
    background: linear-gradient(90deg, #0078d4 0%, #1e4d78 55%, transparent 100%);
}

.d365-page-heading-card.is-accounts .d365-header-breadcrumb-accent,
.d365-page-heading-card.is-terminal .d365-header-breadcrumb-accent,
.d365-page-heading-card.is-mnr .d365-header-breadcrumb-accent,
.d365-page-heading-card.is-store .d365-header-breadcrumb-accent {
    background: linear-gradient(90deg, #fdb913 0%, rgba(253, 185, 19, 0.35) 55%, transparent 100%);
}

.d365-header-breadcrumb-bar.is-terminal .d365-header-breadcrumb-accent,
.d365-page-heading-card.is-terminal .d365-header-breadcrumb-accent {
    background: linear-gradient(90deg, #2266e3 0%, #1b52b3 55%, transparent 100%);
}

.d365-header-breadcrumb-bar.is-mnr .d365-header-breadcrumb-accent,
.d365-page-heading-card.is-mnr .d365-header-breadcrumb-accent {
    background: linear-gradient(90deg, #ca5010 0%, #8a3a0a 55%, transparent 100%);
}

.d365-sidebar.collapsed .d365-nav-group {
    width: 100%;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.d365-sidebar.collapsed .d365-nav-icon {
    width: 20px;
}

.d365-sidebar.collapsed .d365-nav-icon i {
    font-size: 18px;
}

.d365-sidebar.collapsed .d365-nav-footer {
    padding: 10px 0 12px;
}

.d365-sidebar.collapsed .d365-nav-footer-row {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.d365-sidebar.collapsed .d365-nav-footer-user {
    justify-content: center;
    flex: 0 0 auto;
}

.d365-sidebar.collapsed .d365-nav-footer-avatar {
    width: 32px;
    height: 32px;
}

.d365-sidebar.collapsed .d365-nav-colors {
    flex-direction: column;
    align-items: center;
    gap: 7px;
}

.d365-sidebar.collapsed .d365-nav-swatch {
    width: 15px;
    height: 15px;
}

.d365-sidebar.collapsed .d365-nav-subheader {
    display: none;
}

.d365-sidebar.collapsed .d365-nav-divider {
    margin: 6px 8px;
}

.d365-sidebar.collapsed .d365-nav-group-items .d365-nav-item {
    padding-left: 0;
}

/* Collapsed sidebar — no hover flyout tooltips (keep active left bar) */
.d365-sidebar.collapsed .d365-nav-item[title]:not(.active)::after,
.d365-sidebar.collapsed .d365-nav-group-header[title]:not(.active)::after,
.d365-sidebar.collapsed .d365-nav-item[title]:not(.active)::before,
.d365-sidebar.collapsed .d365-nav-group-header[title]:not(.active)::before {
    display: none !important;
    content: none !important;
}

.d365-sidebar.collapsed .d365-nav-item[title]:not(.active):hover::after,
.d365-sidebar.collapsed .d365-nav-item[title]:not(.active):hover::before,
.d365-sidebar.collapsed .d365-nav-group-header[title]:not(.active):hover::after,
.d365-sidebar.collapsed .d365-nav-group-header[title]:not(.active):hover::before {
    display: none !important;
    opacity: 0 !important;
}

.d365-sidebar.is-nav-searching:not(.collapsed) .d365-nav-section-header {
    white-space: normal;
}

.d365-sidebar.is-nav-searching:not(.collapsed) .d365-nav-item {
    height: auto;
    min-height: 38px;
    white-space: normal;
    padding-top: 6px;
    padding-bottom: 6px;
}

.d365-sidebar.is-nav-searching:not(.collapsed) .d365-nav-text {
    white-space: normal;
    max-width: none;
    overflow: visible;
    text-overflow: unset;
}

.d365-sidebar.is-nav-searching:not(.collapsed) .d365-nav-item.active {
    background: #f3e8ff;
    box-shadow: inset 3px 0 0 #7c3aed;
}

.d365-sidebar.is-nav-searching:not(.collapsed) .d365-nav-item.active::after {
    display: none;
}

html[data-nav-panel="white"] .d365-sidebar,
.d365-sidebar[data-nav-panel="white"] {
    background-color: #ffffff !important;
    border-right-color: #d1d5db;
}

html[data-nav-panel="navy"] .d365-sidebar,
.d365-sidebar[data-nav-panel="navy"] {
    background-color: #040C5A !important;
    border-right-color: rgba(255, 255, 255, 0.18);
}

html[data-nav-panel="custom"] .d365-sidebar,
.d365-sidebar[data-nav-panel="custom"] {
    background-color: var(--nav-bg, var(--nav-panel-custom, #ffffff)) !important;
    border-right-color: rgba(0, 0, 0, 0.12);
}

html[data-nav-panel="custom"][data-nav-ink="on-dark"] .d365-sidebar {
    border-right-color: rgba(255, 255, 255, 0.18);
}

html[data-nav-ink="on-dark"] .d365-sidebar-shell::after,
html[data-nav-ink="on-dark"] .d365-nav-divider {
    background: rgba(255, 255, 255, 0.16);
}

html[data-nav-ink="on-dark"] .d365-nav-top-rail,
html[data-nav-ink="on-dark"] .d365-nav-footer {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.14);
}

/* Frosted glass search: translucent white over the pane's own surface, a 1px light rim and an
   inset top highlight so it reads as a pane of glass rather than a flat grey box. The blur only
   shows through where the pane paints something behind it (gradient / colour), which is exactly
   how a real backdrop blur behaves. */
html[data-nav-ink="on-dark"] .d365-nav-search,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-search {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 4px 14px rgba(0, 0, 0, 0.18);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    backdrop-filter: blur(12px) saturate(150%);
}

html[data-nav-ink="on-dark"] .d365-nav-search:focus-within,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-search:focus-within {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.42);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 6px 18px rgba(0, 0, 0, 0.22);
}

html[data-nav-ink="on-dark"] .d365-nav-search-icon,
html[data-nav-ink="on-dark"] .d365-nav-search-input,
html[data-nav-ink="on-dark"] .d365-nav-search-clear,
html[data-nav-ink="on-dark"] .d365-nav-top-home,
html[data-nav-ink="on-dark"] .d365-nav-section-header,
html[data-nav-ink="on-dark"] .d365-nav-search-hint,
html[data-nav-ink="on-dark"] .d365-nav-group-header,
html[data-nav-ink="on-dark"] .d365-nav-chevron,
html[data-nav-ink="on-dark"] .d365-nav-footer-name {
    color: rgba(255, 255, 255, 0.88);
}

html[data-nav-ink="on-dark"] .d365-nav-search-input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

html[data-nav-ink="on-dark"] .d365-nav-search-clear:hover,
html[data-nav-ink="on-dark"] .d365-nav-top-home:hover,
html[data-nav-ink="on-dark"] .d365-nav-item:hover,
html[data-nav-ink="on-dark"] .d365-nav-group-header:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

html[data-nav-ink="on-dark"] .d365-nav-item {
    color: rgba(255, 255, 255, 0.86);
}

html[data-nav-ink="on-dark"] .d365-nav-item.active {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border-right-color: #ffffff;
}

html[data-nav-ink="on-dark"] .d365-nav-item.active::after {
    background: #ffffff;
}

html[data-nav-ink="on-dark"] .d365-sidebar.is-nav-searching:not(.collapsed) .d365-nav-item.active {
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 3px 0 0 #ffffff;
}

html[data-nav-ink="on-dark"] .d365-nav-icon i,
html[data-nav-ink="on-dark"] .d365-nav-item:hover .d365-nav-icon i,
html[data-nav-ink="on-dark"] .d365-nav-item.active .d365-nav-icon i,
html[data-nav-ink="on-dark"] .d365-nav-group-header .d365-nav-icon i {
    color: inherit;
}

html[data-nav-ink="on-dark"] .d365-sidebar:not(.collapsed) .d365-nav-icon {
    background: transparent;
}

html[data-nav-ink="on-dark"] .d365-sidebar:not(.collapsed) .d365-nav-item:hover .d365-nav-icon,
html[data-nav-ink="on-dark"] .d365-sidebar:not(.collapsed) .d365-nav-group-header:hover .d365-nav-icon,
html[data-nav-ink="on-dark"] .d365-sidebar:not(.collapsed) .d365-nav-item.active .d365-nav-icon {
    background: transparent;
}

.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-top-rail,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-dashboard-wrap,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-footer {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.14);
}

.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-section-header,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-group-header,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-item,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-chevron,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-footer-name,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-top-home,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-icon i {
    color: rgba(255, 255, 255, 0.9);
}

/* Search tint on the dark pane lives in one place: the frosted-glass rule near the top of this
   dark section (html / sidebar / store-module variants). Do not re-declare the flat tint here —
   a later duplicate silently drops the glass radius, rim highlight and blur. */

.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-search-input,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-search-input.has-query,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-search-icon,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-search-clear {
    color: rgba(255, 255, 255, 0.9);
    caret-color: #ffffff;
}

.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-search-input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.d365-sidebar:not(.collapsed) .d365-nav-item.active {
    background: #6d28d9;
    color: #ffffff;
    font-weight: 700;
    border-right-color: #6d28d9;
}

.d365-sidebar:not(.collapsed) .d365-nav-item.active .d365-nav-text,
.d365-sidebar:not(.collapsed) .d365-nav-item.active .d365-nav-icon i {
    color: #ffffff;
}

.d365-sidebar:not(.collapsed) .d365-nav-item.active .d365-nav-icon {
    background: transparent;
}

.d365-sidebar:not(.collapsed) .d365-nav-item.active::after {
    background: #ffffff;
}

/* Dark pane: the open group and the collapsed selection stay on the pane color */
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-group-header.active,
html[data-nav-ink="on-dark"] .d365-nav-group-header.active,
.store-module-page .d365-sidebar[data-nav-ink="on-dark"] .d365-nav-group-header.active {
    background-color: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-group-header.active .d365-nav-icon,
html[data-nav-ink="on-dark"] .d365-nav-group-header.active .d365-nav-icon {
    background: transparent;
}

.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-group-header.active .d365-nav-icon i,
html[data-nav-ink="on-dark"] .d365-nav-group-header.active .d365-nav-icon i,
.store-module-page .d365-sidebar[data-nav-ink="on-dark"] .d365-nav-group-header.active .d365-nav-icon i {
    color: #ffffff;
}

.d365-sidebar.collapsed[data-nav-ink="on-dark"] .d365-nav-item.active,
.d365-sidebar.collapsed[data-nav-ink="on-dark"] .d365-nav-group-header.active,
.store-module-page .d365-sidebar.collapsed[data-nav-ink="on-dark"] .d365-nav-group-header.active {
    background-color: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.d365-sidebar.collapsed[data-nav-ink="on-dark"] .d365-nav-item.active .d365-nav-icon i,
.d365-sidebar.collapsed[data-nav-ink="on-dark"] .d365-nav-group-header.active .d365-nav-icon i,
.store-module-page .d365-sidebar.collapsed[data-nav-ink="on-dark"] .d365-nav-group-header.active .d365-nav-icon i {
    color: #ffffff;
}

.d365-sidebar.collapsed[data-nav-ink="on-dark"] .d365-nav-item.active::before,
.d365-sidebar.collapsed[data-nav-ink="on-dark"] .d365-nav-group-header.active::before {
    background: #ffffff;
}

.d365-sidebar.collapsed[data-nav-ink="on-dark"] .d365-nav-item:hover,
.d365-sidebar.collapsed[data-nav-ink="on-dark"] .d365-nav-group-header:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-lock-btn {
    background: var(--nav-bg, #040C5A);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
}

.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-lock-btn:hover,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-lock-btn.is-locked {
    background: var(--nav-bg, #040C5A);
    border-color: #ffffff;
    color: #ffffff;
}

/* Segment tabs on the dark pane: a frosted glass pill that holds Setup / Transactions / Reports,
   and a lighter glass pill for the selected one. Translucent white + backdrop blur + a 1px rim and
   an inset top highlight, so the pane's own colour still shows through instead of a solid block. */
html[data-nav-ink="on-dark"] .d365-nav-segments,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-segments,
.store-module-page .d365-sidebar[data-nav-ink="on-dark"] .d365-nav-segments {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 6px 18px rgba(0, 0, 0, 0.2);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    backdrop-filter: blur(12px) saturate(150%);
}

html[data-nav-ink="on-dark"] .d365-nav-segment,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-segment,
.store-module-page .d365-sidebar[data-nav-ink="on-dark"] .d365-nav-segment {
    color: rgba(255, 255, 255, 0.72);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 4px 2px;
}

html[data-nav-ink="on-dark"] .d365-nav-segment:hover,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-segment:hover,
.store-module-page .d365-sidebar[data-nav-ink="on-dark"] .d365-nav-segment:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

html[data-nav-ink="on-dark"] .d365-nav-segment:hover .bi,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-segment:hover .bi,
.store-module-page .d365-sidebar[data-nav-ink="on-dark"] .d365-nav-segment:hover .bi {
    background: transparent;
    color: #ffffff;
    box-shadow: none;
}

html[data-nav-ink="on-dark"] .d365-nav-segment.active,
html[data-nav-ink="on-dark"] .d365-nav-segment.active:hover,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-segment.active,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-segment.active:hover,
.store-module-page .d365-sidebar[data-nav-ink="on-dark"] .d365-nav-segment.active,
.store-module-page .d365-sidebar[data-nav-ink="on-dark"] .d365-nav-segment.active:hover {
    /* Lighter pane of glass over the group: this is the "selected" puck. */
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 2px 10px rgba(0, 0, 0, 0.25);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
}

html[data-nav-ink="on-dark"] .d365-nav-segment.active .bi,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-segment.active .bi,
.store-module-page .d365-sidebar[data-nav-ink="on-dark"] .d365-nav-segment.active .bi {
    background: transparent;
    color: #ffffff;
    /* The glass puck already marks the selection, so no second ring around the glyph. */
    box-shadow: none;
}

/* The collapsed flyout ("bubble") always paints a white panel, so its segment switcher keeps the
   light palette instead of inheriting the dark glass above. */
.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-segments {
    background: transparent;
    border-color: transparent;
    padding: 0;
    gap: 6px;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-segment {
    background: transparent;
    border-color: transparent;
    color: #6b7280;
    box-shadow: none;
}

.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-segment:hover,
.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-segment.active {
    background: rgba(109, 40, 217, 0.1);
    border-color: rgba(109, 40, 217, 0.25);
    color: #6d28d9;
    box-shadow: none;
}

.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-segment .bi,
.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-segment.active .bi {
    background: transparent;
    color: inherit;
    box-shadow: none;
}

html[data-nav-ink="on-dark"] .d365-nav-segment:focus-visible,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-segment:focus-visible {
    outline-color: #ffffff;
}

/* Frozen strip on the dark pane: transparent so the sidebar gradient stays continuous, with a
   hairline divider instead of the light theme's white block. */
html[data-nav-ink="on-dark"] .d365-nav-segment-rail,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-segment-rail,
.store-module-page .d365-sidebar[data-nav-ink="on-dark"] .d365-nav-segment-rail {
    background: transparent;
    /* Fully transparent strip: no divider line, so Setup / Transactions / Reports sit straight
       on the pane surface like the module list below them. */
    border-bottom-color: transparent;
}

html[data-nav-ink="on-dark"] button.d365-nav-section-header.d365-nav-module-toggle,
.d365-sidebar[data-nav-ink="on-dark"] button.d365-nav-section-header.d365-nav-module-toggle {
    color: rgba(255, 255, 255, 0.88);
}

html[data-nav-ink="on-dark"] button.d365-nav-section-header.d365-nav-module-toggle:hover,
.d365-sidebar[data-nav-ink="on-dark"] button.d365-nav-section-header.d365-nav-module-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

html[data-nav-ink="on-dark"] button.d365-nav-section-header.d365-nav-module-toggle.expanded,
.d365-sidebar[data-nav-ink="on-dark"] button.d365-nav-section-header.d365-nav-module-toggle.expanded {
    color: #ffffff;
}

/* === D365 Main Content Area === */
.d365-main-content {
    flex: 1;
    padding: var(--d365-spacing-lg);
    background-color: var(--d365-bg-page);
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Pages render their Bootstrap dialogs inside .d365-main-content (Get Data pickers, audit log,
   approval, search...). That element is its own stacking context (z-index: 1), so a dialog
   inside it - even at Bootstrap's 1055 - still painted underneath the sticky header
   (z-index: 1000): the dialog's title bar and first rows were hidden behind the top bar.
   Lift the content area while a dialog is open so the whole dialog (and its backdrop) sits
   above the header and the sidebar - the same trick the sidebar-overlay rules use for
   .adv-search-modal. */
.d365-page:has(.modal.show) .d365-main-content {
    z-index: 1200;
}

/* CRUD command bar sits directly under the top nav, above the page heading card */
.d365-main-content > .d365-command-bar {
    order: -2;
    align-self: stretch;
    flex-shrink: 0;
    width: calc(100% + (2 * var(--d365-spacing-lg)));
    max-width: none;
    margin: calc(-1 * var(--d365-spacing-lg)) calc(-1 * var(--d365-spacing-lg)) 0;
    position: relative;
    z-index: 0;
}

.d365-main-content > .d365-page-heading-wrap {
    order: -1;
    align-self: stretch;
    flex-shrink: 0;
    width: 100%;
    max-width: none;
    /* Flush to CRUD / form; 0 = +1px vs prior -1px overlap */
    margin: 0;
    padding: 0;
}

/* Form content sits flush under the page heading card */
.d365-main-content > .d365-page-heading-wrap + .row {
    --bs-gutter-y: 0;
    margin-top: 0;
}

.d365-main-content > .d365-page-heading-wrap + .row > [class*="col-"] {
    padding-top: 0;
}

/* CFS / cmf-form pages: flush under blue heading */
.d365-main-content > .d365-page-heading-wrap ~ .cmf-form {
    margin-top: 0;
    padding-top: 0;
}

/* List-first: the record grid is the page; the form stays hidden until a row or New is chosen. */
.cmf-form.cfs-list-landing > .cfs-record-list {
    margin-top: 0 !important;
}
.cmf-form.cfs-list-landing > .cfs-record-list .d365-grid-scroll {
    max-height: calc(100vh - 190px) !important;
}

/* === D365 Command Bar (Ribbon-like) === */
.d365-command-bar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--d365-commandbar-border);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.d365-command-bar::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.d365-command-bar-right:empty {
    display: none;
}

/* A command-bar button that owns a popup (the split Print control, the split New control) must not
   be clipped by the bar's horizontal scroll container, otherwise the dropdown is cut off. */
.d365-command-bar:has(.store-print-split-host),
.d365-command-bar-left:has(.store-print-split-host),
.d365-command-bar:has(.d365-new-split-host),
.d365-command-bar-left:has(.d365-new-split-host) {
    overflow: visible;
}

.d365-main-content > .d365-command-bar:has(.store-print-split-host),
.d365-main-content > .d365-command-bar:has(.d365-new-split-host) {
    z-index: 20;
}

/* === Split New control (pages that start more than one document type) ===
   The New button keeps its primary look and gains a small chevron that lists the document
   variants. Pages that pass no NewMenu render the plain button unchanged. */
.d365-new-plain {
    display: inline-flex;
}

.d365-new-split-host {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0;
    z-index: 1100;
}

.d365-new-split-host > .d365-btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* The New button's own 12px right padding already leaves room, so the chevron is pulled back
   into it (negative margin) - the two glyphs then sit a few px apart instead of a wide hole.
   Scoped through the host so it outweighs .d365-btn's padding / min-width declared later. */
.d365-new-split-host > .d365-new-split-toggle {
    width: 14px;
    min-width: 14px;
    margin-left: -8px;
    gap: 0;
    padding: 6px 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.d365-new-split-host > .d365-new-split-toggle i {
    font-size: 8px;
    line-height: 1;
}

.d365-new-split-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1101;
    display: flex;
    flex-direction: column;
    min-width: 240px;
    padding: 4px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.d365-new-split-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    text-align: left;
    background-color: transparent;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.d365-new-split-item i {
    width: 16px;
    font-size: 14px;
    color: #6b7280;
    text-align: center;
}

.d365-new-split-item:hover:not(:disabled) {
    background-color: #f3f4f6;
    color: #111827;
}

.d365-new-split-item:hover:not(:disabled) i {
    color: #374151;
}

.d365-new-split-item.is-on {
    background-color: #e8f0fe;
    color: #1d4ed8;
}

.d365-new-split-item.is-on i {
    color: #1d4ed8;
}

.d365-new-split-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.d365-new-split-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: transparent;
}

/* === Split Print control (Store documents) ===
   Printer glyph + a small chevron 1px away; the chevron opens a proper menu with the
   "Print Last Rate" variant. Kept in the global sheet (not the component's scoped CSS) so the
   popup is styled even on pages that render the command bar outside the component's scope. */
.store-print-split-wrap {
    display: inline-flex;
    align-items: center;
}

.store-print-split-host {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0;
    z-index: 1100;
}

/* Narrow segment: the .d365-btn focus ring is too heavy, so the markup suppresses mousedown focus
   (the ring stays for keyboard users). Selectors are scoped through the host to outweigh the
   .d365-btn padding / .d365-btn-icon min-width rules declared further down this sheet.
   The negative margin pulls the chevron into the printer button's right padding, so the two
   glyphs sit ~3px apart (a gap on top of .d365-btn-icon's 7px padding read as a hole). */
.store-print-split-host > .store-print-split-toggle {
    width: 12px;
    min-width: 12px;
    gap: 0;
    margin-left: -6px;
    padding: 6px 0;
    border: 1px solid transparent;
    border-radius: 4px;
}

.store-print-split-host > .store-print-split-toggle i {
    font-size: 8px;
    line-height: 1;
}

.store-print-split-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1101;
    display: flex;
    flex-direction: column;
    min-width: 190px;
    padding: 4px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.store-print-split-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    text-align: left;
    background-color: transparent;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.store-print-split-item i {
    width: 14px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}

.store-print-split-item:hover:not(:disabled) {
    background-color: #f3f4f6;
    color: #111827;
}

.store-print-split-item:hover:not(:disabled) i {
    color: #374151;
}

.store-print-split-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.store-print-split-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: transparent;
}

.d365-command-bar-left {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
}

.d365-command-bar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex: 0 0 auto;
}

/* === D365 Buttons === */
.d365-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--d365-transition);
    background-color: transparent;
    color: #4b5563; /* subtle gray */
    height: 32px;
}

.d365-btn:focus {
    outline: none;
}

.d365-btn-primary:focus {
    border-color: #10b981;
    background-color: #e6f9f3;
}

.d365-btn-success:focus {
    border-color: #10b981;
    background-color: #e6f9f3;
}

.d365-btn-danger:focus {
    border-color: #ef4444;
    background-color: #fee2e2;
}

.d365-btn-warning:focus {
    border-color: #ff8c00;
    background-color: #fff9e6;
}

.d365-btn:focus:not(.d365-btn-primary):not(.d365-btn-success):not(.d365-btn-danger):not(.d365-btn-warning) {
    border-color: #2266e3;
    background-color: #e8f0fe;
}

.d365-btn:hover:not(:disabled) {
    background-color: #f3f4f6;
    color: #111827;
}

.d365-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.d365-btn i {
    font-size: 14px;
    color: #6b7280; /* lighter gray icon */
}

.d365-btn:hover:not(:disabled) i {
    color: #374151; /* darker gray icon on hover */
}

.d365-btn-primary {
    background-color: transparent;
    color: #4b5563;
}

.d365-btn-primary i {
    color: #10b981; /* accent color if desired, or let it fall back */
}

.d365-btn-primary:hover:not(:disabled) {
    background-color: #f3f4f6;
}

.d365-btn-success {
    background-color: transparent;
    color: #4b5563;
}

.d365-btn-success i {
    color: #4b5563; /* force gray icon */
}

.d365-btn-success:hover:not(:disabled) {
    background-color: #f3f4f6;
}

.d365-btn-danger {
    color: #ef4444; /* subtle red */
    background-color: transparent;
}

.d365-btn-danger:hover:not(:disabled) {
    background-color: #fee2e2;
}

.d365-btn-icon {
    padding: 5px 7px;
    min-width: 28px;
}

.d365-btn-receipt {
    background: #fff9c4;
    border-color: #f9a825;
    color: #795548;
    font-weight: 600;
}

.d365-btn-receipt:hover:not(:disabled) {
    background: #fff176;
    border-color: #f57f17;
}

/* === D365 Cards (Form Panels) === */
.d365-card {
    background-color: var(--d365-bg-primary);
    border: 1px solid var(--d365-border);
    border-radius: var(--d365-radius-md);
    box-shadow: var(--d365-shadow-sm);
}

.d365-card-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--d365-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--d365-bg-secondary);
    border-radius: var(--d365-radius-md) var(--d365-radius-md) 0 0;
}

.d365-card-title {
    font-size: var(--d365-font-size-lg);
    font-weight: 600;
    margin: 0;
    color: var(--d365-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.d365-card-title i {
    color: var(--d365-primary);
    font-size: 16px;
}

.d365-card-body {
    padding: 14px;
}

.d365-card-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--d365-border);
    background-color: var(--d365-bg-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--d365-spacing-sm);
    border-radius: 0 0 var(--d365-radius-md) var(--d365-radius-md);
}

/* === D365 Form Styles === */
.d365-form-section {
    margin-bottom: var(--d365-spacing-lg);
}

.d365-form-section-title {
    font-size: var(--d365-font-size-md);
    font-weight: 600;
    color: var(--d365-primary);
    margin-bottom: var(--d365-spacing-md);
    padding-bottom: var(--d365-spacing-xs);
    border-bottom: 2px solid var(--d365-primary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.d365-form-group {
    margin-bottom: var(--d365-spacing-md);
}

.d365-form-label {
    display: block;
    font-size: var(--d365-font-size-sm);
    font-weight: 400;
    color: var(--d365-text-secondary);
    margin-bottom: 4px;
}

.d365-form-label.required::after {
    content: ' *';
    color: var(--d365-danger);
}

.d365-form-control {
    width: 100%;
    padding: 6px 10px;
    font-size: var(--d365-font-size-md);
    border: 1px solid var(--d365-border-dark);
    border-radius: var(--d365-radius-sm);
    background-color: var(--d365-bg-primary);
    transition: var(--d365-transition);
    height: 32px;
    box-sizing: border-box;
}

.d365-form-control:focus {
    outline: none;
    border-color: var(--d365-primary);
    box-shadow: 0 0 0 1px var(--d365-primary);
}

.d365-form-control:disabled {
    background-color: var(--d365-bg-tertiary);
    color: var(--d365-text-secondary);
    cursor: not-allowed;
    border-color: var(--d365-border);
}

/* Validation error styling for form controls */
.d365-form-control.validation-error {
    background-color: #fde7e9 !important;
    border-color: #a4262c !important;
}

.d365-form-control.validation-error:focus {
    box-shadow: 0 0 0 1px #a4262c !important;
}

/* Disable browser autofill/autocomplete styling */
.d365-form-control:-webkit-autofill,
.d365-form-control:-webkit-autofill:hover,
.d365-form-control:-webkit-autofill:focus,
.d365-form-control:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--d365-bg-primary) inset !important;
    -webkit-text-fill-color: var(--d365-text-primary) !important;
}

select.d365-form-control option {
    background-color: var(--d365-bg-primary);
    color: var(--d365-text-primary);
}

textarea.d365-form-control {
    height: auto;
    min-height: 60px;
}

select.d365-form-control {
    cursor: pointer;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    appearance: menulist;
}

/* === D365 Grid/Table Styles === */
.d365-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--d365-font-size-sm);
}

.d365-grid thead {
    background-color: var(--d365-bg-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.d365-grid th {
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--d365-text-secondary);
    border-bottom: 1px solid var(--d365-border);
    white-space: nowrap;
    font-size: var(--d365-font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.d365-grid td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--d365-border-light);
    color: var(--d365-text-primary);
}

.d365-grid tbody tr {
    transition: var(--d365-transition);
}

.d365-grid tbody tr:hover {
    background-color: var(--d365-bg-secondary);
}

.d365-grid tbody tr.selected {
    background-color: var(--d365-primary-lighter);
    border-left: 3px solid var(--d365-primary);
}

.d365-grid-scroll {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--d365-border);
    border-radius: var(--d365-radius-sm);
}

/* === D365 Dashboard Tiles === */
.d365-tiles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--d365-spacing-md);
    margin-bottom: var(--d365-spacing-lg);
}

.d365-tile {
    background-color: var(--d365-bg-primary);
    border: 1px solid var(--d365-border);
    border-radius: var(--d365-radius-md);
    padding: 14px;
    cursor: pointer;
    transition: var(--d365-transition);
    text-decoration: none;
    color: inherit;
    display: block;
}

.d365-tile:hover {
    box-shadow: var(--d365-shadow-md);
    transform: translateY(-1px);
    border-color: var(--d365-primary);
    text-decoration: none;
    color: inherit;
}

.d365-tile-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--d365-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--d365-text-inverse);
    margin-bottom: var(--d365-spacing-sm);
}

.d365-tile-icon.blue { background-color: var(--d365-primary); }
.d365-tile-icon.green { background-color: var(--d365-success); }
.d365-tile-icon.orange { background-color: var(--d365-orange); }
.d365-tile-icon.purple { background-color: #8764b8; }
.d365-tile-icon.teal { background-color: #008080; }
.d365-tile-icon.red { background-color: var(--d365-danger); }

.d365-tile-title {
    font-size: var(--d365-font-size-md);
    font-weight: 600;
    color: var(--d365-text-primary);
    margin-bottom: 2px;
}

.d365-tile-subtitle {
    font-size: var(--d365-font-size-xs);
    color: var(--d365-text-muted);
}

/* === D365 KPI Cards === */
.d365-kpi-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--d365-spacing-md);
    margin-bottom: var(--d365-spacing-lg);
}

.d365-kpi {
    background-color: var(--d365-bg-primary);
    border: 1px solid var(--d365-border);
    border-radius: var(--d365-radius-md);
    padding: 14px;
    text-align: center;
}

.d365-kpi-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--d365-primary);
    line-height: 1.1;
}

.d365-kpi-label {
    font-size: var(--d365-font-size-xs);
    color: var(--d365-text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.d365-kpi.success .d365-kpi-value { color: var(--d365-success); }
.d365-kpi.warning .d365-kpi-value { color: var(--d365-warning); }
.d365-kpi.danger .d365-kpi-value { color: var(--d365-danger); }

/* === D365 Tabs === */
.d365-tabs {
    border-bottom: 1px solid var(--d365-border);
    display: flex;
    gap: 0;
    margin-bottom: var(--d365-spacing-md);
    background-color: var(--d365-bg-secondary);
    padding: 0 var(--d365-spacing-md);
}

.d365-tab {
    padding: 10px 16px;
    color: var(--d365-text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--d365-transition);
    font-size: var(--d365-font-size-sm);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    margin-bottom: -1px;
}

.d365-tab:hover {
    color: var(--d365-primary);
}

.d365-tab.active {
    color: var(--d365-primary);
    border-bottom-color: var(--d365-primary);
    font-weight: 600;
    background-color: var(--d365-bg-primary);
}

/* === D365 Badges === */
.d365-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: var(--d365-font-size-xs);
    font-weight: 500;
    border-radius: 10px;
}

.d365-badge-primary { background-color: var(--d365-primary-lighter); color: var(--d365-primary-dark); }
.d365-badge-success { background-color: #dff6dd; color: #0b5a0b; }
.d365-badge-warning { background-color: #fff4ce; color: #8a6d3b; }
.d365-badge-danger { background-color: #fde7e9; color: #a4262c; }

/* === D365 Status Indicator === */
.d365-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--d365-font-size-sm);
}

.d365-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.d365-status-dot.active { background-color: var(--d365-success); }
.d365-status-dot.inactive { background-color: var(--d365-text-muted); }
.d365-status-dot.pending { background-color: var(--d365-warning); }
.d365-status-dot.error { background-color: var(--d365-danger); }

/* === D365 Search Box === */
.d365-search {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.d365-search-input {
    padding: 5px 8px 5px 28px;
    border: 1px solid var(--d365-border-dark);
    border-radius: var(--d365-radius-sm);
    font-size: var(--d365-font-size-sm);
    width: 180px;
    transition: var(--d365-transition);
    height: 28px;
}

.d365-search-input:focus {
    outline: none;
    border-color: var(--d365-primary);
    width: 220px;
}

.d365-search-icon {
    position: absolute;
    left: 8px;
    color: var(--d365-text-muted);
    font-size: 12px;
}

/* === D365 Record Navigation === */
.d365-record-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background-color: var(--d365-bg-primary);
    border-radius: var(--d365-radius-sm);
    border: 1px solid var(--d365-border);
}

.d365-record-nav-btn {
    padding: 3px 6px;
    background: none;
    border: none;
    border-radius: var(--d365-radius-sm);
    cursor: pointer;
    color: var(--d365-text-secondary);
    transition: var(--d365-transition);
    font-size: 11px;
}

.d365-record-nav-btn:hover:not(:disabled) {
    background-color: var(--d365-bg-secondary);
    color: var(--d365-primary);
}

.d365-record-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.d365-record-nav-status {
    font-size: var(--d365-font-size-xs);
    color: var(--d365-text-secondary);
    padding: 0 6px;
    min-width: 50px;
    text-align: center;
}

/* === D365 Page Header === */
.d365-page-header {
    margin-bottom: var(--d365-spacing-lg);
}

.d365-page-title {
    font-size: var(--d365-font-size-xl);
    font-weight: 600;
    color: var(--d365-text-primary);
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.d365-page-title i {
    color: var(--d365-primary);
}

.d365-page-subtitle {
    font-size: var(--d365-font-size-sm);
    color: var(--d365-text-muted);
    margin: 0;
}

/* === D365 Loading & Empty State === */
.d365-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.d365-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--d365-border);
    border-top-color: var(--d365-primary);
    border-radius: 50%;
    animation: d365-spin 0.7s linear infinite;
}

@keyframes d365-spin {
    to { transform: rotate(360deg); }
}

.d365-empty-state {
    text-align: center;
    padding: var(--d365-spacing-xl);
    color: var(--d365-text-muted);
}

.d365-empty-state-icon {
    font-size: 40px;
    margin-bottom: var(--d365-spacing-md);
    opacity: 0.4;
}

.d365-empty-state-title {
    font-size: var(--d365-font-size-lg);
    font-weight: 600;
    color: var(--d365-text-secondary);
    margin-bottom: 4px;
}

.d365-empty-state-text {
    font-size: var(--d365-font-size-sm);
}

/* === Utilities === */
.d365-text-primary { color: var(--d365-primary) !important; }
.d365-text-success { color: var(--d365-success) !important; }
.d365-text-warning { color: var(--d365-warning) !important; }
.d365-text-danger { color: var(--d365-danger) !important; }
.d365-text-muted { color: var(--d365-text-muted) !important; }

.d365-mt-0 { margin-top: 0 !important; }
.d365-mb-0 { margin-bottom: 0 !important; }
.d365-mt-sm { margin-top: var(--d365-spacing-sm) !important; }
.d365-mb-sm { margin-bottom: var(--d365-spacing-sm) !important; }
.d365-mt-md { margin-top: var(--d365-spacing-md) !important; }
.d365-mb-md { margin-bottom: var(--d365-spacing-md) !important; }

.d365-flex { display: flex; }
.d365-flex-1 { flex: 1; }
.d365-gap-sm { gap: var(--d365-spacing-sm); }
.d365-gap-md { gap: var(--d365-spacing-md); }
.d365-align-center { align-items: center; }
.d365-justify-between { justify-content: space-between; }
.d365-justify-end { justify-content: flex-end; }

/* === Scrollbar Styling === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--d365-bg-secondary);
}

::-webkit-scrollbar-thumb {
    background-color: var(--d365-border-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--d365-text-muted);
}

/* === Mobile hamburger menu (hidden on desktop) === */
.d365-mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 4px;
    margin-left: -4px;
    padding: 0;
    border: none;
    border-radius: var(--d365-radius-sm);
    background: transparent;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    flex-shrink: 0;
}

.d365-mobile-menu-btn:hover,
.d365-mobile-menu-btn:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    outline: none;
}

.d365-sidebar-backdrop {
    display: none;
}

/* === Responsive === */
@media (max-width: 768px) {
    .d365-mobile-menu-btn {
        display: inline-flex;
        margin: 0;
        height: 36px;
        width: 36px;
    }

    .d365-header {
        padding: 0 12px;
        gap: 8px;
        align-items: center;
    }

    .d365-header-brand {
        min-width: 0;
        flex: 1;
        overflow: hidden;
        display: flex;
        align-items: center;
    }

    .d365-header-brand span {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .d365-header-recent {
        display: flex !important;
        margin-left: 4px;
        min-width: 0;
        flex-shrink: 1;
    }

    .d365-header-recent-desktop-only {
        display: none !important;
    }

    .d365-header-recent-item {
        width: 36px;
        height: 36px;
    }

    .d365-header-recent-chevron {
        width: 28px;
        height: 36px;
    }

    .d365-header-meta-desktop {
        display: none !important;
    }

    .d365-header-divider {
        display: none;
    }

    .d365-header-nav-desktop {
        display: none !important;
    }

    .d365-header-user {
        display: block;
    }

    .d365-header-recent-dropdown {
        right: 0;
        left: auto;
        min-width: 220px;
        max-height: 60vh;
        overflow-y: auto;
    }

    .d365-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: var(--d365-header-height) 0 0 0;
        z-index: 998;
        background: rgba(0, 0, 0, 0.45);
    }

    .d365-sidebar {
        position: fixed;
        left: -280px;
        top: var(--d365-header-height);
        height: calc(100vh - var(--d365-header-height));
        height: calc(100dvh - var(--d365-header-height));
        z-index: 999;
        width: min(280px, 85vw) !important;
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.2);
        transition: left 300ms ease, width 300ms ease;
    }

    .d365-sidebar.open {
        left: 0;
    }

    .d365-sidebar.collapsed {
        left: -280px;
        width: min(280px, 85vw) !important;
    }

    .d365-sidebar.collapsed.open {
        left: 0;
        width: min(280px, 85vw) !important;
    }

    .d365-sidebar.collapsed.open .d365-nav-text,
    .d365-sidebar.collapsed.open .d365-nav-group-title,
    .d365-sidebar.collapsed.open .d365-nav-group-chevron {
        opacity: 1;
        width: auto;
        overflow: visible;
    }

    .d365-sidebar.collapsed.open .d365-nav-item {
        justify-content: flex-start;
        padding: 10px 16px;
    }

    .d365-nav-lock-btn {
        display: none;
    }

    .d365-main-content {
        padding: 12px;
    }
    
    .d365-tiles-container {
        grid-template-columns: 1fr;
    }
    
    .d365-kpi-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === Blazor Error UI - Hidden by default === */
#blazor-error-ui {
    display: none !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #b32121;
    color: white;
    padding: 10px 16px;
    text-align: center;
    font-size: 14px;
}

#blazor-error-ui .reload {
    color: white;
    margin-left: 12px;
    text-decoration: underline;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    margin-left: 12px;
    padding: 4px 8px;
}

/* When error occurs, Blazor will set display:block */
#blazor-error-ui[style*="display: block"],
#blazor-error-ui[style*="display:block"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* === Page Container Layout === */
.d365-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.d365-app-container {
    display: flex;
    flex: 1;
    overflow: visible;
    min-height: 0;
    position: relative;
}

.ui-theme-preview {
    border: 1px solid #e1dfdd;
    border-radius: 8px;
    overflow: hidden;
    background: var(--preview-page);
}

.ui-theme-preview-header {
    background: var(--preview-header);
    color: #fff;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
}

.ui-theme-preview-body {
    display: flex;
    min-height: 160px;
    position: relative;
}

.ui-theme-preview-sidebar {
    width: 56px;
    background: var(--preview-sidebar);
    border-right: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    color: #605e5c;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 2;
}

.ui-theme-preview-content {
    width: 100%;
    padding: 14px 14px 14px 70px;
}

.ui-theme-preview-card {
    background: #fff;
    border: 1px solid #e1dfdd;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    font-size: 0.82rem;
}

.ui-theme-preview-btn {
    background: var(--preview-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.78rem;
}

/* === D365 Tooltip Styles === */
.d365-has-tooltip {
    position: relative;
}

.d365-has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #323130;
    color: #ffffff;
    padding: 6px 10px;
    border-radius: var(--d365-radius-sm);
    font-size: var(--d365-font-size-xs);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
    pointer-events: none;
    box-shadow: var(--d365-shadow-md);
    margin-bottom: 4px;
}

.d365-has-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #323130;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1001;
    margin-bottom: -8px;
}

.d365-has-tooltip:hover::after,
.d365-has-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Tooltip positions */
.d365-tooltip-bottom::after {
    bottom: auto;
    top: 100%;
    margin-bottom: 0;
    margin-top: 4px;
}

.d365-tooltip-bottom::before {
    bottom: auto;
    top: 100%;
    border-top-color: transparent;
    border-bottom-color: #323130;
    margin-bottom: 0;
    margin-top: -8px;
}

.d365-tooltip-left::after {
    bottom: auto;
    left: auto;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-bottom: 0;
    margin-right: 4px;
}

.d365-tooltip-left::before {
    bottom: auto;
    left: auto;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-top-color: transparent;
    border-left-color: #323130;
    margin-bottom: 0;
    margin-right: -8px;
}

.d365-tooltip-right::after {
    bottom: auto;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-bottom: 0;
    margin-left: 4px;
}

.d365-tooltip-right::before {
    bottom: auto;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-top-color: transparent;
    border-right-color: #323130;
    margin-bottom: 0;
    margin-left: -8px;
}

/* Form field tooltips - for labels */
.d365-form-label.d365-has-tooltip {
    cursor: help;
}

.d365-form-label.d365-has-tooltip::after {
    max-width: 250px;
    white-space: normal;
    text-align: left;
}

/* Required field indicator with tooltip */
.d365-form-label.required::after {
    content: ' *';
    color: var(--d365-danger);
}

/* Validation error tooltip */
.d365-validation-error {
    color: var(--d365-danger);
    font-size: var(--d365-font-size-xs);
    margin-top: 2px;
}

/* Field with validation error */
.d365-field-error .d365-form-control {
    border-color: var(--d365-danger) !important;
    background-color: #fde7e9 !important;
}

/* Permission-based field styling */
.d365-field-readonly .d365-form-control {
    background-color: var(--d365-bg-tertiary) !important;
    cursor: not-allowed;
}

.d365-field-hidden {
    display: none !important;
}

/* Info icon for help */
.d365-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--d365-info);
    color: white;
    font-size: 10px;
    margin-left: 4px;
    cursor: help;
}

/* === D365 AutoComplete Select Component === */
.autocomplete-select {
    position: relative;
    display: inline-block;
    width: 100%;
}

.autocomplete-select.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.autocomplete-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.autocomplete-input {
    flex: 1;
    padding-right: 28px !important;
}

.autocomplete-toggle {
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    width: 26px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--d365-text-secondary);
    border-radius: 0 var(--d365-radius-sm) var(--d365-radius-sm) 0;
    transition: var(--d365-transition);
}

.autocomplete-toggle:hover {
    background-color: var(--d365-bg-secondary);
    color: var(--d365-primary);
}

.autocomplete-toggle i {
    font-size: 10px;
}

/* Clear (x) sits inside the box, immediately left of the dropdown chevron. It only exists on
   controls the host marked Clearable, so there is no reserved dead space on ordinary pickers. */
.autocomplete-clear {
    position: absolute;
    /* Sits clear of the chevron: the 26px toggle owns right:1px, so 27px keeps a 1px gap. */
    right: 27px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--d365-text-secondary);
    cursor: pointer;
    opacity: 0.75;
    transition: var(--d365-transition);
}

.autocomplete-clear:hover {
    background-color: var(--d365-bg-secondary);
    color: var(--d365-error, #a4262c);
    opacity: 1;
}

.autocomplete-clear i {
    font-size: 9px;
}

/* Keep the value readable to the left of both icons. Scoped to wrappers that actually hold the
   clear button, so the standard 28px padding is untouched everywhere else. */
.autocomplete-input-wrapper:has(> .autocomplete-clear) > .autocomplete-input {
    padding-right: 46px !important;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--d365-bg-primary);
    border: 1px solid var(--d365-primary);
    border-top: none;
    border-radius: 0 0 var(--d365-radius-md) var(--d365-radius-md);
    box-shadow: var(--d365-shadow-lg);
    max-height: 250px;
    overflow-y: auto;
    margin-top: -1px;
}

/* tmsAutocomplete.positionDropdown applies fixed coords — keep above grids/cards */
.autocomplete-dropdown.autocomplete-dropdown-overlay {
    z-index: 2100;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--d365-border-light);
    transition: background-color 0.1s;
    font-size: var(--d365-font-size-sm);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background-color: var(--d365-bg-secondary);
}

.autocomplete-item.selected {
    background-color: var(--d365-primary-lighter);
    font-weight: 500;
}

.autocomplete-item-text {
    color: var(--d365-text-primary);
}

.autocomplete-no-results {
    padding: 12px;
    text-align: center;
    color: var(--d365-text-muted);
    font-style: italic;
    font-size: var(--d365-font-size-sm);
}

/* Two-line item template styling */
.autocomplete-item-two-line {
    line-height: 1.3;
}

.autocomplete-item-two-line .primary {
    display: block;
    font-weight: 600;
    color: var(--d365-text-primary);
}

.autocomplete-item-two-line .secondary {
    display: block;
    font-size: var(--d365-font-size-xs);
    color: var(--d365-text-muted);
    margin-top: 2px;
}

/* === D365 AutoSuggest Input Component === */
.autosuggest-input {
    position: relative;
    width: 100%;
}

.autosuggest-input.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.autosuggest-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--d365-bg-primary);
    border: 1px solid var(--d365-border-dark);
    border-top: none;
    border-radius: 0 0 var(--d365-radius-md) var(--d365-radius-md);
    box-shadow: var(--d365-shadow-lg);
    max-height: 200px;
    overflow-y: auto;
}

.autosuggest-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--d365-border-light);
    transition: background-color 0.1s;
    font-size: var(--d365-font-size-sm);
}

.autosuggest-item:last-child {
    border-bottom: none;
}

.autosuggest-item:hover,
.autosuggest-item.highlighted {
    background-color: var(--d365-bg-secondary);
}

/* End of AutoComplete styles */

/* === Collapsed module rail + segment bubble flyout =========================
   Collapsed sidebar keeps modules only: one glyph per module in a vertical rail.
   Clicking a module opens a floating bubble that carries that module's links and
   its Setup / Transactions / Reports pills, so no form is repeated in the rail. */

/* The nav panel clips itself for the width transition; the bubble must escape it. */
.d365-sidebar.collapsed .d365-sidebar-nav {
    overflow: visible;
}

.d365-sidebar.collapsed .d365-nav-module-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Breathing room between glyphs: 40px hit box + 10px gap keeps the rail from reading as one
       cramped column, while eleven modules still fit a normal pane height. */
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    padding: 10px 0 12px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.d365-sidebar.collapsed .d365-nav-module-rail::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.d365-nav-rail-divider {
    flex: 0 0 auto;
    align-self: center;
    width: 28px;
    height: 1px;
    margin: 2px 0;
    background: linear-gradient(90deg,
        rgba(15, 23, 42, 0) 0%,
        rgba(15, 23, 42, 0.28) 22%,
        rgba(15, 23, 42, 0.28) 78%,
        rgba(15, 23, 42, 0) 100%);
    pointer-events: none;
}

.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-rail-divider,
html[data-nav-ink="on-dark"] .d365-nav-rail-divider {
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.38) 22%,
        rgba(255, 255, 255, 0.38) 78%,
        rgba(255, 255, 255, 0) 100%);
}

.d365-nav-module-trigger {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #6b7280;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition: background-color 160ms ease, color 160ms ease;
}

.d365-nav-module-trigger > i {
    font-size: 17px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.d365-nav-module-trigger:hover,
.d365-nav-module-trigger:focus-visible {
    background: #f3f4f6;
    color: #111827;
}

.d365-nav-module-trigger:focus-visible {
    outline: 2px solid #6d28d9;
    outline-offset: 2px;
}

.d365-nav-module-trigger.is-active,
.d365-nav-module-trigger.active {
    background: #f3f4f6;
    color: #111827;
}

/* Open module keeps the tone bar on the sidebar edge, like the expanded active row. */
.d365-nav-module-trigger.is-active::before,
.d365-nav-module-trigger.active::before,
.d365-nav-module-trigger.is-current::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 7px;
    bottom: 7px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--nav-tone-accent, #6d28d9);
    pointer-events: none;
}

.d365-nav-module-trigger[data-nav-tone="terminal"] { --nav-tone-accent: #2266e3; }
.d365-nav-module-trigger[data-nav-tone="cfs"] { --nav-tone-accent: #fdb913; }
.d365-nav-module-trigger[data-nav-tone="mnr"] { --nav-tone-accent: #ca5010; }
.d365-nav-module-trigger[data-nav-tone="store"] { --nav-tone-accent: #0f9d58; }
.d365-nav-module-trigger[data-nav-tone="accounts"] { --nav-tone-accent: #6d28d9; }
.d365-nav-module-trigger[data-nav-tone="admin"] { --nav-tone-accent: #6b7280; }

/* Dark pane: the rail glyphs follow the pane ink. */
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-module-trigger,
html[data-nav-ink="on-dark"] .d365-nav-module-trigger {
    color: rgba(255, 255, 255, 0.9);
}

.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-module-trigger:hover,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-module-trigger.is-active,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-module-trigger.active,
html[data-nav-ink="on-dark"] .d365-nav-module-trigger:hover,
html[data-nav-ink="on-dark"] .d365-nav-module-trigger.is-active,
html[data-nav-ink="on-dark"] .d365-nav-module-trigger.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* Active module while a form of that module is open (collapsed rail). */
.d365-sidebar.collapsed .d365-nav-module-trigger.is-current,
.d365-sidebar.collapsed .d365-nav-module-trigger.is-current:hover {
    position: relative;
    background: color-mix(in srgb, var(--nav-tone-accent, #6d28d9) 18%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nav-tone-accent, #6d28d9) 40%, transparent);
    color: var(--nav-tone-accent, #6d28d9);
}

.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-module-trigger.is-current,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-module-trigger.is-current:hover,
html[data-nav-ink="on-dark"] .d365-nav-module-trigger.is-current,
html[data-nav-ink="on-dark"] .d365-nav-module-trigger.is-current:hover {
    background: color-mix(in srgb, var(--nav-tone-accent, #6d28d9) 34%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nav-tone-accent, #6d28d9) 62%, transparent),
                0 0 10px color-mix(in srgb, var(--nav-tone-accent, #6d28d9) 40%, transparent);
    color: #ffffff;
}

/* Segment badge: which section (Setup / Transactions / Reports) is open. */
.d365-nav-module-trigger .d365-nav-module-segment {
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--nav-tone-accent, #6d28d9);
    border: 2px solid var(--d365-sidebar-bg, #ffffff);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.45), 0 0 0 1px rgba(15, 23, 42, 0.16);
    pointer-events: none;
    z-index: 2;
}

.d365-nav-module-trigger .d365-nav-module-segment i {
    font-size: 10px;
    line-height: 1;
    color: #ffffff;
}

.d365-nav-module-trigger[data-nav-tone="cfs"] .d365-nav-module-segment i {
    color: #1f2937;
}

.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-module-trigger .d365-nav-module-segment,
html[data-nav-ink="on-dark"] .d365-nav-module-trigger .d365-nav-module-segment {
    border-color: var(--d365-sidebar-bg, #040C5A);
}

/* In the rail the flyout is a bubble, not part of the column flow. */
.d365-sidebar.collapsed .d365-nav-flyout {
    display: none;
}

.d365-sidebar.collapsed .d365-nav-flyout.is-bubble {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-bubble-top, 8px);
    left: calc(var(--d365-sidebar-collapsed-width) + 8px);
    width: 272px;
    max-height: calc(100vh - var(--nav-bubble-top, 8px) - 8px);
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    z-index: 1300;
    animation: d365-nav-bubble-in 140ms ease-out;
}

@keyframes d365-nav-bubble-in {
    from { opacity: 0; transform: translateX(-6px); }
    to { opacity: 1; transform: translateX(0); }
}

/* The rail already carries home and search, so the bubble starts at the module name. */
.d365-sidebar.collapsed .d365-nav-flyout.is-bubble > .d365-nav-top-rail,
.d365-sidebar.collapsed .d365-nav-flyout.is-bubble > .d365-nav-segment-rail {
    display: none;
}

.d365-nav-bubble-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    padding: 12px 12px 10px;
    background: #ffffff;
    border-bottom: 1px solid #f3f4f6;
}

.d365-nav-bubble-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.d365-nav-bubble-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: #f3f4f6;
    color: #374151;
    flex-shrink: 0;
}

.d365-nav-bubble-icon i {
    font-size: 14px;
    line-height: 1;
}

.d365-nav-bubble-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.d365-nav-bubble-head[data-nav-tone="terminal"] .d365-nav-bubble-icon { background: rgba(34, 102, 227, 0.1); color: #2266e3; }
.d365-nav-bubble-head[data-nav-tone="cfs"] .d365-nav-bubble-icon { background: rgba(253, 185, 19, 0.16); color: #a16207; }
.d365-nav-bubble-head[data-nav-tone="mnr"] .d365-nav-bubble-icon { background: rgba(202, 80, 16, 0.12); color: #ca5010; }
.d365-nav-bubble-head[data-nav-tone="store"] .d365-nav-bubble-icon { background: rgba(15, 157, 88, 0.12); color: #0f9d58; }
.d365-nav-bubble-head[data-nav-tone="accounts"] .d365-nav-bubble-icon { background: rgba(109, 40, 217, 0.12); color: #6d28d9; }
.d365-nav-bubble-head[data-nav-tone="admin"] .d365-nav-bubble-icon { background: #eef0f3; color: #4b5563; }

/* The pill strip is suppressed in the rail; inside the bubble it is the segment switcher. */
.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-segments {
    display: flex;
    width: 100%;
    margin: 0;
}

.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-segment {
    padding: 6px 4px;
    font-size: 10px;
}

.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-content {
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
    justify-content: flex-start;
    padding: 8px 10px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #ffffff;
}

.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-menu-items {
    align-items: stretch;
    gap: 2px;
    width: 100%;
}

.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-group {
    align-items: stretch;
    width: 100%;
    margin-bottom: 6px;
}

/* A caption inside the bubble would repeat the module name the header already shows. */
.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-group-header {
    display: none;
}

.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-subheader {
    display: block;
    padding: 10px 10px 4px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #9ca3af;
}

/* Text is hidden rail-side; in the bubble every row is a full label again. */
.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-text {
    opacity: 1;
    max-width: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-menu-items .d365-nav-item {
    width: auto;
    height: auto;
    min-height: 32px;
    justify-content: flex-start;
    gap: 9px;
    padding: 6px 10px;
    margin: 0;
    border-radius: 8px;
    border-right: none;
    background: transparent;
    color: #374151;
    font-size: 12.5px;
    font-weight: 500;
}

.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-menu-items .d365-nav-item:hover {
    background: #f3f4f6;
    color: #111827;
}

.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-menu-items .d365-nav-item.active {
    background: #eef2ff;
    color: #4338ca;
    font-weight: 600;
    box-shadow: none;
}

.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-item.active::before,
.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-item.active::after {
    display: none;
    content: none;
}

.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-icon,
.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-icon-bare {
    width: 18px;
    flex-shrink: 0;
    background: none;
    color: #9ca3af;
}

.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-icon i,
.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-icon-bare i {
    font-size: 14px;
    line-height: 1;
    color: inherit;
}

.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-item.active .d365-nav-icon i,
.d365-sidebar.collapsed .d365-nav-flyout.is-bubble .d365-nav-item.active .d365-nav-icon-bare i {
    color: #4338ca;
}

/* The bubble is a light panel even on a dark pane, so it must not inherit pane ink. */
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-flyout.is-bubble .d365-nav-bubble-title,
html[data-nav-ink="on-dark"] .d365-nav-flyout.is-bubble .d365-nav-bubble-title {
    color: #374151;
}

.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-flyout.is-bubble .d365-nav-item,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-flyout.is-bubble .d365-nav-subheader,
html[data-nav-ink="on-dark"] .d365-nav-flyout.is-bubble .d365-nav-item,
html[data-nav-ink="on-dark"] .d365-nav-flyout.is-bubble .d365-nav-subheader {
    color: #374151;
}

.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-flyout.is-bubble .d365-nav-item.active,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-flyout.is-bubble .d365-nav-item.active .d365-nav-text,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-flyout.is-bubble .d365-nav-item.active .d365-nav-icon i,
html[data-nav-ink="on-dark"] .d365-nav-flyout.is-bubble .d365-nav-item.active,
html[data-nav-ink="on-dark"] .d365-nav-flyout.is-bubble .d365-nav-item.active .d365-nav-text,
html[data-nav-ink="on-dark"] .d365-nav-flyout.is-bubble .d365-nav-item.active .d365-nav-icon i {
    color: #4338ca;
}

.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-flyout.is-bubble .d365-nav-items,
.d365-sidebar[data-nav-ink="on-dark"] .d365-nav-flyout.is-bubble .d365-nav-search-hint,
html[data-nav-ink="on-dark"] .d365-nav-flyout.is-bubble .d365-nav-items,
html[data-nav-ink="on-dark"] .d365-nav-flyout.is-bubble .d365-nav-search-hint {
    color: #6b7280;
}
