
/* =========================================
   SYNEX ADMIN SIDEBAR
   Filament 5
========================================= */

:root {
    --synex-black: #0D0D0D;
    --synex-yellow: #FFD60A;
    --synex-yellow-hover: #F5CB00;
    --synex-muted: #9CA3AF;
    --synex-sidebar-hover: #252525;
    --synex-sidebar-active-group: #222327;
    --synex-sidebar-border: #2D2D2D;
}

/* =========================================
   SIDEBAR SHELL
========================================= */

.fi-sidebar {
    background: var(--synex-black) !important;
    color: #FFFFFF !important;
    border-right: 1px solid var(--synex-sidebar-border) !important;
}

.fi-sidebar-header-ctn,
.fi-sidebar-header,
.fi-sidebar-nav,
.fi-sidebar-footer {
    background: var(--synex-black) !important;
}

.fi-sidebar-header {
    border-bottom: 1px solid var(--synex-sidebar-border);
    box-shadow: none !important;
    min-height: 76px;
}

.fi-sidebar-header-logo-ctn {
    display: flex;
    align-items: center;
    min-width: 0;
}

.fi-sidebar .fi-logo {
    max-width: 170px;
    height: auto;
    background: transparent !important;
    padding: 0 !important;
}

/* =========================================
   DESKTOP SIDEBAR POSITION
   SYNEX SPLIT LAYOUT
========================================= */

@media (min-width: 1024px) {

    /*
     * Filament 5 keeps its desktop sidebar
     * in the normal sticky layout flow.
     *
     * top: 0 alone does not remove the
     * space occupied by the topbar above it.
     *
     * Pull the sidebar upward by the
     * existing SYNEX topbar height, while
     * preserving its place in the flex layout.
     */

    .fi-body-has-topbar .fi-sidebar {
        top: 0 !important;
        inset-block-start: 0 !important;

        margin-block-start: calc(
            -1 * var(--sx-header-height, 4rem)
        ) !important;

        height: 100dvh !important;
        max-height: 100dvh !important;

        align-self: flex-start;
        z-index: 45 !important;
    }

    /*
     * Keep the SYNEX logo visible inside
     * the native Filament sidebar header.
     */

    .fi-body-has-topbar .fi-sidebar-header {
        display: flex !important;
        align-items: center;
    }

    .fi-body-has-topbar .fi-sidebar-header-ctn {
        display: flex !important;
        align-items: center;
    }
}

/* =========================================
   NAVIGATION SPACING
========================================= */

.fi-sidebar-nav {
    padding: 14px 10px 18px !important;
}

.fi-sidebar-nav-groups {
    gap: 6px !important;
}

.fi-sidebar-group {
    margin: 0 !important;
}

.fi-sidebar-group-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px !important;
    border-radius: 12px;
    cursor: pointer;
    transition:
        background-color 160ms ease,
        color 160ms ease;
}

.fi-sidebar-group-btn:hover {
    background: var(--synex-sidebar-hover) !important;
}

.fi-sidebar-group.fi-active > .fi-sidebar-group-btn {
    background: var(--synex-sidebar-active-group) !important;
}

/* =========================================
   GROUP LABELS
========================================= */

.fi-sidebar-group-label {
    color: #E5E5E5 !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em;
}

.fi-sidebar-group.fi-active > .fi-sidebar-group-btn
.fi-sidebar-group-label {
    color: var(--synex-yellow) !important;
}

.fi-sidebar-group-btn > svg {
    color: #C4C8D0 !important;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.fi-sidebar-group.fi-active > .fi-sidebar-group-btn > svg {
    color: var(--synex-yellow) !important;
}

/* Collapse arrows */

.fi-sidebar-group-collapse-btn {
    margin-left: auto;
    color: #C4C8D0 !important;
}

.fi-sidebar-group-collapse-btn:hover {
    color: #FFFFFF !important;
}

/* =========================================
   DASHBOARD & MENU ITEMS
   Filament 5 uses .fi-active
========================================= */

.fi-sidebar-item-btn {
    min-height: 40px;
    border-radius: 11px !important;
    padding: 9px 12px !important;
    transition:
        background-color 160ms ease,
        color 160ms ease;
}

.fi-sidebar-item:not(.fi-active) > .fi-sidebar-item-btn {
    background: transparent !important;
    color: #E4E4E7 !important;
}

.fi-sidebar-item:not(.fi-active) > .fi-sidebar-item-btn:hover {
    background: var(--synex-sidebar-hover) !important;
}

.fi-sidebar-item:not(.fi-active)
.fi-sidebar-item-label,
.fi-sidebar-item:not(.fi-active)
.fi-sidebar-item-icon {
    color: #D4D4D8 !important;
}

.fi-sidebar-item:not(.fi-active)
.fi-sidebar-item-btn:hover
.fi-sidebar-item-label,
.fi-sidebar-item:not(.fi-active)
.fi-sidebar-item-btn:hover
.fi-sidebar-item-icon {
    color: #FFFFFF !important;
}

/* Active item */

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: var(--synex-yellow) !important;
    color: var(--synex-black) !important;
    box-shadow: none !important;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn
.fi-sidebar-item-label,
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn
.fi-sidebar-item-icon {
    color: var(--synex-black) !important;
    font-weight: 700 !important;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn:hover {
    background: var(--synex-yellow-hover) !important;
}

.fi-sidebar-item-label {
    font-size: 12.5px !important;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: -0.01em;
}

/* =========================================
   CHILD NAVIGATION & CONNECTORS
========================================= */

.fi-sidebar-group-items {
    margin-top: 3px;
}

.fi-sidebar-group-items
.fi-sidebar-item-btn {
    padding-top: 9px !important;
    padding-bottom: 9px !important;
}

.fi-sidebar-item-grouped-border {
    color: #7F8794 !important;
}

.fi-sidebar-item-grouped-border-part,
.fi-sidebar-item-grouped-border-part-not-first,
.fi-sidebar-item-grouped-border-part-not-last {
    border-color: #657083 !important;
}

.fi-sidebar-item-grouped-border-part {
    background-color: #A1A8B4;
}

.fi-sidebar-item.fi-active
.fi-sidebar-item-grouped-border-part {
    background-color: #B8860B;
}

/* =========================================
   SIDEBAR SCROLLBAR
========================================= */

.fi-sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.fi-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.fi-sidebar-nav::-webkit-scrollbar-thumb {
    background: #343434;
    border-radius: 10px;
}

/* =========================================
   USER FOOTER
========================================= */

.synex-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px;
    padding: 12px;
    min-height: 72px;
    border: 1px solid #333333;
    border-radius: 14px;
    background: #1A1A1C;
}

.synex-sidebar-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    background: #F5F5F7;
    color: #111111;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 800;
}

.synex-sidebar-user-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    flex: 1;
    gap: 3px;
}

.synex-sidebar-user-name {
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.synex-sidebar-user-role {
    color: #A1A1AA;
    font-size: 10px;
    font-weight: 500;
}

.synex-sidebar-logout-form {
    flex-shrink: 0;
}

.synex-sidebar-logout {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #C4C4CC;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition:
        background-color 150ms ease,
        color 150ms ease;
}

.synex-sidebar-logout:hover {
    color: var(--synex-yellow);
    background: #2B2B2B;
}

/* =========================================
   PLACEHOLDER PAGE
========================================= */

.synex-module-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 16px;
    min-height: 330px;
    padding: 36px 24px;
    background: #FFFFFF;
    border: 1px solid #F0F0F2;
    border-radius: 20px;
    box-shadow: 0 1px 8px rgba(0,0,0,.04);
}

.synex-module-placeholder-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: #FFFBE6;
    color: #B8860B;
}

.synex-module-placeholder-title {
    margin: 0;
    color: #0D0D0D;
    font-size: 24px;
    font-weight: 750;
}

.synex-module-placeholder-description {
    color: #8A8F9B;
    max-width: 450px;
    font-size: 14px;
    line-height: 1.7;
}

.synex-module-placeholder-badge {
    padding: 7px 12px;
    color: #92681A;
    background: #FFFBE6;
    border: 1px solid #F5E9B8;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1023px) {
    .fi-sidebar {
        height: 100dvh !important;
    }

    .fi-sidebar-header {
        min-height: 64px;
    }

    .fi-sidebar-nav {
        padding: 12px 8px !important;
    }
}

/* =========================================
   FOCUS & ACCESSIBILITY
========================================= */

.fi-sidebar a:focus-visible,
.fi-sidebar button:focus-visible {
    outline: 2px solid var(--synex-yellow) !important;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .fi-sidebar-item-btn,
    .fi-sidebar-group-btn,
    .synex-sidebar-logout {
        transition: none !important;
    }
}
