/* Web shell polish: the approved Finance/personal workspace palette, with no
   changes to navigation composition, permissions or command visibility.
   Important declarations only displace the legacy shell's important rules. */
.me-skip-link:not(:focus-visible) { box-shadow: none; }
[data-minierp-shell="true"].me-shell {
    --sw-surface: #fff;
    --sw-navigation: #f0f4fa;
    --sw-topbar: #f7f9fc;
    --sw-ink: #173967;
    --sw-muted: #526883;
    --sw-border: #d8e2ef;
    --sw-hover: #f0f5fc;
    --sw-active: #eaf2ff;
    --sw-active-ink: #123b73;
    --sw-accent: #245ac0;
    --sw-focus: #185adb;
    --sw-font: 14px;
    --sw-small: 12px;
    --sw-control: 40px;
}
[data-minierp-shell="true"].me-font-small { --sw-font: 13px; --sw-small: 11px; }
[data-minierp-shell="true"].me-font-large { --sw-font: 16px; --sw-small: 13px; --sw-control: 44px; }
[data-minierp-shell="true"].me-density-compact { --sw-control: 36px; }
[data-minierp-shell="true"]:is([data-theme="dark"], [data-theme="midnight"], [data-theme="slate"]) {
    --sw-surface: #182737;
    --sw-topbar: var(--sw-surface);
    --sw-navigation: #142230;
    --sw-ink: #edf4ff;
    --sw-muted: #b6c6db;
    --sw-border: #435a73;
    --sw-hover: #233c55;
    --sw-active: #294e77;
    --sw-active-ink: #fff;
    --sw-accent: #98c4ff;
    --sw-focus: #a4cdff;
}
[data-minierp-shell="true"][data-theme="contrast"] {
    --sw-surface: #080e19; --sw-navigation: #080e19; --sw-topbar: var(--sw-surface);
    --sw-ink: #fff; --sw-muted: #e0eaff; --sw-border: #adc7eb;
    --sw-hover: #263b55; --sw-active: #263b55; --sw-active-ink: #fff;
    --sw-accent: #a8d1ff; --sw-focus: #ffe176;
}

/* Navigation keeps its existing width, collapsed state and mobile behavior. */
[data-minierp-shell="true"].me-shell .me-sidebar {
    background: var(--sw-navigation) !important;
    color: var(--sw-ink) !important;
    border-right: 1px solid var(--sw-border);
    box-shadow: none !important;
    padding: 0;
}
[data-minierp-shell="true"].me-shell .me-sidebar-header {
    background: var(--sw-navigation) !important;
    border-bottom: 1px solid var(--sw-border);
    padding: 12px 18px;
}
[data-minierp-shell="true"].me-shell .me-sidebar-header .me-brand { margin: 0; gap: 10px; }
[data-minierp-shell="true"].me-shell .me-brand-mark {
    width: 36px; height: 36px; min-width: 36px;
    border-radius: 8px; background: #fff; box-shadow: none;
}
[data-minierp-shell="true"].me-shell :is(.me-brand-title, .me-brand-title span) {
    color: var(--sw-ink) !important; font-size: 17px; font-weight: 650; letter-spacing: 0;
}
[data-minierp-shell="true"].me-shell .me-brand-subtitle {
    color: var(--sw-muted) !important; font-size: 10px; font-weight: 500; letter-spacing: .045em;
}
[data-minierp-shell="true"].me-shell :is(.me-sidebar-top-toggle, .me-mobile-toggle) {
    border: 1px solid var(--sw-border); border-radius: 7px;
    background: var(--sw-surface); color: var(--sw-ink);
    box-shadow: none; font-size: var(--sw-font); font-weight: 600;
}
[data-minierp-shell="true"].me-shell .me-sidebar-top-toggle {
    width: 34px; height: 34px; min-width: 34px; min-height: 34px; justify-content: center;
}
[data-minierp-shell="true"].me-shell .me-sidebar-mobile-close { display: none; }
[data-minierp-shell="true"].me-shell .me-nav {
    gap: 16px; padding: 16px 12px; scrollbar-color: #afc0d6 transparent;
}
[data-minierp-shell="true"].me-shell .me-nav-group { gap: 4px; }
[data-minierp-shell="true"].me-shell .me-nav-group-title {
    color: var(--sw-muted) !important; font-size: 11px; font-weight: 600;
    letter-spacing: .04em; padding: 0 12px; margin-bottom: 5px;
}
[data-minierp-shell="true"].me-shell :is(.me-nav-link, .me-nav-disabled) {
    grid-template-columns: 24px minmax(0, 1fr); gap: 10px;
    min-height: var(--sw-control); padding: 8px 12px; border-radius: 7px;
    color: var(--sw-ink) !important; background: transparent;
    box-shadow: none; transform: none; transition: background-color .12s ease;
}
[data-minierp-shell="true"].me-shell .me-nav-title {
    color: inherit !important; font-size: var(--sw-font); font-weight: 550 !important;
    text-shadow: none; line-height: 1.4;
}
[data-minierp-shell="true"].me-shell .me-nav-description {
    color: var(--sw-muted) !important; font-size: var(--sw-small); font-weight: 400 !important;
}
[data-minierp-shell="true"].me-shell .me-nav-link:hover {
    background: var(--sw-hover) !important; color: var(--sw-ink) !important; transform: none;
}
[data-minierp-shell="true"].me-shell .me-nav-link.active {
    background: var(--sw-active) !important; color: var(--sw-active-ink) !important;
    box-shadow: inset 3px 0 0 var(--sw-accent);
}
[data-minierp-shell="true"].me-shell .me-nav-link.active .me-nav-title { font-weight: 650 !important; }
[data-minierp-shell="true"].me-shell .me-nav-icon {
    width: 24px !important; height: 24px !important; min-width: 24px;
    color: var(--sw-ink) !important; background: transparent !important;
    border: 0; border-radius: 0; box-shadow: none !important; transform: none;
}
[data-minierp-shell="true"].me-shell :is(.me-nav-mud-icon, .me-nav-icon-img) {
    width: 21px !important; height: 21px !important; font-size: 21px !important; color: inherit !important;
}
[data-minierp-shell="true"].me-shell .me-sidebar-footer {
    border-top: 1px solid var(--sw-border); color: var(--sw-muted) !important;
    padding: 12px 22px; font-size: 11px; line-height: 1.6;
}
@media (min-width: 981px) {
    [data-minierp-shell="true"][data-sidebar-state="collapsed"] .me-sidebar-brandline {
        flex-direction: column; gap: 8px;
    }
    [data-minierp-shell="true"][data-sidebar-state="collapsed"] .me-nav-link,
    [data-minierp-shell="true"][data-sidebar-state="collapsed"] .me-nav-disabled {
        grid-template-columns: 1fr !important; padding: 10px !important;
        min-height: 44px; justify-items: center; gap: 0 !important;
    }
    [data-minierp-shell="true"][data-sidebar-state="collapsed"] .me-sidebar-footer { padding: 10px 8px; font-size: 10px; text-align: center; }
}

/* The search can shrink; utilities wrap as a group before controls collide. */
[data-minierp-shell="true"].me-shell .me-topbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    min-height: 60px; padding: 8px 18px;
    background: var(--sw-topbar) !important;
    border-bottom: 1px solid var(--sw-border); box-shadow: none; backdrop-filter: none;
}
[data-minierp-shell="true"].me-shell .me-topbar-left {
    display: flex; flex: 1 1 240px; width: auto; min-width: 0; gap: 8px;
}
[data-minierp-shell="true"].me-shell .me-topbar-middle-right {
    display: flex; flex: 0 1 auto; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0;
}
[data-minierp-shell="true"].me-shell .me-topbar-center {
    flex: 0 1 246px; min-width: 0; justify-content: flex-start;
}
[data-minierp-shell="true"].me-shell .me-topbar-right {
    flex: 0 1 auto; gap: 8px; min-width: 0; width: auto; margin-left: auto;
}
[data-minierp-shell="true"].me-shell .me-topbar-tools { gap: 6px; flex-wrap: nowrap; }
[data-minierp-shell="true"].me-shell :is(.me-ek-context-link, .me-tool-button, .me-profile-button) {
    min-height: var(--sw-control); height: auto; border-radius: 8px;
    border: 1px solid var(--sw-border); background: var(--sw-surface) !important;
    color: var(--sw-ink); box-shadow: none !important;
}
[data-minierp-shell="true"].me-shell .me-ek-context-link {
    min-width: 0; width: 100%; padding: 5px 9px; gap: 8px; justify-content: flex-start;
}
[data-minierp-shell="true"].me-shell .me-ek-context-current { min-width: 0; text-align: left; }
[data-minierp-shell="true"].me-shell .me-ek-context-current span {
    color: var(--sw-muted); font-size: 10px; font-weight: 400; letter-spacing: .015em;
}
[data-minierp-shell="true"].me-shell .me-ek-context-current strong {
    color: var(--sw-ink); font-size: var(--sw-small); font-weight: 600; line-height: 1.25;
}
[data-minierp-shell="true"].me-shell .me-tool-button { min-width: var(--sw-control); padding: 4px; }
[data-minierp-shell="true"].me-shell .me-tool-button-wide { padding: 5px 10px; gap: 7px; }
[data-minierp-shell="true"].me-shell .me-tool-icon-shell {
    width: 26px; height: 26px; min-width: 26px; border: 0; border-radius: 6px;
    background: var(--sw-hover); color: var(--sw-accent); box-shadow: none;
}
[data-minierp-shell="true"].me-shell .me-tool-icon-shell img { width: 18px; height: 18px; }
[data-minierp-shell="true"].me-shell .me-tool-short-text {
    color: var(--sw-ink); font-size: var(--sw-small); font-weight: 500; letter-spacing: 0;
}
[data-minierp-shell="true"].me-shell .me-profile-button { padding: 4px 9px; gap: 8px; }
[data-minierp-shell="true"].me-shell .me-profile-avatar {
    width: 30px; height: 30px; min-width: 30px; border-radius: 7px;
    background: #245ac0; color: #fff; font-size: 12px; font-weight: 650; box-shadow: none;
}
[data-minierp-shell="true"].me-shell .me-profile-name { color: var(--sw-ink); font-size: var(--sw-font); font-weight: 600; }
[data-minierp-shell="true"].me-shell .me-profile-role { color: var(--sw-muted); font-size: var(--sw-small); font-weight: 400; }
[data-minierp-shell="true"].me-shell .me-shell-search-host { min-width: 0; max-width: 480px; flex: 1 1 auto; }
[data-minierp-shell="true"].me-shell .me-shell-search-box {
    min-height: var(--sw-control); padding: 2px 4px 2px 10px; gap: 8px;
    border: 1px solid var(--sw-border); border-radius: 8px;
    background: var(--sw-surface); box-shadow: none;
}
[data-minierp-shell="true"].me-shell .me-shell-search-box:focus-within { border-color: var(--sw-focus); }
[data-minierp-shell="true"].me-shell .me-shell-search-leading-icon { color: var(--sw-muted); font-size: 20px; }
[data-minierp-shell="true"].me-shell .me-shell-search-input :is(.mud-input-root, .mud-input-slot) {
    color: var(--sw-ink); font-size: var(--sw-font); font-weight: 400;
}
[data-minierp-shell="true"].me-shell .me-shell-search-input input::placeholder { color: var(--sw-muted); opacity: 1; }
[data-minierp-shell="true"].me-shell .me-shell-search-advanced-button {
    border-radius: 6px; background: var(--sw-hover); color: var(--sw-accent) !important; padding: 6px;
}
[data-minierp-shell="true"].me-shell .me-shell-search-advanced-button svg { width: 20px; height: 20px; }
[data-minierp-shell="true"].me-shell :is(.me-shell-search-panel, .me-ek-profile-dropdown) {
    border: 1px solid var(--sw-border); border-radius: 8px;
    background: var(--sw-surface); color: var(--sw-ink);
    box-shadow: 0 8px 28px rgba(23, 57, 103, .14);
}
[data-minierp-shell="true"].me-shell .me-shell-search-item { border-radius: 6px; }
[data-minierp-shell="true"].me-shell .me-ek-profile-dropdown a {
    border-radius: 6px; font-size: var(--sw-font); font-weight: 550;
}
[data-minierp-shell="true"].me-shell :is(.me-shell-search-item:hover, .me-shell-search-item.is-selected) { background: var(--sw-hover); }
[data-minierp-shell="true"].me-shell :is(.me-shell-search-item-title, .me-shell-search-panel-title, .me-ek-profile-dropdown a) { color: var(--sw-ink); }
[data-minierp-shell="true"].me-shell :is(.me-shell-search-item-subtitle, .me-shell-search-group-header, .me-shell-search-hints) { color: var(--sw-muted); }
[data-minierp-shell="true"].me-shell .me-shell-search-item-badge { color: var(--sw-muted); font-size: var(--sw-small); font-weight: 500; }
[data-minierp-shell="true"].me-shell .me-shell-search-footer-link { color: var(--sw-accent); font-size: var(--sw-font); font-weight: 600; }
[data-minierp-shell="true"]:is([data-theme="dark"], [data-theme="slate"], [data-theme="midnight"], [data-theme="contrast"]) .me-topbar .me-tool-icon-shell img { filter: brightness(2.5) saturate(.55); }
[data-minierp-shell="true"].me-shell :is(.me-topbar, .me-sidebar) :is(a, button, summary, input):focus-visible {
    outline: 3px solid var(--sw-focus); outline-offset: 2px;
}
[data-minierp-shell="true"].me-shell :is(.me-ek-context-link, .me-tool-button, .me-profile-button, .me-sidebar-top-toggle, .me-mobile-toggle):hover {
    background: var(--sw-hover) !important; border-color: var(--sw-accent);
}
@media (max-width: 980px) {
    [data-minierp-shell="true"].me-shell .me-sidebar-mobile-close:not([hidden]) {
        display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 10px;
        border: 1px solid var(--sw-border); border-radius: 7px; background: var(--sw-surface);
        color: var(--sw-ink); font-size: var(--sw-font); font-weight: 500; cursor: pointer;
    }
    [data-minierp-shell="true"].me-shell .me-topbar { padding: 8px 12px; }
    [data-minierp-shell="true"].me-shell .me-topbar-left { flex-basis: 100%; }
    [data-minierp-shell="true"].me-shell .me-topbar-middle-right { flex: 1 1 100%; }
    [data-minierp-shell="true"].me-shell .me-shell-search-host { max-width: none; }
    [data-minierp-shell="true"].me-shell .me-mobile-toggle { min-height: 40px; padding: 6px 10px; }
    [data-minierp-shell="true"].me-shell .me-topbar-center { flex: 1 1 190px; }
}
@media (max-width: 480px) {
    [data-minierp-shell="true"].me-shell .me-topbar-right { flex: 1 1 100%; justify-content: space-between; margin-left: 0; }
    [data-minierp-shell="true"].me-shell .me-ek-context-link { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
    [data-minierp-shell="true"].me-shell .me-nav-link { transition: none; }
}
@media (forced-colors: active) {
    [data-minierp-shell="true"].me-shell .me-nav-link.active { outline: 2px solid Highlight; outline-offset: -2px; }
}

/* Small surface refinements only: approved content, grids and tools stay intact. */
[data-minierp-shell="true"] .fh-page .fh-personal-nav button:hover { background: #f0f5fc; border-color: #d8e2ef; }
[data-minierp-shell="true"] .fh-page .fh-personal-nav button[aria-expanded="true"] { color: #123b73; font-weight: 600; }
[data-minierp-shell="true"] .fh-page .fh-group:focus-within { border-color: #8daedb; }
[data-minierp-shell="true"] .fh-page :is(.fh-group-more, .fh-personal-toolbar .fh-all-personal):hover { color: #123b73; }
[data-minierp-shell="true"] .me-personal-workspace .pw-navigation a.pw-origin:hover { border-radius: 6px 0 0 6px; }
