/* =========================================================
   SYSTEM MENU — Enterprise Navigation
   ========================================================= */

.system-menu-search {
    width: 100% !important;
    margin-bottom: 0.75rem;
    box-sizing: border-box;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.system-menu-grid {
    gap: 0.5rem;
}

/* Menu Item Base */
.system-menu-item {
    text-decoration: none;
    color: var(--body-color);
    transition: all 0.2s ease;
    cursor: pointer;
    border-radius: 0.5rem;
    gap: 0.875rem;
    max-width: 100%;
    box-sizing: border-box;
}

.system-menu-item:hover {
    border-color: var(--color-theme);
    box-shadow: var(--box-shadow-light);
    transform: translateX(2px);
}

.system-menu-item:active {
    transform: translateX(2px) scale(0.995);
}

/* Icon Container */
.system-menu-item-icon {
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    flex-shrink: 0; /* Ensures the icon never squishes */
    border-radius: 0.4rem;
    transition: all 0.2s ease;
}

.system-menu-item:hover .system-menu-item-icon {
    background-color: var(--color-theme);
    color: white;
    transform: scale(1.05);
}

/* Content Area */
.system-menu-item-content {
    flex: 1;
    min-width: 0; /* Crucial flexbox property to allow text constraints */
    gap: 0.1rem;
}

.system-menu-item-name {
    text-transform: capitalize;
    display: block;
    width: 100%;
    margin-bottom: 0;
    
    /* Let the name wrap nicely over multiple lines */
    white-space: normal; 
    word-break: break-word; /* Prevents a single massive word from breaking the box */
    line-height: 1.2;       /* Keeps multi-line text looking tight and clean */
}

.system-menu-item-hint {
    font-size: 0.78rem;
    display: block;
    width: 100%; 
    
    /* Keep the hint truncated to 1 line so the item doesn't get too tall */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Arrow */
.system-menu-item-arrow {
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    margin-inline-start: auto;
    flex-shrink: 0; /* Ensures the arrow never gets squished */
}

.system-menu-item:hover .system-menu-item-arrow {
    color: var(--color-theme);
    transform: translateX(3px);
}

/* RTL Support */
[dir="rtl"] .system-menu-item:hover {
    transform: translateX(-2px);
}

[dir="rtl"] .system-menu-item:hover .system-menu-item-arrow {
    transform: translateX(-3px);
}

[dir="rtl"] .system-menu-item-arrow svg {
    transform: rotate(180deg);
}

/* Staggered fade-in Animation */
@keyframes menuItemFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.system-menu-item {
    animation: menuItemFadeIn 0.2s ease forwards;
    opacity: 0; /* Starts hidden to avoid blink before delay */
}

.system-menu-item:nth-child(1) { animation-delay: 0.02s; }
.system-menu-item:nth-child(2) { animation-delay: 0.04s; }
.system-menu-item:nth-child(3) { animation-delay: 0.06s; }
.system-menu-item:nth-child(4) { animation-delay: 0.08s; }
.system-menu-item:nth-child(5) { animation-delay: 0.10s; }
.system-menu-item:nth-child(6) { animation-delay: 0.12s; }
.system-menu-item:nth-child(7) { animation-delay: 0.14s; }
.system-menu-item:nth-child(8) { animation-delay: 0.16s; }
.system-menu-item:nth-child(9) { animation-delay: 0.18s; }
.system-menu-item:nth-child(10) { animation-delay: 0.20s; }