@keyframes shellFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shellSlideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.shell-layout {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.shell-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-secondary) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    z-index: 50;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

[data-theme="dark"] .shell-sidebar {
    background: linear-gradient(180deg, rgba(30, 32, 48, 0.95) 0%, rgba(22, 24, 38, 0.98) 100%);
}

[data-theme="light"] .shell-sidebar {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(245, 247, 250, 0.98) 100%);
    box-shadow: 2px 0 24px rgba(0, 0, 0, 0.04);
}

.shell-sidebar-header {
    height: 64px;
    min-height: 64px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
    overflow: visible;
}

.shell-sidebar-header .shell-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
    object-fit: contain;
}

.shell-sidebar-header .shell-brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
    transition: opacity 0.2s ease;
}

.shell-sidebar-header .shell-brand-badge {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--gold-bg);
    color: var(--gold);
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.shell-sidebar-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
    transition: all 0.2s ease;
    padding: 0;
}

.shell-sidebar-toggle:hover {
    background: var(--accent-light);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.shell-sidebar-toggle:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.shell-sidebar-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.25s ease;
}

body.sidebar-collapsed .shell-sidebar-toggle svg {
    transform: rotate(180deg);
}

.shell-sidebar-search {
    padding: 12px 16px;
    flex-shrink: 0;
}

.shell-sidebar-search input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.82rem;
    transition: all 0.2s ease;
    outline: none;
}

.shell-sidebar-search input::placeholder {
    color: var(--text-dim);
}

.shell-sidebar-search input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.shell-sidebar-search .search-icon {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-dim);
    pointer-events: none;
}

.shell-sidebar-search {
    position: relative;
}

.shell-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.shell-sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

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

.shell-sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.shell-sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

.shell-favorites {
    padding: 4px 12px 8px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 4px;
}

.shell-favorites .shell-favorites-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    padding: 8px 8px 4px;
}

.shell-nav-category {
    padding: 2px 12px;
    margin-bottom: 2px;
}

.shell-nav-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 10px;
    cursor: pointer;
    border-radius: 8px;
    user-select: none;
    transition: background 0.15s ease;
}

.shell-nav-category-header:hover {
    background: var(--accent-light);
}

.shell-nav-category-header .category-label {
    font-size: 0.76rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s ease;
}

.shell-nav-category-header .category-icon svg {
    transition: color 0.15s ease;
}

.shell-nav-subgroup {
    margin-top: 2px;
    margin-bottom: 6px;
}

.shell-nav-subgroup-label {
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    padding: 10px 12px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.shell-nav-subgroup-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

body.sidebar-collapsed .shell-nav-subgroup-label {
    display: none;
}

.shell-nav-category-header .category-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-dim);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.shell-nav-category.collapsed .category-chevron {
    transform: rotate(-90deg);
}

html[dir="rtl"] .shell-nav-category.collapsed .category-chevron,
body.rtl .shell-nav-category.collapsed .category-chevron {
    transform: rotate(90deg);
}

.shell-nav-category .shell-nav-category-items {
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.2s ease;
    max-height: 2000px;
    opacity: 1;
}

.shell-nav-category.collapsed .shell-nav-category-items {
    max-height: 0;
    opacity: 0;
}

.shell-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    margin: 1px 0;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 450;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
}

html[dir="rtl"] .shell-nav-item,
body.rtl .shell-nav-item {
    border-left: none;
    border-right: 3px solid transparent;
}

.shell-nav-item:hover {
    background: var(--accent-light);
    color: var(--text-primary);
}

.shell-nav-item:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
}

.shell-nav-item.active {
    background: var(--accent-light);
    color: var(--accent-primary);
    font-weight: 550;
    border-left-color: var(--accent-primary);
}

html[dir="rtl"] .shell-nav-item.active,
body.rtl .shell-nav-item.active {
    border-left-color: transparent;
    border-right-color: var(--accent-primary);
}

.shell-nav-item .nav-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.shell-nav-item .nav-icon svg {
    width: 20px;
    height: 20px;
}

.shell-nav-item:hover .nav-icon,
.shell-nav-item.active .nav-icon {
    opacity: 1;
}

.shell-nav-item .nav-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s ease;
}

.shell-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 600;
    background: var(--accent-primary);
    color: #fff;
    flex-shrink: 0;
    line-height: 1;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.shell-nav-badge.badge-warning {
    background: var(--accent-yellow);
}

.shell-nav-badge.badge-danger {
    background: var(--accent-red);
}

.shell-nav-badge.badge-success {
    background: var(--accent-green);
}

.shell-sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--border-light);
    padding: 8px 12px;
}

.shell-user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    overflow: hidden;
}

.shell-user-menu:hover {
    background: var(--accent-light);
}

.shell-user-menu .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-light);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 600;
    flex-shrink: 0;
}

.shell-user-menu .user-info {
    flex: 1;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.shell-user-menu .user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shell-user-menu .user-role {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shell-sidebar-footer .footer-actions {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.shell-sidebar-footer .footer-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
}

.shell-sidebar-footer .footer-action-btn:hover {
    background: var(--accent-light);
    color: var(--accent-primary);
}

.shell-sidebar-footer .footer-action-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
}

.shell-sidebar-footer .footer-action-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.shell-sidebar-footer .footer-action-btn .btn-label {
    transition: opacity 0.2s ease;
}

body.sidebar-collapsed .shell-sidebar {
    width: 64px;
}

body.sidebar-collapsed .shell-sidebar-header {
    padding: 0 8px;
    justify-content: center;
    gap: 0;
}

body.sidebar-collapsed .shell-sidebar-header .shell-logo {
    display: none;
}

body.sidebar-collapsed .shell-sidebar-header .shell-brand-name,
body.sidebar-collapsed .shell-sidebar-header .shell-brand-badge {
    display: none;
}

body.sidebar-collapsed .shell-sidebar-toggle {
    margin-left: 0;
}

body.sidebar-collapsed .shell-sidebar-search {
    padding: 12px 8px;
}

body.sidebar-collapsed .shell-sidebar-search input {
    padding-left: 8px;
    text-indent: -9999px;
}

body.sidebar-collapsed .shell-sidebar-search .search-icon {
    left: 50%;
    transform: translate(-50%, -50%);
}

body.sidebar-collapsed .shell-nav-category-header .category-label {
    opacity: 0;
    width: 0;
    pointer-events: none;
}

body.sidebar-collapsed .shell-nav-category-header .category-chevron {
    opacity: 0;
    width: 0;
    pointer-events: none;
}

body.sidebar-collapsed .shell-nav-category-header .category-count {
    display: none;
}

body.sidebar-collapsed .shell-nav-item {
    position: relative;
    justify-content: center;
    padding: 10px;
    border-left-color: transparent;
    gap: 0;
}

body.sidebar-collapsed .shell-nav-item:hover::after {
    content: attr(aria-label);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    padding: 4px 10px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    pointer-events: none;
}

html[dir="rtl"] body.sidebar-collapsed .shell-nav-item:hover::after,
body.rtl.sidebar-collapsed .shell-nav-item:hover::after {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 8px;
}

html[dir="rtl"] body.sidebar-collapsed .shell-nav-item,
body.rtl.sidebar-collapsed .shell-nav-item {
    border-right-color: transparent;
}

body.sidebar-collapsed .shell-nav-item.active {
    border-left-color: transparent;
}

html[dir="rtl"] body.sidebar-collapsed .shell-nav-item.active,
body.rtl.sidebar-collapsed .shell-nav-item.active {
    border-right-color: transparent;
}

body.sidebar-collapsed .shell-nav-item .nav-icon {
    width: 20px;
    height: 20px;
}

body.sidebar-collapsed .shell-nav-item .nav-icon svg {
    width: 20px;
    height: 20px;
}

body.sidebar-collapsed .shell-nav-item .nav-label {
    display: none;
}

body.sidebar-collapsed .shell-nav-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    font-size: 0.6rem;
    padding: 0 4px;
}

html[dir="rtl"] body.sidebar-collapsed .shell-nav-badge,
body.rtl.sidebar-collapsed .shell-nav-badge {
    right: auto;
    left: 4px;
}

body.sidebar-collapsed .shell-user-menu .user-info {
    display: none;
}

body.sidebar-collapsed .shell-sidebar-footer .footer-action-btn .btn-label {
    display: none;
}

body.sidebar-collapsed .shell-favorites .shell-favorites-label {
    opacity: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
}

body.sidebar-collapsed .shell-content {
    margin-left: 64px;
}

html[dir="rtl"] body.sidebar-collapsed .shell-content,
body.rtl.sidebar-collapsed .shell-content {
    margin-left: 0;
    margin-right: 64px;
}

.shell-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    animation: shellFadeIn 0.3s ease;
}

html[dir="rtl"] .shell-content,
body.rtl .shell-content {
    margin-left: 0;
    margin-right: 280px;
    transition: margin-right 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html[dir="rtl"] .shell-sidebar,
body.rtl .shell-sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border);
}

.shell-topbar {
    height: 56px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-shrink: 0;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 30;
}

[data-theme="light"] .shell-topbar {
    background: rgba(255, 255, 255, 0.92);
}

[data-theme="dark"] .shell-topbar {
    background: rgba(22, 24, 38, 0.88);
}

.shell-topbar .topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.shell-topbar .topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
}

.shell-topbar .topbar-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.shell-topbar .topbar-breadcrumb a:hover {
    color: var(--accent-primary);
}

.shell-topbar .topbar-breadcrumb .breadcrumb-sep {
    color: var(--text-dim);
    font-size: 0.72rem;
}

.shell-topbar .topbar-breadcrumb .breadcrumb-current {
    color: var(--text-primary);
    font-weight: 550;
}

.shell-topbar .topbar-title {
    font-size: 1rem;
    font-weight: 650;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shell-topbar .topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.shell-topbar .topbar-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.shell-topbar .topbar-action-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-light);
}

.shell-topbar .topbar-action-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.shell-topbar .topbar-action-btn.primary {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

.shell-topbar .topbar-action-btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.shell-topbar .topbar-action-btn svg {
    width: 16px;
    height: 16px;
}

.shell-frame {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.shell-frame iframe {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-primary);
}

.shell-frame .frame-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    z-index: 5;
    transition: opacity 0.3s ease;
}

.shell-frame .frame-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.shell-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.shell-help-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 60;
    transition: all 0.2s ease;
}

html[dir="rtl"] .shell-help-btn,
body.rtl .shell-help-btn {
    right: auto;
    left: 24px;
}

.shell-help-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.08);
}

.shell-help-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 4px;
}

.shell-help-btn svg {
    width: 22px;
    height: 22px;
}

.shell-help-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: 100vw;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 70;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html[dir="rtl"] .shell-help-drawer,
body.rtl .shell-help-drawer {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
}

.shell-help-drawer.open {
    transform: translateX(0);
}

.shell-help-drawer .help-drawer-header {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.shell-help-drawer .help-drawer-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.shell-help-drawer .help-drawer-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.shell-help-drawer .help-drawer-close:hover {
    background: var(--accent-light);
    color: var(--accent-primary);
}

.shell-help-drawer .help-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

@media (min-width: 1025px) {
    .shell-sidebar .mobile-close-btn {
        display: none;
    }
}

@media (max-width: 1024px) {
    .shell-sidebar {
        width: 64px;
    }

    .shell-content {
        margin-left: 64px;
    }

    html[dir="rtl"] .shell-content,
    body.rtl .shell-content {
        margin-left: 0;
        margin-right: 64px;
    }

    .shell-sidebar-header .shell-brand-name,
    .shell-sidebar-header .shell-brand-badge {
        opacity: 0;
        pointer-events: none;
    }

    .shell-sidebar-search input {
        padding-left: 8px;
        text-indent: -9999px;
    }

    .shell-sidebar-search .search-icon {
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .shell-nav-category-header .category-label,
    .shell-nav-category-header .category-chevron {
        opacity: 0;
        width: 0;
        pointer-events: none;
    }

    .shell-nav-item {
        justify-content: center;
        padding: 10px;
        border-left-color: transparent;
        gap: 0;
    }

    html[dir="rtl"] .shell-nav-item,
    body.rtl .shell-nav-item {
        border-right-color: transparent;
    }

    .shell-nav-item .nav-label {
        display: none;
    }

    .shell-nav-item .nav-icon {
        width: 20px;
        height: 20px;
    }

    .shell-nav-badge {
        position: absolute;
        top: 4px;
        right: 4px;
        min-width: 16px;
        height: 16px;
        font-size: 0.6rem;
        padding: 0 4px;
    }

    html[dir="rtl"] .shell-nav-badge,
    body.rtl .shell-nav-badge {
        right: auto;
        left: 4px;
    }

    .shell-user-menu .user-info {
        display: none;
    }

    .shell-sidebar-footer .footer-action-btn .btn-label {
        display: none;
    }

    .shell-favorites .shell-favorites-label {
        opacity: 0;
        height: 0;
        padding: 0;
        overflow: hidden;
    }

    .shell-topbar {
        padding: 0 16px;
    }
}

@media (max-width: 768px) {
    .shell-sidebar {
        width: 280px;
        transform: translateX(-100%);
        box-shadow: none;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    html[dir="rtl"] .shell-sidebar,
    body.rtl .shell-sidebar {
        transform: translateX(100%);
    }

    .shell-sidebar-header .shell-brand-name,
    .shell-sidebar-header .shell-brand-badge {
        opacity: 1;
        pointer-events: auto;
    }

    .shell-sidebar-search input {
        padding-left: 36px;
        text-indent: 0;
    }

    .shell-sidebar-search .search-icon {
        left: 28px;
        transform: translateY(-50%);
    }

    .shell-nav-category-header .category-label,
    .shell-nav-category-header .category-chevron {
        opacity: 1;
        width: auto;
        pointer-events: auto;
    }

    .shell-nav-item {
        justify-content: flex-start;
        padding: 8px 12px;
        gap: 12px;
    }

    .shell-nav-item .nav-label {
        display: block;
    }

    .shell-nav-item .nav-icon {
        width: 24px;
        height: 24px;
    }

    .shell-nav-badge {
        position: static;
        min-width: 20px;
        height: 20px;
        font-size: 0.68rem;
        padding: 0 6px;
    }

    .shell-user-menu .user-info {
        display: block;
    }

    .shell-sidebar-footer .footer-action-btn .btn-label {
        display: inline;
    }

    .shell-favorites .shell-favorites-label {
        opacity: 1;
        height: auto;
        padding: 8px 8px 4px;
    }

    .shell-content {
        margin-left: 0;
    }

    html[dir="rtl"] .shell-content,
    body.rtl .shell-content {
        margin-right: 0;
    }

    body.sidebar-collapsed .shell-content {
        margin-left: 0;
    }

    html[dir="rtl"] body.sidebar-collapsed .shell-content,
    body.rtl.sidebar-collapsed .shell-content {
        margin-right: 0;
    }

    body.mobile-sidebar-open .shell-sidebar {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    body.mobile-sidebar-open .shell-overlay {
        display: block;
        opacity: 1;
    }

    .shell-topbar {
        padding: 0 12px;
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    .shell-topbar .mobile-menu-btn {
        display: flex;
    }

    .shell-help-btn {
        bottom: max(24px, env(safe-area-inset-bottom));
    }

    .shell-help-drawer {
        width: 100vw;
    }
}

@media (max-width: 480px) {
    .shell-topbar .topbar-title {
        font-size: 0.9rem;
        max-width: 140px;
    }

    .shell-topbar .topbar-breadcrumb {
        display: none;
    }

    .shell-topbar .topbar-action-btn span {
        display: none;
    }

    .shell-topbar .topbar-action-btn {
        padding: 7px 10px;
    }
}

.shell-topbar .mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
    padding: 0;
}

.shell-topbar .mobile-menu-btn:hover {
    background: var(--accent-light);
}

.shell-topbar .mobile-menu-btn svg {
    width: 22px;
    height: 22px;
}

@media (max-width: 768px) {
    .shell-topbar .mobile-menu-btn {
        display: flex;
    }
}

.shell-nav-item[data-tooltip] {
    position: relative;
}

body.sidebar-collapsed .shell-nav-item[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    z-index: 100;
    pointer-events: none;
}

html[dir="rtl"] body.sidebar-collapsed .shell-nav-item[data-tooltip]:hover::after,
body.rtl.sidebar-collapsed .shell-nav-item[data-tooltip]:hover::after {
    left: auto;
    right: calc(100% + 8px);
}

@media (max-width: 1024px) and (min-width: 769px) {
    .shell-nav-item[data-tooltip]:hover::after {
        content: attr(data-tooltip);
        position: absolute;
        left: calc(100% + 8px);
        top: 50%;
        transform: translateY(-50%);
        background: var(--bg-elevated);
        color: var(--text-primary);
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 0.78rem;
        font-weight: 500;
        white-space: nowrap;
        box-shadow: var(--shadow);
        border: 1px solid var(--border);
        z-index: 100;
        pointer-events: none;
    }

    html[dir="rtl"] .shell-nav-item[data-tooltip]:hover::after,
    body.rtl .shell-nav-item[data-tooltip]:hover::after {
        left: auto;
        right: calc(100% + 8px);
    }
}

@media print {
    .shell-sidebar,
    .shell-topbar,
    .shell-overlay,
    .shell-help-btn,
    .shell-help-drawer {
        display: none !important;
    }

    .shell-content {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .shell-frame iframe {
        position: static;
        width: 100%;
        height: auto;
    }
}
