.stella-shell {
    min-height: 100vh;
    background: #eef2f6;
    color: #1f2d3d;
}

.stella-side-panel {
    position: fixed;
    inset: 0 auto 0 0;
    width: 220px;
    height: 100vh;
    z-index: 2000;
    background: #ffffff;
    color: #1f2d3d;
    padding: 1rem 0.75rem;
    border-right: 1px solid #d9e1ea;
    box-shadow: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.stella-content {
    margin-left: 220px;
    width: calc(100% - 220px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stella-top-panel {
    min-height: 60px;
    background: #f2f2f2;
    color: black;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid #d9e1ea;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.stella-page-title {
    flex: 1;
}

.stella-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    color: #6a5acd;
    transition: background 0.15s;
}

.stella-filter-btn:hover {
    background: rgba(106,90,205,0.1);
}

.stella-brand-block {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    margin-left: auto;
}

.stella-brand-logo {
    width: 120px;
    height: 52px;
    margin-left: 24px;
    overflow: hidden;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stella-brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.stella-empresa-usuario {
    margin-left: auto;
    color: black;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2rem;
}

.stella-versao {
    color: darkgray;
    height: 20px;
    font-weight: bold;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
}

.stella-brand-title {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.stella-brand-subtitle {
    font-size: 0.8rem;
    color: black;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.stella-top-panel-info {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    border-bottom: 1px solid #d9e1ea;
}

.stella-side-header {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.75;
    padding: 0.25rem 0.5rem 0.75rem;
    color: #1f2d3d;
}

.stella-side-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stella-menu-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    width: 100%;
    min-height: 42px;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: #1f2d3d;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.stella-menu-item:hover,
.stella-menu-item.active {
    background: #dfe6ee;
    border-color: #cfd8e3;
    color: #1f2d3d;
}

.stella-menu-button {
    cursor: pointer;
}

.stella-main-panel {
    flex: 1;
    min-width: 0;
    padding: 0;
    overflow: auto;
    background: #f2f2f2;
    display: flex;
}

.stella-home-panel {
    width: 100%;
    height: 100%;
    background: #f2f2f2;
    color: #1f2d3d;
    min-height: calc(100vh - 110px);
}

.stella-user-menu-wrapper {
    position: relative;
}

.stella-user-trigger {
    cursor: pointer;
    user-select: none;
}

.stella-user-trigger:hover .stella-brand-subtitle,
.stella-user-trigger:hover .mud-icon-root {
    opacity: 0.75;
}

.stella-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.stella-user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    z-index: 1001;
    min-width: 190px;
    padding: 4px 0;
    animation: stella-dropdown-in 0.12s ease;
}

@keyframes stella-dropdown-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.stella-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: #333;
    text-align: left;
    white-space: nowrap;
    transition: background 0.1s;
}

.stella-dropdown-item:hover {
    background: #f5f5f5;
}

/* ── Submenu flyout ─────────────────────────────────────────── */

.stella-submenu-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;
}

.stella-submenu-flyout {
    position: fixed;
    top: 0;
    left: 220px;
    height: 100vh;
    width: 280px;
    z-index: 1501;
    background: #ffffff;
    border-right: 1px solid #d9e1ea;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.08);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    outline: none;
    animation: stella-flyout-in 0.15s ease;
}

@keyframes stella-flyout-in {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.stella-submenu-card {
    border: 1.5px solid #3eb8c8;
    border-radius: 8px;
    overflow: hidden;
}

.stella-submenu-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1f2d3d;
    border-bottom: 1.5px solid #3eb8c8;
}

.stella-submenu-card-icon {
    font-size: 1.1rem !important;
    color: #3eb8c8;
}

.stella-submenu-item {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 9px 14px;
    text-decoration: none;
    color: #1f2d3d;
    font-size: 0.85rem;
    font-weight: 500;
    border-top: 1px solid #eef2f6;
    transition: background 0.12s;
    cursor: pointer;
}

.stella-submenu-item:first-of-type {
    border-top: none;
}

.stella-submenu-item:hover,
.stella-submenu-item.active {
    background: #eef7f9;
    color: #1f2d3d;
}

.stella-submenu-drag-icon {
    font-size: 0.9rem !important;
    color: #aab4be;
    flex-shrink: 0;
}

/* ── end submenu flyout ─────────────────────────────────────── */

@media (max-width: 900px) {
    .stella-side-panel {
        position: static;
        width: 100%;
        height: auto;
        z-index: auto;
    }

    .stella-content {
        margin-left: 0;
        width: 100%;
    }

    .stella-top-panel {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem 1.25rem;
        position: static;
    }

    .stella-top-panel-info {
        text-align: left;
    }
}
