/* =====================================================================
   Taskify — floating sidebar with a curved icon rail.
   • floating rounded glass panel (inset from the page edges)
   • a lighter rail on the left holds the icons; its ends curve in like a wave
   • labels sit right of the rail; the current page = purple icon + dot + label
   • footer: round buttons (search · collapse), search opens above them
   Older layers style the sidebar too (components/menu.blade.php, clay.css,
   glass.css, dark-mode.css); rules here start with
   `html body:is(.has-menu, #_fx) #layout-menu` (two ids) so they win everywhere.
   The page offset (inset + width + gap) is set by the menu script.
===================================================================== */

html body:is(.has-menu, #_fx) #layout-menu {
    --sb-ink: var(--d-heading, #1c1433);
    --sb-text: var(--d-text, #4b4566);
    --sb-muted: var(--d-muted, #7a7491);
    --sb-accent: #8b5cf6;
    --sb-accent-ink: #7c3aed;
    --sb-line: color-mix(in srgb, var(--d-heading, #1c1433) 8%, transparent);
    --sb-rail-w: 64px;
    /* rail colour lives in the SVG caps below too (light / dark versions) */
    --sb-rail: rgba(124, 58, 237, .07);
    --sb-rail-top: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 70' preserveAspectRatio='none'%3E%3Cpath d='M0 0C0 38 64 24 64 70H0Z' fill='rgba(124,58,237,0.07)'/%3E%3C/svg%3E");
    --sb-rail-bot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 70' preserveAspectRatio='none'%3E%3Cpath d='M0 70C0 32 64 46 64 0H0Z' fill='rgba(124,58,237,0.07)'/%3E%3C/svg%3E");
    --sb-ease: cubic-bezier(.22, .8, .25, 1);
}
html[data-app-theme="dark"] body:is(.has-menu, #_fx) #layout-menu {
    --sb-accent-ink: #c4b5fd;
    --sb-rail: rgba(255, 255, 255, .055);
    --sb-rail-top: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 70' preserveAspectRatio='none'%3E%3Cpath d='M0 0C0 38 64 24 64 70H0Z' fill='rgba(255,255,255,0.055)'/%3E%3C/svg%3E");
    --sb-rail-bot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 70' preserveAspectRatio='none'%3E%3Cpath d='M0 70C0 32 64 46 64 0H0Z' fill='rgba(255,255,255,0.055)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------------
   Floating panel (desktop)
--------------------------------------------------------------------- */
@media (min-width: 1200px) {
    html body:is(.has-menu, #_fx) #layout-menu.layout-menu.menu-container {
        top: 12px !important;
        bottom: 12px !important;
        left: 12px !important;
        height: calc(100vh - 24px) !important;
        min-height: 0 !important;
        border: 1px solid rgba(139, 92, 246, .14) !important;
        border-radius: 28px !important;
        background:
            radial-gradient(120% 34% at 0% 0%, rgba(167, 139, 250, .2), transparent 60%),
            linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(250, 247, 255, .82)) !important;
        box-shadow: 0 24px 60px -28px rgba(76, 29, 149, .45), 0 2px 6px -2px rgba(76, 29, 149, .12), inset 0 1px 0 rgba(255, 255, 255, .9) !important;
        -webkit-backdrop-filter: blur(22px) saturate(160%);
        backdrop-filter: blur(22px) saturate(160%);
        transition: width .34s var(--sb-ease), box-shadow .3s ease !important;
    }
    html[data-app-theme="dark"] body:is(.has-menu, #_fx) #layout-menu.layout-menu.menu-container {
        border-color: rgba(196, 181, 253, .1) !important;
        background:
            radial-gradient(120% 34% at 0% 0%, rgba(139, 92, 246, .28), transparent 62%),
            linear-gradient(180deg, rgba(30, 19, 56, .94), rgba(17, 11, 33, .96)) !important;
        box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .06) !important;
    }
    html body:is(.has-menu, #_fx) #layout-menu.menu-container::before { display: none !important; }
    html.layout-menu-fixed .layout-wrapper.layout-content-navbar .layout-page { transition: padding-left .34s cubic-bezier(.22, .8, .25, 1) !important; }
}

/* the curved rail behind the icons (panel-relative, so it doesn't scroll) */
html body:is(.has-menu, #_fx) #layout-menu.menu-container::after {
    content: "";
    position: absolute;
    top: 78px;
    bottom: 64px;
    left: 0;
    z-index: 0;
    width: var(--sb-rail-w);
    background:
        var(--sb-rail-top) top left / var(--sb-rail-w) 70px no-repeat,
        var(--sb-rail-bot) bottom left / var(--sb-rail-w) 70px no-repeat,
        linear-gradient(var(--sb-rail), var(--sb-rail)) left 70px / var(--sb-rail-w) calc(100% - 140px) no-repeat;
    pointer-events: none;
    transition: width .34s var(--sb-ease);
}
html body:is(.has-menu, #_fx) #layout-menu > * { position: relative; z-index: 1; }
/* the old search spot under the header is empty now */
html body:is(.has-menu, #_fx) #layout-menu > .d-flex.flex-column.px-3:not(:has(*)) { display: none !important; }

/* ---------------------------------------------------------------------
   Header
--------------------------------------------------------------------- */
html body:is(.has-menu, #_fx) #layout-menu .menu-sidebar-header.sb-head {
    gap: 8px !important;
    margin: 0 14px;
    padding: 16px 0 14px !important;
    border-bottom: 0 !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}
html body:is(.has-menu, #_fx) #layout-menu .sb-head .sb-logo { width: 42px !important; height: 42px !important; border-radius: 14px !important; }
html body:is(.has-menu, #_fx) #layout-menu .sb-head .sb-logo img { width: 32px !important; height: 32px !important; }
html body:is(.has-menu, #_fx) #layout-menu .sb-head .sb-switch-caret { display: inline-block !important; }
html body:is(.has-menu, #_fx) #layout-menu .sb-head .menu-workspace-toggle > button.sb-switch-btn {
    min-height: 42px;
    padding: 4px 6px 4px 8px !important;
    border-radius: 13px !important;
    transition: background .2s ease !important;
}

/* ---------------------------------------------------------------------
   Items: icon on the rail, label beside it
--------------------------------------------------------------------- */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner { padding: 6px 12px 12px 0 !important; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .dropdown-divider { display: none !important; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-header {
    margin: 14px 0 4px !important;
    padding: 0 0 0 calc(var(--sb-rail-w) + 14px) !important;
    color: var(--sb-muted) !important;
    font-size: .62rem !important;
    font-weight: 700 !important;
    letter-spacing: .1em;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-header:first-of-type { margin-top: 0 !important; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item { margin: 0 0 4px !important; }

html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link {
    position: relative;
    min-height: 46px !important;
    height: auto !important;
    padding: 0 10px 0 calc((var(--sb-rail-w) - 20px) / 2) !important;
    gap: calc((var(--sb-rail-w) - 20px) / 2 + 14px) !important;
    border: 0 !important;
    border-radius: 0 14px 14px 0 !important;
    color: var(--sb-text) !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: .88rem !important;
    font-weight: 500 !important;
    letter-spacing: .01em;
    transition: color .22s ease, background .22s ease !important;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link .menu-icon {
    flex: none;
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    color: var(--sb-muted) !important;
    background: transparent !important;
    box-shadow: none !important;
    transition: color .22s ease, transform .35s var(--sb-ease), filter .3s ease !important;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link > div { transition: transform .3s var(--sb-ease); }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link:hover { color: var(--sb-ink) !important; background: linear-gradient(90deg, transparent var(--sb-rail-w), color-mix(in srgb, var(--sb-accent) 7%, transparent) var(--sb-rail-w)) !important; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link:hover .menu-icon { color: var(--sb-accent) !important; transform: scale(1.12); }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link:hover > div { transform: translateX(3px); }

/* current page: glowing purple icon, a dot on the rail's edge, purple label */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.active > .menu-link {
    color: var(--sb-accent-ink) !important;
    background: transparent !important;
    font-weight: 700 !important;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.active > .menu-link .menu-icon {
    color: var(--sb-accent) !important;
    filter: drop-shadow(0 4px 10px rgba(139, 92, 246, .55));
    animation: sb-icon-pop .5s var(--sb-ease) both;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.active > .menu-link::before {
    content: "";
    position: absolute;
    top: 50%;
    left: calc(var(--sb-rail-w) - 5px);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--sb-accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--sb-accent) 22%, transparent), 0 0 14px rgba(139, 92, 246, .8);
    transform: translateY(-50%);
    animation: sb-dot-in .45s var(--sb-ease) both;
}
@keyframes sb-icon-pop { 0% { transform: scale(.7); opacity: .4; } 60% { transform: scale(1.15); } 100% { transform: none; opacity: 1; } }
@keyframes sb-dot-in { from { transform: translateY(-50%) scale(0); opacity: 0; } }

/* submenu arrow */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link.menu-toggle::after {
    width: .4rem !important;
    height: .4rem !important;
    border-width: 1.6px 1.6px 0 0 !important;
    color: var(--sb-muted) !important;
    transition: transform .3s var(--sb-ease) !important;
}

/* submenus: under the label column, fading in one after another */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-sub {
    margin: 0 0 6px calc(var(--sb-rail-w) + 6px) !important;
    padding: 0 !important;
    background: transparent !important;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-sub > .menu-item { margin: 1px 0 !important; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.open > .menu-sub > .menu-item { animation: sb-sub-in .35s var(--sb-ease) both; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.open > .menu-sub > .menu-item:nth-child(2) { animation-delay: .03s; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.open > .menu-sub > .menu-item:nth-child(3) { animation-delay: .06s; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.open > .menu-sub > .menu-item:nth-child(4) { animation-delay: .09s; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.open > .menu-sub > .menu-item:nth-child(5) { animation-delay: .12s; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.open > .menu-sub > .menu-item:nth-child(n+6) { animation-delay: .15s; }
@keyframes sb-sub-in { from { opacity: 0; transform: translateX(-6px); } }

html body:is(.has-menu, #_fx) #layout-menu .menu-sub > .menu-item > .menu-link {
    position: relative;
    min-height: 34px !important;
    padding: 0 12px 0 14px !important;
    border: 0 !important;
    border-radius: 11px !important;
    color: var(--sb-muted) !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: .83rem !important;
    font-weight: 500 !important;
    transition: background .2s ease, color .2s ease, padding .25s var(--sb-ease) !important;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-sub > .menu-item > .menu-link::before {
    content: "" !important;
    display: block !important;
    position: absolute;
    top: 50%;
    left: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    opacity: .5;
    transform: translateY(-50%);
    transition: transform .25s var(--sb-ease), opacity .2s ease;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-sub > .menu-item > .menu-link:hover { color: var(--sb-ink) !important; padding-left: 18px !important; }
html body:is(.has-menu, #_fx) #layout-menu .menu-sub > .menu-item.active > .menu-link {
    color: var(--sb-accent-ink) !important;
    background: color-mix(in srgb, var(--sb-accent) 11%, transparent) !important;
    font-weight: 700 !important;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-sub > .menu-item.active > .menu-link::before { opacity: 1; background: var(--sb-accent); transform: translateY(-50%) scale(1.5); }

/* badges: quiet chips */
html body:is(.has-menu, #_fx) #layout-menu .menu-link > div { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; }
html body:is(.has-menu, #_fx) #layout-menu .menu-link .badge {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px !important;
    padding: 0 6px !important;
    border-radius: 99px !important;
    font-size: .64rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-link .badge:not(.bg-danger):not(.bg-warning) { color: var(--sb-muted) !important; background: color-mix(in srgb, var(--d-heading, #1c1433) 8%, transparent) !important; }
html body:is(.has-menu, #_fx) #layout-menu .menu-link .badge.bg-warning { color: #fff !important; background: #f59e0b !important; }
html body:is(.has-menu, #_fx) #layout-menu .menu-link .badge.bg-danger { color: #fff !important; background: #ef4444 !important; }

/* ---------------------------------------------------------------------
   Footer: search above round buttons
--------------------------------------------------------------------- */
html body:is(.has-menu, #_fx) #layout-menu .sb-foot { flex: none; padding: 8px 14px 14px; }
html body:is(.has-menu, #_fx) #layout-menu .sb-foot-btns { display: flex; align-items: center; gap: 10px; }
html body:is(.has-menu, #_fx) #layout-menu .sb-foot .sb-icon-btn,
html body:is(.has-menu, #_fx) #layout-menu .sb-foot .sb-collapse {
    display: grid !important;
    place-items: center;
    flex: none;
    width: 38px !important;
    height: 38px !important;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--sb-accent) 18%, transparent) !important;
    border-radius: 50% !important;
    color: var(--sb-accent-ink) !important;
    background: color-mix(in srgb, var(--sb-accent) 10%, transparent) !important;
    box-shadow: 0 6px 16px -10px rgba(124, 58, 237, .8) !important;
    font-size: 1.05rem;
    transition: transform .25s var(--sb-ease), background .2s ease, color .2s ease, box-shadow .25s ease !important;
}
html body:is(.has-menu, #_fx) #layout-menu .sb-foot .sb-icon-btn:hover,
html body:is(.has-menu, #_fx) #layout-menu .sb-foot .sb-collapse:hover,
html body:is(.has-menu, #_fx) #layout-menu .sb-foot .sb-icon-btn.is-on {
    color: #fff !important;
    background: linear-gradient(160deg, #9b6bff, #6d28d9) !important;
    box-shadow: 0 10px 22px -10px rgba(124, 58, 237, .95) !important;
    transform: translateY(-2px);
}
@media (max-width: 1199.98px) { html body:is(.has-menu, #_fx) #layout-menu .sb-foot .sb-collapse { display: none !important; } }

html body:is(.has-menu, #_fx) #layout-menu .sb-search.sidebar-search-wrapper {
    max-height: 0;
    padding: 0 !important;
    overflow: hidden;
    opacity: 0;
    transform: translateY(6px);
    transition: max-height .3s var(--sb-ease), opacity .2s ease, transform .3s var(--sb-ease), padding .3s var(--sb-ease);
}
html body:is(.has-menu, #_fx) #layout-menu .sb-search.sidebar-search-wrapper.is-open { max-height: 60px; padding: 0 0 10px !important; opacity: 1; transform: none; }
html body:is(.has-menu, #_fx) #layout-menu .sb-search .sidebar-search-shortcut { display: none !important; }
html body:is(.has-menu, #_fx) #layout-menu .sb-search .sidebar-search-box #menu-search { height: 40px !important; padding-right: 34px !important; border-radius: 20px !important; }

/* ---------------------------------------------------------------------
   Collapsed (desktop): just the rail
--------------------------------------------------------------------- */
@media (min-width: 1200px) {
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu.menu-container::after { width: 100%; background: transparent; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner { padding: 6px 0 12px !important; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link {
        width: 44px !important;
        min-height: 44px !important;
        margin: 0 auto !important;
        padding: 0 !important;
        justify-content: center !important;
        border-radius: 14px !important;
    }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.active > .menu-link { background: color-mix(in srgb, var(--sb-accent) 14%, transparent) !important; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.active > .menu-link::before { left: -8px; width: 6px; height: 18px; border-radius: 0 6px 6px 0; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link:hover { background: color-mix(in srgb, var(--sb-accent) 9%, transparent) !important; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-header,
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .sb-search,
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .sb-search-toggle { display: none !important; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .sb-foot { padding: 8px 0 14px; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .sb-foot-btns { justify-content: center; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-sidebar-header.sb-head { justify-content: center; margin: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
    html body:is(.has-menu, #_fx) #layout-menu *,
    html body:is(.has-menu, #_fx) #layout-menu { animation: none !important; transition: none !important; }
}

/* ---- fixes on top of older layers ---- */
/* older rules drew an active bar on the panel's right edge (li::before) */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item::before { display: none !important; content: none !important; }
/* …and hid our dot (link::before) with !important */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.active > .menu-link::before {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    top: 50% !important;
    left: calc(var(--sb-rail-w) - 5px) !important;
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    background: var(--sb-accent) !important;
    opacity: 1 !important;
}
@media (min-width: 1200px) {
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.active > .menu-link::before {
        left: -8px !important;
        width: 5px !important;
        height: 18px !important;
        border-radius: 0 6px 6px 0 !important;
    }
}
/* room for long labels; toggles keep space for the arrow so badges don't collide */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link {
    gap: calc((var(--sb-rail-w) - 20px) / 2 + 8px) !important;
    font-size: .86rem !important;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link.menu-toggle { padding-right: 30px !important; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link > div { overflow: hidden; white-space: nowrap; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link > div > .badge { margin-left: auto; flex: none; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link.menu-toggle::after { right: 12px !important; }

/* older rules gave every link a 16px side margin: icons must sit centred on the rail */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item { width: 100% !important; max-width: 100% !important; align-self: stretch !important; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link {
    margin: 0 !important;
    padding-left: calc((var(--sb-rail-w) - 20px) / 2) !important;   /* icon centred on the rail */
    gap: 36px !important;                                            /* label clears the dot on the rail edge */
    font-size: .84rem !important;
}
@media (min-width: 1200px) {
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link { margin: 0 auto !important; padding: 0 !important; }
}
/* dot on the rail edge (rail ends at --sb-rail-w; the panel border is 1px) */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.active > .menu-link::before { left: calc(var(--sb-rail-w) - 6px) !important; }
/* sub items: a small dot, not the big white one from older rules */
html body:is(.has-menu, #_fx) #layout-menu .menu-sub > .menu-item > .menu-link::before {
    width: 5px !important;
    height: 5px !important;
    left: 4px !important;
    border: 0 !important;
    box-shadow: none !important;
    background: currentColor !important;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-sub > .menu-item.active > .menu-link::before { background: var(--sb-accent) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--sb-accent) 25%, transparent) !important; transform: translateY(-50%) !important; }
/* the "Plugin" tag: small enough to fit next to the label */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link > div { overflow: visible; }
html body:is(.has-menu, #_fx) #layout-menu .menu-link .badge:not(.bg-danger):not(.bg-warning) { height: 17px !important; padding: 0 5px !important; font-size: .56rem !important; letter-spacing: .02em; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link > div { flex: 1 1 auto !important; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link.menu-toggle::after {
    position: absolute !important;
    top: 50% !important;
    right: 14px !important;
    left: auto !important;
    margin: 0 !important;
    transform: translateY(-50%) rotate(45deg) !important;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.open > .menu-link.menu-toggle::after { transform: translateY(-50%) rotate(135deg) !important; }
/* links span the whole row (older rules sized them to their content) */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link { display: flex !important; width: 100% !important; }
@media (min-width: 1200px) {
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link { width: 44px !important; }
}

/* ---------------------------------------------------------------------
   Collapsed: the icons stay on the wavy rail (same look as the open menu)
--------------------------------------------------------------------- */
@media (min-width: 1200px) {
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu.menu-container::after {
        width: var(--sb-rail-w) !important;
        background:
            var(--sb-rail-top) top left / var(--sb-rail-w) 70px no-repeat,
            var(--sb-rail-bot) bottom left / var(--sb-rail-w) 70px no-repeat,
            linear-gradient(var(--sb-rail), var(--sb-rail)) left 70px / var(--sb-rail-w) calc(100% - 140px) no-repeat !important;
    }
    /* icon tiles centred on the rail (rail centre = 32px) */
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link {
        margin: 0 0 0 calc((var(--sb-rail-w) - 44px) / 2) !important;
        background: transparent !important;
    }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link:hover {
        background: color-mix(in srgb, var(--sb-accent) 12%, transparent) !important;
        transform: none;
    }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.active > .menu-link { background: transparent !important; }
    /* current page: dot on the rail edge, like the open menu */
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.active > .menu-link::before {
        left: calc(var(--sb-rail-w) - 6px - (var(--sb-rail-w) - 44px) / 2) !important;
        width: 10px !important;
        height: 10px !important;
        border-radius: 50% !important;
    }
    /* logo + footer button sit on the rail too */
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-sidebar-header.sb-head { justify-content: flex-start !important; margin: 0 !important; padding-left: calc((var(--sb-rail-w) - 42px) / 2) !important; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .sb-foot { padding-left: calc((var(--sb-rail-w) - 38px) / 2) !important; padding-right: 0 !important; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .sb-foot-btns { justify-content: flex-start !important; }
}
@media (min-width: 1200px) {
    /* older rules centre the items in the 76px panel — keep them on the rail */
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item { justify-content: flex-start !important; }
    /* collapsed: no logo, the rail starts with the icons */
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-sidebar-header.sb-head > a.sb-logo { display: none !important; }
}
@media (min-width: 1200px) {
    /* older rules fade the header image out when collapsed */
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .sb-head .sb-logo img { opacity: 1 !important; visibility: visible !important; }
    /* footer: the collapse button sits on the rail as well */
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .sb-foot { padding: 8px 0 14px calc((var(--sb-rail-w) - 38px) / 2) !important; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .sb-foot-btns { gap: 0 !important; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .sb-foot .sb-collapse { margin: 0 !important; }
}

/* =====================================================================
   "Only the new": no card around the menu — the wave shape IS the sidebar.
   Top: full width behind the logo, an S-curve narrows it into the rail,
   the rail runs down under the icons and curves back to the edge at the bottom.
===================================================================== */
html body:is(.has-menu, #_fx) #layout-menu {
    --sb-shape: rgba(124, 58, 237, .085);
    --sb-shape-top: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 190' preserveAspectRatio='none'%3E%3Cpath d='M0 0H256V64C256 118 64 104 64 190H0Z' fill='rgba(124,58,237,0.085)'/%3E%3C/svg%3E");
    --sb-shape-bot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 110' preserveAspectRatio='none'%3E%3Cpath d='M0 0H64C64 58 0 50 0 110Z' fill='rgba(124,58,237,0.085)'/%3E%3C/svg%3E");
}
html[data-app-theme="dark"] body:is(.has-menu, #_fx) #layout-menu {
    --sb-shape: rgba(255, 255, 255, .065);
    --sb-shape-top: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 190' preserveAspectRatio='none'%3E%3Cpath d='M0 0H256V64C256 118 64 104 64 190H0Z' fill='rgba(255,255,255,0.065)'/%3E%3C/svg%3E");
    --sb-shape-bot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 110' preserveAspectRatio='none'%3E%3Cpath d='M0 0H64C64 58 0 50 0 110Z' fill='rgba(255,255,255,0.065)'/%3E%3C/svg%3E");
}

@media (min-width: 1200px) {
    /* the panel itself is invisible now (rounded corners still clip the shape) */
    html body:is(.has-menu, #_fx) #layout-menu.layout-menu.menu-container,
    html[data-app-theme="dark"] body:is(.has-menu, #_fx) #layout-menu.layout-menu.menu-container {
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        overflow: hidden !important;
    }
}

/* the shape (open + collapsed) */
html body:is(.has-menu, #_fx) #layout-menu.menu-container::after,
html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu.menu-container::after {
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background:
        var(--sb-shape-top) top left / 100% 190px no-repeat,
        var(--sb-shape-bot) bottom left / var(--sb-rail-w) 110px no-repeat,
        linear-gradient(var(--sb-shape), var(--sb-shape)) left 190px / var(--sb-rail-w) calc(100% - 300px) no-repeat !important;
    transition: none !important;
}
/* labels sit on the page background, so give them full contrast */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link { color: var(--sb-ink) !important; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.active > .menu-link { color: var(--sb-accent-ink) !important; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link .menu-icon { color: var(--sb-text) !important; }
/* the old submenu guide line belonged to the card look */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-sub::before { display: none !important; }
/* collapsed: the shape becomes just the rail — rounded on top, the same wave at the bottom */
@media (min-width: 1200px) {
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu.menu-container::after {
        width: var(--sb-rail-w) !important;
        border-radius: 24px 24px 0 0;
        background:
            var(--sb-shape-bot) bottom left / var(--sb-rail-w) 110px no-repeat,
            linear-gradient(var(--sb-shape), var(--sb-shape)) left top / var(--sb-rail-w) calc(100% - 110px) no-repeat !important;
    }
}

/* =====================================================================
   Flush to the left edge; the top curve mirrors the bottom one
   (the rail grows out of the left edge at the top, and returns to it at the bottom)
===================================================================== */
html body:is(.has-menu, #_fx) #layout-menu {
    --sb-shape-topcap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 110' preserveAspectRatio='none'%3E%3Cpath d='M0 110H64C64 52 0 60 0 0Z' fill='rgba(124,58,237,0.085)'/%3E%3C/svg%3E");
}
html[data-app-theme="dark"] body:is(.has-menu, #_fx) #layout-menu {
    --sb-shape-topcap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 110' preserveAspectRatio='none'%3E%3Cpath d='M0 110H64C64 52 0 60 0 0Z' fill='rgba(255,255,255,0.065)'/%3E%3C/svg%3E");
}
@media (min-width: 1200px) {
    html body:is(.has-menu, #_fx) #layout-menu.layout-menu.menu-container,
    html[data-app-theme="dark"] body:is(.has-menu, #_fx) #layout-menu.layout-menu.menu-container {
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        border-radius: 0 !important;
    }
}
html body:is(.has-menu, #_fx) #layout-menu.menu-container::after,
html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu.menu-container::after {
    width: var(--sb-rail-w) !important;
    border-radius: 0 !important;
    background:
        var(--sb-shape-topcap) top left / var(--sb-rail-w) 110px no-repeat,
        var(--sb-shape-bot) bottom left / var(--sb-rail-w) 110px no-repeat,
        linear-gradient(var(--sb-shape), var(--sb-shape)) left 110px / var(--sb-rail-w) calc(100% - 220px) no-repeat !important;
}

/* =====================================================================
   Icon tiles + selected item, and a centred collapsed menu
===================================================================== */
/* collapsed: the rail is the whole (76px) sidebar, so everything centres on it */
@media (min-width: 1200px) {
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu { --sb-rail-w: var(--taskify-menu-collapsed-width, 4.75rem); }
}

/* every icon sits in a soft rounded tile */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link {
    padding-left: calc((var(--sb-rail-w) - 38px) / 2) !important;
    gap: calc((var(--sb-rail-w) - 38px) / 2 + 14px) !important;
    background: transparent !important;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link .menu-icon {
    box-sizing: border-box;
    width: 38px !important;
    height: 38px !important;
    padding: 9.5px;
    border-radius: 12px !important;
    stroke-width: 1.75;
    color: var(--sb-text) !important;
    background: transparent !important;
    transition: background .25s ease, color .25s ease, box-shadow .3s ease, transform .35s var(--sb-ease) !important;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link:hover {
    background: transparent !important;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link:hover .menu-icon {
    color: var(--sb-accent) !important;
    background: color-mix(in srgb, var(--sb-accent) 13%, transparent) !important;
    transform: translateY(-1px) scale(1.06);
}

/* selected item: gradient tile + glowing white icon + a soft stripe behind the label */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.active > .menu-link .menu-icon {
    color: #fff !important;
    background: linear-gradient(145deg, #a78bfa 0%, #7c3aed 55%, #5b21b6 100%) !important;
    box-shadow: 0 8px 18px -8px rgba(124, 58, 237, .95), inset 0 1px 0 rgba(255, 255, 255, .35) !important;
    filter: none !important;
    animation: sb-tile-in .5s var(--sb-ease) both;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.active > .menu-link {
    background: linear-gradient(90deg, transparent var(--sb-rail-w), color-mix(in srgb, var(--sb-accent) 15%, transparent) var(--sb-rail-w), transparent 96%) !important;
    font-weight: 700 !important;
}
/* the dot is replaced by the tile */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.active > .menu-link::before { display: none !important; content: none !important; }
@keyframes sb-tile-in { 0% { transform: scale(.75); opacity: .3; } 60% { transform: scale(1.08); } 100% { transform: none; opacity: 1; } }

/* collapsed: tiles only, centred */
@media (min-width: 1200px) {
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link {
        width: 44px !important;
        min-height: 44px !important;
        margin: 0 0 0 calc((var(--sb-rail-w) - 44px) / 2) !important;
        padding: 0 !important;
        justify-content: center !important;
        background: transparent !important;
    }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link:hover { background: transparent !important; transform: none; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .sb-foot { padding-left: calc((var(--sb-rail-w) - 38px) / 2) !important; }
}
/* older rules pin the icon to 19px with no padding — the tile needs 38px */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link .menu-icon {
    flex: 0 0 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    padding: 9.5px !important;
}
/* a bit more room for sub items */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner { padding-right: 8px !important; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-sub { margin-left: calc(var(--sb-rail-w) + 2px) !important; }
html body:is(.has-menu, #_fx) #layout-menu .menu-sub > .menu-item > .menu-link { font-size: .81rem !important; padding-right: 8px !important; white-space: nowrap; }

/* =====================================================================
   Logo on the rail: centred like the icons, a glass tile in the rail's tone
   (no white box), and matching top / bottom curves of the same height
===================================================================== */
html body:is(.has-menu, #_fx) #layout-menu .menu-sidebar-header.sb-head {
    margin: 0 10px 0 0 !important;
    padding-left: calc((var(--sb-rail-w) - 40px) / 2) !important;
    gap: calc((var(--sb-rail-w) - 40px) / 2 + 10px) !important;
}
html body:is(.has-menu, #_fx) #layout-menu .sb-head .sb-logo {
    width: 40px !important;
    height: 40px !important;
    border: 1px solid color-mix(in srgb, var(--sb-accent) 22%, transparent);
    border-radius: 13px !important;
    background: color-mix(in srgb, var(--sb-accent) 12%, transparent) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 8px 18px -12px rgba(76, 29, 149, .9) !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
html[data-app-theme="dark"] body:is(.has-menu, #_fx) #layout-menu .sb-head .sb-logo {
    border-color: rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .07) !important;
}
html body:is(.has-menu, #_fx) #layout-menu .sb-head .sb-logo:hover {
    transform: translateY(-1px) rotate(-3deg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 10px 22px -10px rgba(124, 58, 237, .9) !important;
}
html body:is(.has-menu, #_fx) #layout-menu .sb-head .sb-logo img { width: 26px !important; height: 26px !important; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .25)); }
html body:is(.has-menu, #_fx) #layout-menu .sb-head .sb-switch-btn { padding-left: 2px !important; }

/* top + bottom curves: same height, mirrored */
html body:is(.has-menu, #_fx) #layout-menu.menu-container::after,
html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu.menu-container::after {
    background:
        var(--sb-shape-topcap) top left / var(--sb-rail-w) 84px no-repeat,
        var(--sb-shape-bot) bottom left / var(--sb-rail-w) 84px no-repeat,
        linear-gradient(var(--sb-shape), var(--sb-shape)) left 84px / var(--sb-rail-w) calc(100% - 168px) no-repeat !important;
}

/* =====================================================================
   NEON RAIL — brand gradient shape with a glow; bigger icon tiles
   (logo above the rail, buttons below it — like the reference)
===================================================================== */
html body:is(.has-menu, #_fx) #layout-menu {
    --sb-top: 76px;          /* rail starts under the header */
    --sb-bottom: 70px;       /* …and ends above the footer buttons */
    --sb-cap: 46px;          /* height of each curve */
    --sb-tile: 42px;
    --sb-neon: linear-gradient(180deg, #b794ff 0%, #8b5cf6 28%, #7c3aed 60%, #5b21b6 100%);
    /* mask pieces (black = visible) */
    --sb-mask-top: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 110' preserveAspectRatio='none'%3E%3Cpath d='M0 110H64C64 52 0 60 0 0Z'/%3E%3C/svg%3E");
    --sb-mask-bot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 110' preserveAspectRatio='none'%3E%3Cpath d='M0 0H64C64 58 0 50 0 110Z'/%3E%3C/svg%3E");
}

/* the shape: neon gradient, cut out with a mask (top curve · straight rail · bottom curve) */
html body:is(.has-menu, #_fx) #layout-menu.menu-container::after,
html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu.menu-container::after {
    top: var(--sb-top) !important;
    bottom: var(--sb-bottom) !important;
    width: var(--sb-rail-w) !important;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 55%),
        var(--sb-neon) !important;
    -webkit-mask:
        var(--sb-mask-top) top left / 100% var(--sb-cap) no-repeat,
        var(--sb-mask-bot) bottom left / 100% var(--sb-cap) no-repeat,
        linear-gradient(#000, #000) left var(--sb-cap) / 100% calc(100% - 2 * var(--sb-cap)) no-repeat;
    mask:
        var(--sb-mask-top) top left / 100% var(--sb-cap) no-repeat,
        var(--sb-mask-bot) bottom left / 100% var(--sb-cap) no-repeat,
        linear-gradient(#000, #000) left var(--sb-cap) / 100% calc(100% - 2 * var(--sb-cap)) no-repeat;
}
/* the glow behind it */
html body:is(.has-menu, #_fx) #layout-menu.menu-container::before {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    inset: auto !important;
    top: calc(var(--sb-top) + 30px) !important;
    bottom: calc(var(--sb-bottom) + 30px) !important;
    left: 0 !important;
    z-index: 0 !important;
    width: calc(var(--sb-rail-w) * .75) !important;
    height: auto !important;
    border-radius: 40px;
    background: linear-gradient(180deg, #c4b5fd, #8b5cf6 40%, #6d28d9) !important;
    filter: blur(22px);
    opacity: .55;
    pointer-events: none;
    animation: sb-neon-breathe 5s ease-in-out infinite;
}
html:not([data-app-theme="dark"]) body:is(.has-menu, #_fx) #layout-menu.menu-container::before { opacity: .35; }
@keyframes sb-neon-breathe { 50% { opacity: .75; } }

/* header: logo on the page background, centred over the rail — same in every state (hover included) */
html body:is(.has-menu, #_fx) #layout-menu .menu-sidebar-header.sb-head,
html.layout-menu-collapsed.taskify-menu-hover body:is(.has-menu, #_fx) #layout-menu .menu-sidebar-header.sb-head {
    justify-content: flex-start !important;
    min-height: var(--sb-top) !important;
    margin: 0 10px 0 0 !important;
    padding: 0 0 0 calc((var(--sb-rail-w) - 42px) / 2) !important;
    gap: calc((var(--sb-rail-w) - 42px) / 2 + 12px) !important;
}
html body:is(.has-menu, #_fx) #layout-menu .sb-head > a.sb-logo,
html.layout-menu-collapsed.taskify-menu-hover body:is(.has-menu, #_fx) #layout-menu .sb-head > a.sb-logo {
    display: grid !important;
    place-items: center !important;
    flex: 0 0 42px !important;
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(139, 92, 246, .35);
    border-radius: 14px !important;
    background: linear-gradient(160deg, rgba(167, 139, 250, .25), rgba(109, 40, 217, .18)) !important;
    box-shadow: 0 0 18px -4px rgba(139, 92, 246, .7), inset 0 1px 0 rgba(255, 255, 255, .2) !important;
}
html body:is(.has-menu, #_fx) #layout-menu .sb-head .sb-logo img { width: 28px !important; height: 28px !important; margin: 0 !important; }

/* items: bigger tiles, more breathing room */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner { padding-top: 22px !important; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item { margin: 0 0 8px !important; }
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link {
    min-height: 50px !important;
    padding-left: calc((var(--sb-rail-w) - var(--sb-tile)) / 2) !important;
    gap: calc((var(--sb-rail-w) - var(--sb-tile)) / 2 + 14px) !important;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link .menu-icon {
    flex: 0 0 var(--sb-tile) !important;
    width: var(--sb-tile) !important;
    min-width: var(--sb-tile) !important;
    max-width: var(--sb-tile) !important;
    height: var(--sb-tile) !important;
    padding: 10px !important;
    border-radius: 14px !important;
    color: rgba(255, 255, 255, .86) !important;
    filter: drop-shadow(0 1px 1px rgba(46, 16, 101, .35));
}
/* on the neon rail: translucent white hover, solid white selected tile */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link:hover .menu-icon {
    color: #fff !important;
    background: rgba(255, 255, 255, .18) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25) !important;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.active > .menu-link .menu-icon {
    color: #6d28d9 !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .18), 0 0 22px rgba(221, 214, 254, .9), 0 10px 22px -8px rgba(46, 16, 101, .7) !important;
    filter: none !important;
}

/* footer buttons on the page background, below the rail */
html body:is(.has-menu, #_fx) #layout-menu .sb-foot { min-height: var(--sb-bottom); display: flex; flex-direction: column; justify-content: flex-end; padding: 0 10px 14px calc((var(--sb-rail-w) - 38px) / 2) !important; }

/* collapsed: no header, the rail starts near the top; everything centred on it */
@media (min-width: 1200px) {
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu { --sb-top: 14px; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-sidebar-header.sb-head { display: none !important; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner { padding-top: 34px !important; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link {
        width: var(--sb-tile) !important;
        min-height: var(--sb-tile) !important;
        margin: 0 0 0 calc((var(--sb-rail-w) - var(--sb-tile)) / 2) !important;
    }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item { margin-bottom: 12px !important; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .sb-foot { padding: 0 0 14px calc((var(--sb-rail-w) - 38px) / 2) !important; }
}
@media (prefers-reduced-motion: reduce) { html body:is(.has-menu, #_fx) #layout-menu.menu-container::before { animation: none !important; } }
/* first item starts after the top curve has fully opened */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner { padding-top: calc(var(--sb-cap) - 2px) !important; }
@media (min-width: 1200px) {
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner { padding-top: calc(var(--sb-top) + var(--sb-cap) - 6px) !important; }
}

/* =====================================================================
   GLASS RAIL — same glass as the top bar; same size + icons open or collapsed
   (collapsed sidebar = 4rem = exactly the rail width, set in components/menu.blade.php)
===================================================================== */
html body:is(.has-menu, #_fx) #layout-menu {
    --sb-glass: linear-gradient(135deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .12)), rgba(255, 255, 255, .4);
    --sb-glass-edge: rgba(255, 255, 255, .85);
    --sb-glass-blur: saturate(1.8) blur(26px);
}
html[data-app-theme="dark"] body:is(.has-menu, #_fx) #layout-menu {
    --sb-glass: linear-gradient(135deg, rgba(196, 181, 253, .1), rgba(196, 181, 253, .016)), rgba(167, 139, 250, .055);
    --sb-glass-edge: rgba(196, 181, 253, .16);
}
@media (min-width: 1200px) {
    /* one rail width for both states */
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu { --sb-rail-w: 64px; }
}

/* ::before = the 1px edge, ::after = the glass fill (both cut to the wave shape) */
html body:is(.has-menu, #_fx) #layout-menu.menu-container::before {
    top: var(--sb-top) !important;
    bottom: var(--sb-bottom) !important;
    width: var(--sb-rail-w) !important;
    border-radius: 0;
    background: var(--sb-glass-edge) !important;
    filter: none;
    opacity: 1 !important;
    animation: none !important;
    -webkit-mask:
        var(--sb-mask-top) top left / 100% var(--sb-cap) no-repeat,
        var(--sb-mask-bot) bottom left / 100% var(--sb-cap) no-repeat,
        linear-gradient(#000, #000) left var(--sb-cap) / 100% calc(100% - 2 * var(--sb-cap)) no-repeat;
    mask:
        var(--sb-mask-top) top left / 100% var(--sb-cap) no-repeat,
        var(--sb-mask-bot) bottom left / 100% var(--sb-cap) no-repeat,
        linear-gradient(#000, #000) left var(--sb-cap) / 100% calc(100% - 2 * var(--sb-cap)) no-repeat;
}
html body:is(.has-menu, #_fx) #layout-menu.menu-container::after,
html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu.menu-container::after {
    top: calc(var(--sb-top) + 1px) !important;
    bottom: calc(var(--sb-bottom) + 1px) !important;
    width: calc(var(--sb-rail-w) - 1px) !important;
    background: var(--sb-glass) !important;
    -webkit-backdrop-filter: var(--sb-glass-blur);
    backdrop-filter: var(--sb-glass-blur);
}

/* icons on glass: theme ink, purple on hover, brand gradient tile when selected */
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link .menu-icon {
    color: var(--sb-text) !important;
    filter: none !important;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link:hover .menu-icon {
    color: var(--sb-accent) !important;
    background: color-mix(in srgb, var(--sb-accent) 14%, transparent) !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sb-accent) 18%, transparent) !important;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item.active > .menu-link .menu-icon {
    color: #fff !important;
    background: linear-gradient(145deg, #a78bfa 0%, #7c3aed 55%, #5b21b6 100%) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 20px -8px rgba(124, 58, 237, .95), 0 0 18px -4px rgba(139, 92, 246, .7) !important;
}

/* logo tile: same glass as the top bar */
html body:is(.has-menu, #_fx) #layout-menu .sb-head > a.sb-logo,
html.layout-menu-collapsed.taskify-menu-hover body:is(.has-menu, #_fx) #layout-menu .sb-head > a.sb-logo {
    border: 1px solid var(--sb-glass-edge) !important;
    background: var(--sb-glass) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 10px 24px -14px rgba(60, 48, 130, .5) !important;
    -webkit-backdrop-filter: var(--sb-glass-blur);
    backdrop-filter: var(--sb-glass-blur);
}

/* collapsed: identical tiles, same spot as when open */
@media (min-width: 1200px) {
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item { margin-bottom: 8px !important; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link {
        width: var(--sb-tile) !important;
        min-height: 50px !important;
        margin: 0 0 0 calc((var(--sb-rail-w) - var(--sb-tile)) / 2) !important;
        padding: 0 !important;
    }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .sb-foot { padding: 0 0 14px calc((var(--sb-rail-w) - 38px) / 2) !important; }
}

/* =====================================================================
   COLLAPSED = OPEN — logo always shown, rail starts at the same height,
   icon tiles keep the exact same size (only the labels go away)
===================================================================== */
@media (min-width: 1200px) {
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu { --sb-top: 76px; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-sidebar-header.sb-head {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        min-height: var(--sb-top) !important;
        margin: 0 !important;
        padding: 0 0 0 calc((var(--sb-rail-w) - 42px) / 2) !important;
    }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-sidebar-header.sb-head > a.sb-logo.sb-logo {
        display: grid !important;
        place-items: center !important;
        flex: 0 0 42px !important;
        width: 42px !important;
        height: 42px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid var(--sb-glass-edge) !important;
        border-radius: 14px !important;
        background: var(--sb-glass) !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 10px 24px -14px rgba(60, 48, 130, .5) !important;
        -webkit-backdrop-filter: var(--sb-glass-blur);
        backdrop-filter: var(--sb-glass-blur);
    }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .sb-head .sb-logo img {
        display: block !important; opacity: 1 !important; visibility: visible !important;
        width: 28px !important; height: 28px !important; margin: 0 !important;
    }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .sb-head .sb-switch { display: none !important; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner { padding-top: calc(var(--sb-cap) - 2px) !important; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu .menu-inner > .menu-item > .menu-link .menu-icon {
        flex: 0 0 var(--sb-tile) !important;
        width: var(--sb-tile) !important;
        min-width: var(--sb-tile) !important;
        height: var(--sb-tile) !important;
        min-height: var(--sb-tile) !important;
        max-height: var(--sb-tile) !important;
        padding: 10px !important;
        margin: 0 !important;
        font-size: 20px !important;
    }
}

/* =====================================================================
   Quick "create operation" modal (Tasks → + Create new operation).
   Opens on any page, so it carries its own tokens instead of relying on
   the page's clay / glass ones. Markup: components/menu.blade.php.
===================================================================== */
.qop-modal {
    --qop-surface: #ffffff;
    --qop-ink: #1c1433;
    --qop-text: #4b4566;
    --qop-muted: #7a7491;
    --qop-field: #f4f1fb;
    --qop-field-line: rgba(124, 58, 237, .12);
    --qop-line: rgba(28, 20, 51, .07);
    --qop-accent: #7c3aed;
    --qop-ring: rgba(139, 92, 246, .22);
    color-scheme: light;
}
html[data-app-theme="dark"] .qop-modal {
    --qop-surface: #1d1533;
    --qop-ink: #f1f0f7;
    --qop-text: #c9c5dc;
    --qop-muted: #9a95b3;
    --qop-field: #150f27;
    --qop-field-line: rgba(196, 181, 253, .12);
    --qop-line: rgba(255, 255, 255, .07);
    --qop-accent: #a78bfa;
    --qop-ring: rgba(167, 139, 250, .25);
    color-scheme: dark;
}

.qop-modal .modal-dialog { max-width: 480px; }
.qop-modal .modal-content {
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, .14);
    border-radius: 26px;
    color: var(--qop-text);
    background:
        radial-gradient(120% 60% at 0% 0%, rgba(167, 139, 250, .16), transparent 60%),
        var(--qop-surface);
    box-shadow: 0 30px 80px -24px rgba(76, 29, 149, .5), inset 0 1px 0 rgba(255, 255, 255, .7);
}
html[data-app-theme="dark"] .qop-modal .modal-content {
    border-color: rgba(196, 181, 253, .1);
    background:
        radial-gradient(120% 60% at 0% 0%, rgba(139, 92, 246, .24), transparent 62%),
        var(--qop-surface);
    box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .05);
}

/* header: icon tile · title + hint · round close */
.qop-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 6px; }
.qop-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(145deg, #8d52ff, #6c2cf3);
    box-shadow: inset 2px 2px 5px rgba(255, 255, 255, .3), 0 10px 20px -8px rgba(108, 44, 243, .65);
}
.qop-heading { flex: 1; min-width: 0; padding-top: 2px; }
.qop-title { margin: 0; color: var(--qop-ink); font-size: 1.12rem; font-weight: 700; letter-spacing: -.02em; }
.qop-heading p { margin: 3px 0 0; color: var(--qop-muted); font-size: .82rem; }
.qop-close {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--qop-muted);
    background: var(--qop-field);
    transition: color .15s ease, background .15s ease;
}
.qop-close:hover { color: var(--qop-ink); background: color-mix(in srgb, var(--qop-accent) 14%, var(--qop-field)); }

/* fields */
.qop-body { display: grid; gap: 16px; padding: 16px 22px 6px; }
.qop-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qop-field { min-width: 0; }
.qop-label { display: block; margin-bottom: 7px; color: var(--qop-ink); font-size: .8rem; font-weight: 600; }
.qop-input {
    display: block;
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--qop-field-line);
    border-radius: 14px;
    outline: 0;
    color: var(--qop-ink);
    background: var(--qop-field);
    font-size: .92rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.qop-input::placeholder { color: var(--qop-muted); }
.qop-input:focus { border-color: var(--qop-accent); box-shadow: 0 0 0 4px var(--qop-ring); }
#qop_title { font-weight: 600; }
.qop-select { position: relative; }
.qop-select select { padding-right: 40px; appearance: none; -webkit-appearance: none; cursor: pointer; }
.qop-select svg { position: absolute; top: 50%; right: 14px; color: var(--qop-muted); transform: translateY(-50%); pointer-events: none; }
.qop-input[type="date"] { font-variant-numeric: tabular-nums; }
.qop-input[type="date"]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }

/* footer */
.qop-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 22px 22px; }
.qop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    font-size: .88rem;
    font-weight: 600;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.qop-btn-ghost { color: var(--qop-text); background: var(--qop-field); }
.qop-btn-ghost:hover { color: var(--qop-ink); }
.qop-btn-primary {
    color: #fff;
    background: linear-gradient(160deg, #8b5cf6, #6d28d9);
    box-shadow: 0 10px 22px -10px rgba(124, 58, 237, .9);
}
.qop-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 26px -10px rgba(124, 58, 237, .95); }
.qop-btn-primary:disabled { opacity: .7; transform: none; }
.qop-btn:focus-visible, .qop-close:focus-visible { outline: 0; box-shadow: 0 0 0 4px var(--qop-ring); }

/* sidebar entry: reads as an action, not another operation */
html body:is(.has-menu, #_fx) #layout-menu .sb-create-op > .menu-link { color: var(--sb-accent-ink) !important; font-weight: 600; }

@media (max-width: 575.98px) {
    .qop-dates { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------
   Gear on an operation under Tasks (hover / keyboard focus) → list access
--------------------------------------------------------------------- */
html body:is(.has-menu, #_fx) #layout-menu .menu-sub > .menu-item:has(> :is(.sb-op-gear, .sb-svc-gear)) { position: relative; }
html body:is(.has-menu, #_fx) #layout-menu .menu-sub > .menu-item:has(> :is(.sb-op-gear, .sb-svc-gear)) > .menu-link { padding-right: 38px !important; }
/* the service ⚙ only takes room while it shows (hover / focus), so names aren't cut short; touch keeps it */
@media (hover: hover) {
    html body:is(.has-menu, #_fx) #layout-menu .menu-sub > .menu-item:has(> .sb-svc-gear):not(:hover, :focus-within) > .menu-link { padding-right: 8px !important; }
}
html body:is(.has-menu, #_fx) #layout-menu :is(.sb-op-gear, .sb-svc-gear) {
    position: absolute;
    top: 50%;
    right: 8px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: var(--sb-muted);
    background: transparent;
    opacity: 0;
    transform: translateY(-50%) scale(.9);
    transition: opacity .15s ease, transform .15s ease, color .15s ease, background .15s ease;
}
html body:is(.has-menu, #_fx) #layout-menu .menu-sub > .menu-item:hover > :is(.sb-op-gear, .sb-svc-gear),
html body:is(.has-menu, #_fx) #layout-menu :is(.sb-op-gear, .sb-svc-gear):focus-visible {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}
html body:is(.has-menu, #_fx) #layout-menu :is(.sb-op-gear, .sb-svc-gear):hover { color: var(--sb-accent-ink); background: rgba(139, 92, 246, .12); }
html body:is(.has-menu, #_fx) #layout-menu :is(.sb-op-gear, .sb-svc-gear):hover svg { transform: rotate(45deg); }
html body:is(.has-menu, #_fx) #layout-menu :is(.sb-op-gear, .sb-svc-gear) svg { transition: transform .25s ease; }
html body:is(.has-menu, #_fx) #layout-menu :is(.sb-op-gear, .sb-svc-gear):focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(139, 92, 246, .3); }
/* touch screens have no hover: keep it visible, dimmed */
@media (hover: none) {
    html body:is(.has-menu, #_fx) #layout-menu :is(.sb-op-gear, .sb-svc-gear) { opacity: .6; transform: translateY(-50%); }
}

/* ---------------------------------------------------------------------
   List access modal (shares the .qop-modal look)
--------------------------------------------------------------------- */
#list_access_modal .modal-dialog { max-width: 500px; }

.lac-all {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--qop-field-line);
    border-radius: 16px;
    background: var(--qop-field);
    cursor: pointer;
}
.lac-all-text { flex: 1; min-width: 0; }
.lac-all-text b { display: block; color: var(--qop-ink); font-size: .9rem; }
.lac-all-text small { color: var(--qop-muted); font-size: .76rem; }

.lac-switch {
    position: relative;
    flex: none;
    width: 42px;
    height: 24px;
    margin: 0;
    border-radius: 99px;
    background: color-mix(in srgb, var(--qop-muted) 35%, transparent);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: background .2s ease;
}
.lac-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .25);
    transition: transform .2s cubic-bezier(.22, .8, .25, 1);
}
.lac-switch:checked { background: linear-gradient(160deg, #8b5cf6, #6d28d9); }
.lac-switch:checked::after { transform: translateX(18px); }
.lac-switch:focus-visible { outline: 0; box-shadow: 0 0 0 4px var(--qop-ring); }

.lac-people { display: grid; gap: 10px; transition: opacity .2s ease; }
.lac-people.is-off { opacity: .45; pointer-events: none; }

.lac-search { position: relative; }
.lac-search svg { position: absolute; top: 50%; left: 14px; color: var(--qop-muted); transform: translateY(-50%); pointer-events: none; }
.lac-search .qop-input { height: 42px; padding-left: 40px; }

.lac-list {
    display: grid;
    gap: 4px;
    max-height: 280px;
    margin: 0 -6px;
    padding: 2px 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.lac-person {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 14px;
    cursor: pointer;
    transition: background .15s ease;
}
.lac-person[hidden] { display: none; }
.lac-person:hover { background: var(--qop-field); }
.lac-person input { position: absolute; opacity: 0; pointer-events: none; }
.lac-person img,
.lac-avatar {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    object-fit: cover;
}
.lac-avatar {
    display: grid;
    place-items: center;
    color: var(--qop-accent);
    background: rgba(139, 92, 246, .14);
    font-size: .75rem;
    font-weight: 700;
}
.lac-name { flex: 1; min-width: 0; }
.lac-name b,
.lac-name small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lac-name b { color: var(--qop-ink); font-size: .86rem; font-weight: 600; }
.lac-name small { color: var(--qop-muted); font-size: .74rem; }
.lac-check {
    display: grid;
    place-items: center;
    flex: none;
    width: 22px;
    height: 22px;
    border: 1.5px solid color-mix(in srgb, var(--qop-muted) 55%, transparent);
    border-radius: 7px;
    transition: background .15s ease, border-color .15s ease;
}
.lac-person input:checked ~ .lac-check {
    border-color: transparent;
    background: linear-gradient(160deg, #8b5cf6, #6d28d9) center / 100% no-repeat;
}
.lac-person input:checked ~ .lac-check::after {
    content: "";
    width: 10px;
    height: 6px;
    margin-top: -2px;
    border-bottom: 2px solid #fff;
    border-left: 2px solid #fff;
    transform: rotate(-45deg);
}
.lac-person input:focus-visible ~ .lac-check { box-shadow: 0 0 0 4px var(--qop-ring); }
.lac-person:has(input:checked) { background: color-mix(in srgb, var(--qop-accent) 8%, transparent); }

.lac-empty { margin: 0; padding: 18px 0; color: var(--qop-muted); font-size: .84rem; text-align: center; }
.lac-note { margin: 2px 2px 0; color: var(--qop-muted); font-size: .76rem; line-height: 1.45; }

#list_access_modal .qop-foot { align-items: center; }

/* "+ Add new member" row under the people list */
.lac-add {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 8px 10px;
    border: 1px dashed color-mix(in srgb, var(--qop-accent) 35%, transparent);
    border-radius: 14px;
    color: var(--qop-accent);
    background: transparent;
    font-size: .86rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.lac-add:hover { border-color: var(--qop-accent); background: color-mix(in srgb, var(--qop-accent) 8%, transparent); }
.lac-add:focus-visible { outline: 0; box-shadow: 0 0 0 4px var(--qop-ring); }
.lac-add-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: rgba(139, 92, 246, .14);
}

/* ---------------------------------------------------------------------
   Quick add member modal (stacked on top of the list access modal)
--------------------------------------------------------------------- */
/* core.css puts every .modal at 1090 and its backdrop at 1089: sit one layer above that */
.qam-modal { z-index: 1100; }
.modal-backdrop.qam-backdrop { z-index: 1095; }
.qam-modal .modal-dialog { max-width: 460px; }
.qam-modal .qop-body { gap: 14px; }

.qam-alert {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(220, 38, 38, .25);
    border-radius: 12px;
    color: #b91c1c;
    background: rgba(220, 38, 38, .08);
    font-size: .8rem;
    line-height: 1.45;
}
html[data-app-theme="dark"] .qam-alert { color: #fca5a5; background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .25); }

.qam-error:empty { display: none; }
.qam-error { display: block; margin-top: 6px; color: #dc2626; font-size: .76rem; }
html[data-app-theme="dark"] .qam-error { color: #fca5a5; }
.qam-modal .qop-input.is-invalid { border-color: #dc2626; box-shadow: 0 0 0 4px rgba(220, 38, 38, .14); }
.qam-hint { display: block; margin-top: 6px; color: var(--qop-muted); font-size: .74rem; line-height: 1.4; }

.qam-pass { display: flex; gap: 8px; }
.qam-pass .qop-input { flex: 1; min-width: 0; }
.qam-icon-btn {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    border: 1px solid var(--qop-field-line);
    border-radius: 14px;
    color: var(--qop-muted);
    background: var(--qop-field);
    font-size: 1.1rem;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.qam-icon-btn:hover { color: var(--qop-accent); border-color: color-mix(in srgb, var(--qop-accent) 40%, transparent); }
.qam-icon-btn:focus-visible { outline: 0; box-shadow: 0 0 0 4px var(--qop-ring); }

.qam-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qam-chip { position: relative; margin: 0; cursor: pointer; }
.qam-chip input { position: absolute; opacity: 0; pointer-events: none; }
.qam-chip span {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--qop-field-line);
    border-radius: 99px;
    color: var(--qop-text);
    background: var(--qop-field);
    font-size: .8rem;
    font-weight: 600;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.qam-chip:hover span { color: var(--qop-ink); }
.qam-chip input:checked + span { color: #fff; border-color: transparent; background: linear-gradient(160deg, #8b5cf6, #6d28d9); }
.qam-chip input:focus-visible + span { box-shadow: 0 0 0 4px var(--qop-ring); }
.qam-role-fixed {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 99px;
    color: var(--qop-accent);
    background: rgba(139, 92, 246, .12);
    font-size: .8rem;
    font-weight: 600;
}
.lac-count { margin-right: auto; color: var(--qop-muted); font-size: .8rem; font-weight: 600; }

/* ---------------------------------------------------------------------
   Add comment modal (task details → Discussions). Uses the .qop-modal look.
--------------------------------------------------------------------- */
.tc-modal .modal-dialog { max-width: 560px; }
.tc-modal .qop-icon i { font-size: 1.35rem; }
.tc-modal .qop-close i { font-size: 1.2rem; }
.tc-modal .qop-heading p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-modal .qop-btn i { font-size: 1.05rem; }

.tc-modal .tc-textarea {
    height: auto;
    min-height: 130px;
    padding: 12px 14px;
    line-height: 1.55;
    resize: vertical;
}
.tc-hint { display: flex; align-items: center; gap: 5px; margin: 7px 2px 0; color: var(--qop-muted); font-size: .75rem; }
.tc-hint i { font-size: .95rem; }

.tc-drop {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 12px 14px;
    border: 1.5px dashed var(--qop-field-line);
    border-radius: 14px;
    background: var(--qop-field);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.tc-drop:hover,
.tc-drop.is-over { border-color: var(--qop-accent); background: color-mix(in srgb, var(--qop-accent) 8%, var(--qop-field)); }
.tc-drop:focus-within { border-color: var(--qop-accent); box-shadow: 0 0 0 4px var(--qop-ring); }
.tc-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tc-drop-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: var(--qop-accent);
    background: rgba(139, 92, 246, .14);
    font-size: 1.2rem;
}
.tc-drop-text { display: grid; min-width: 0; }
.tc-drop-text b { color: var(--qop-ink); font-size: .86rem; font-weight: 600; }
.tc-drop-text small { color: var(--qop-muted); font-size: .76rem; }

.tc-files { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.tc-files[hidden] { display: none; }
.tc-files li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid var(--qop-field-line);
    border-radius: 12px;
    color: var(--qop-ink);
    font-size: .8rem;
}
.tc-files li i { color: var(--qop-accent); font-size: 1rem; }
.tc-files li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-files li small { color: var(--qop-muted); font-variant-numeric: tabular-nums; }

/* @mention list (Tribute) above the modal */
.tribute-container { z-index: 2000; }
/* dark-mode.css restyles every textarea; keep the modal field look */
html body .tc-modal textarea.tc-textarea { border-color: var(--qop-field-line) !important; color: var(--qop-ink) !important; background: var(--qop-field) !important; }
html body .tc-modal textarea.tc-textarea:focus { border-color: var(--qop-accent) !important; box-shadow: 0 0 0 4px var(--qop-ring) !important; }

/* the header (logo · company · workspace switcher) must sit above the menu list:
   both were z-index 1, so the menu, coming later, painted over the open workspace dropdown */
html body:is(.has-menu, #_fx) #layout-menu .menu-sidebar-header.sb-head { position: relative; z-index: 5 !important; }

/* ---------------------------------------------------------------------
   Departments under Tasks: colour dot, "+ New department"
--------------------------------------------------------------------- */
html body:is(.has-menu, #_fx) #layout-menu .sb-create-dept > .menu-link { color: var(--sb-accent-ink) !important; font-weight: 600; }
html body:is(.has-menu, #_fx) #layout-menu .sb-dept > .menu-link { gap: 8px; }
/* the dot replaces the submenu bullet */
html body:is(.has-menu, #_fx) #layout-menu .menu-sub > .sb-dept > .menu-link::before { display: none !important; }
html body:is(.has-menu, #_fx) #layout-menu .sb-dot {
    flex: none; width: 9px; height: 9px; border-radius: 3px; background: var(--dot);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot) 18%, transparent);
}
html body:is(.has-menu, #_fx) #layout-menu .sb-dept.active .sb-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot) 35%, transparent); }

/* department modal (shares the .qop-modal look) */
.dpt-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.dpt-swatch { position: relative; cursor: pointer; }
.dpt-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.dpt-swatch span {
    display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #fff;
    background: var(--sw); box-shadow: 0 6px 14px -8px var(--sw); transition: transform .15s ease, box-shadow .15s ease;
}
.dpt-swatch span svg { opacity: 0; transition: opacity .15s ease; }
.dpt-swatch input:checked + span { box-shadow: 0 0 0 3px var(--qop-field, #fff), 0 0 0 5px var(--sw); }
.dpt-swatch input:checked + span svg { opacity: 1; }
.dpt-swatch input:focus-visible + span { box-shadow: 0 0 0 3px var(--qop-field, #fff), 0 0 0 5px var(--qop-ring, rgba(139, 92, 246, .45)); }
.dpt-swatch:hover span { transform: translateY(-1px); }
#department_modal .qop-input.is-invalid { border-color: #dc2626; box-shadow: 0 0 0 4px rgba(220, 38, 38, .14); }
.dpt-confirm p { margin: 0; color: var(--qop-text); line-height: 1.5; }
.dpt-error-box { margin-top: 12px !important; padding: 10px 12px; border-radius: 12px; color: #b4232a !important; background: rgba(229, 72, 77, .1); font-size: .86rem; }
html[data-app-theme="dark"] .dpt-error-box { color: #ff9a9e !important; background: rgba(229, 72, 77, .16); }
.qop-btn-danger { color: #fff; background: linear-gradient(160deg, #ef5a5f, #c9353b) !important; box-shadow: 0 10px 22px -10px rgba(201, 53, 59, .85) !important; }
@media (prefers-reduced-motion: reduce) {
    .dpt-swatch span, .dpt-swatch span svg { transition: none; }
}

/* ---------------------------------------------------------------------
   Scrolling menu: only the items scroll; the header (workspace switcher)
   and the footer (search · collapse) stay put. Native scrolling: the menu
   script removes the vendor PerfectScrollbar, which never re-measured
   after a submenu opened. Smooth scrolling is asked for in JS only, so
   restoring the saved position on page load doesn't animate.
--------------------------------------------------------------------- */
html body:is(.has-menu, #_fx) #layout-menu {
    --sb-thumb: rgba(124, 58, 237, .16);
    --sb-thumb-hover: rgba(124, 58, 237, .38);
}
html[data-app-theme="dark"] body:is(.has-menu, #_fx) #layout-menu {
    --sb-thumb: rgba(196, 181, 253, .14);
    --sb-thumb-hover: rgba(196, 181, 253, .34);
}
html body:is(.has-menu, #_fx) #layout-menu > .menu-sidebar-header,
html body:is(.has-menu, #_fx) #layout-menu > .sb-foot { flex: none !important; }
html body:is(.has-menu, #_fx) #layout-menu > .menu-inner {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scroll-behavior: auto !important;
    scrollbar-width: thin;
    scrollbar-color: var(--sb-thumb) transparent;
}
html body:is(.has-menu, #_fx) #layout-menu > .menu-inner:hover { scrollbar-color: var(--sb-thumb-hover) transparent; }
/* browsers without scrollbar-color */
html body:is(.has-menu, #_fx) #layout-menu > .menu-inner::-webkit-scrollbar { width: 6px; }
html body:is(.has-menu, #_fx) #layout-menu > .menu-inner::-webkit-scrollbar-track { background: transparent; }
html body:is(.has-menu, #_fx) #layout-menu > .menu-inner::-webkit-scrollbar-thumb { background: var(--sb-thumb); border-radius: 6px; }
html body:is(.has-menu, #_fx) #layout-menu > .menu-inner:hover::-webkit-scrollbar-thumb { background: var(--sb-thumb-hover); }
/* leftovers of the vendor scrollbar, in case it attached before the script ran */
html body:is(.has-menu, #_fx) #layout-menu > .menu-inner > .ps__rail-x,
html body:is(.has-menu, #_fx) #layout-menu > .menu-inner > .ps__rail-y { display: none !important; }
/* the collapsed rail is icon-wide: scroll it, but don't let a scrollbar shift the icons */
@media (min-width: 1200px) {
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu > .menu-inner { scrollbar-width: none; }
    html.layout-menu-collapsed:not(.taskify-menu-hover) body:is(.has-menu, #_fx) #layout-menu > .menu-inner::-webkit-scrollbar { width: 0; }
}

/* ---------------------------------------------------------------------
   Quick operation modal: required marks, inline errors, brand mode
   (opened from a brand's profile with extra fields; components/menu.blade.php)
--------------------------------------------------------------------- */
.qop-req { color: #e5484d; }
.qop-input.is-invalid { border-color: #e5484d !important; box-shadow: 0 0 0 4px rgba(229, 72, 77, .15) !important; }
.qop-help { display: block; margin-top: 6px; color: var(--qop-muted); font-size: .74rem; }
.qop-modal:not([data-mode="brand"]) .qop-brand-only { display: none !important; }
.qop-modal[data-mode="brand"] .modal-dialog { max-width: 560px; }
.qop-modal .qop-body > .qam-error { margin-top: -6px; }

/* the brand: shown, not editable */
.qop-locked {
    display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 14px 6px 6px;
    border: 1px dashed var(--qop-field-line); border-radius: 14px; color: var(--qop-ink); background: var(--qop-field);
}
.qop-locked-logo {
    flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; object-fit: cover;
    color: #fff; background: linear-gradient(150deg, #a78bfa, #6d28d9); font-size: .8rem; font-weight: 800;
}
.qop-locked-name { flex: 1; min-width: 0; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.qop-locked .bx-lock-alt { color: var(--qop-muted); font-size: 1.05rem; }

/* select2 (tags, members) in the qop look */
.qop-modal .select2-container--default .select2-selection--multiple {
    min-height: 46px; padding: 4px 8px; border: 1px solid var(--qop-field-line); border-radius: 14px; background: var(--qop-field);
}
.qop-modal .select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--qop-accent); box-shadow: 0 0 0 4px var(--qop-ring);
}
.qop-modal .select2-container--default .select2-selection--multiple .select2-selection__choice {
    margin-top: 4px; border: 0; border-radius: 8px; color: var(--qop-ink); background: color-mix(in srgb, var(--qop-accent) 16%, transparent);
}
.qop-modal .select2-container--default .select2-search--inline .select2-search__field { margin-top: 6px; color: var(--qop-ink); }
.qop-modal .select2-dropdown { border-color: var(--qop-field-line); border-radius: 12px; overflow: hidden; background: var(--qop-surface); color: var(--qop-text); }
.qop-modal .select2-results__option--highlighted[aria-selected] { color: #fff; background: var(--qop-accent); }

/* service boards (Services group): the service's icon instead of the bullet */
html body:is(.has-menu, #_fx) #layout-menu .sb-emoji { flex: none; width: 18px; text-align: center; font-size: .95rem; line-height: 1; }
html body:is(.has-menu, #_fx) #layout-menu .menu-sub > li:has(.sb-emoji) > .menu-link::before { display: none !important; }

/* Services group: "+ New service" (last item; opens the service editor) */
html body:is(.has-menu, #_fx) #layout-menu .sb-svc-new > .menu-link { color: var(--sb-accent-ink); }
html body:is(.has-menu, #_fx) #layout-menu .sb-svc-new .sb-plus { font-weight: 700; }
