/* App shell — dashboards & admin (no top navbar) */
body.app-shell {
    overflow-x: hidden;
    background: var(--background-white);
    animation: none;
}

body.app-shell .navbar {
    display: none !important;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #ffffff 0%, #fff7f8 100%);
    border-right: 1px solid rgba(var(--primary-rgb), 0.1);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    padding: 1.25rem 1rem;
    box-shadow: 8px 0 30px rgba(122, 0, 16, 0.05);
}

.app-sidebar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #7a0010 0%, #b3122d 55%, #d94b5f 100%);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    padding: 0.5rem 0.65rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
    transition: background 0.3s var(--ease-out);
}

.app-brand:hover {
    background: var(--background-light);
}

.app-brand i {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.app-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.app-brand-name {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.app-brand-name em {
    color: var(--primary-color);
    font-style: normal;
}

.app-brand-sub {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.app-sidebar-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.app-sidebar .sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.45rem;
    border: 1px solid rgba(var(--primary-rgb), 0.08);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    transition:
        color 0.25s var(--ease-out),
        background 0.25s var(--ease-out),
        transform 0.25s var(--ease-out),
        box-shadow 0.25s var(--ease-out);
}

.sidebar-link i {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.06);
    color: var(--primary-color);
    font-size: 0.9rem;
    flex-shrink: 0;
    transition:
        background 0.25s var(--ease-out),
        color 0.25s var(--ease-out),
        transform 0.25s var(--ease-out);
}

.sidebar-link:hover {
    background: rgba(var(--primary-rgb), 0.06);
    color: var(--text-primary);
    transform: translateX(2px);
}

.sidebar-link:hover i {
    background: rgba(var(--primary-rgb), 0.12);
    transform: scale(1.04);
}

.sidebar-link.active {
    color: #7a0010;
    background: linear-gradient(90deg, rgba(179, 18, 45, 0.14) 0%, rgba(217, 75, 95, 0.06) 100%);
    box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.1);
}

.sidebar-link.active::before {
    content: "";
    position: absolute;
    left: -0.45rem;
    top: 50%;
    width: 4px;
    height: 1.5rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #7a0010 0%, #d94b5f 100%);
    transform: translateY(-50%);
}

.sidebar-link.active i {
    background: linear-gradient(135deg, #7a0010 0%, #b3122d 100%);
    color: #fff;
}

.app-sidebar-foot {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(var(--primary-rgb), 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.3s var(--ease-out);
}

.sidebar-back:hover {
    background: var(--background-light);
    color: var(--text-primary);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 1rem;
    background: transparent;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.35s var(--ease-out);
}

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

.app-main {
    flex: 1;
    margin-left: 260px;
    padding: 1.75rem clamp(1rem, 3vw, 2rem) 2.5rem;
    min-width: 0;
}

@media (max-width: 768px) {
    .app-sidebar {
        width: 100%;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        box-shadow: none;
    }

    .app-layout {
        flex-direction: column;
    }

    .app-main {
        margin-left: 0;
        padding: 1.25rem 1rem 2rem;
    }

    .app-sidebar .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        background: transparent;
        border: none;
        padding: 0;
        box-shadow: none;
    }

    .sidebar-link {
        flex: 1 1 calc(50% - 0.4rem);
        min-width: 150px;
    }

    .sidebar-link.active::before {
        left: 0.2rem;
    }
}
