/* Explain: App-specific layout utilities. */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: var(--sidebar-width);
    background: var(--secondary-color);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1rem;
    overflow-y: auto;
    z-index: 50;
    transform: translateX(105%);
    transition: transform 0.28s ease;
}

body.sidebar-open .app-sidebar {
    transform: translateX(0);
}

.app-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 45;
}

body.sidebar-open .app-sidebar-backdrop {
    display: block;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-content {
    flex: 1;
    padding: 1.25rem;
}

@media (min-width: 640px) {
    .app-content {
        padding: 1.75rem;
    }
}

@media (min-width: 1024px) {
    .app-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        transform: none;
        flex-shrink: 0;
    }

    body.sidebar-open .app-sidebar-backdrop {
        display: none;
    }
}

/* ---- Brand ---- */
.app-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.4rem 1.25rem;
}

.app-brand-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary-color), #14b8a6);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.app-brand-name {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
    line-height: 1.2;
}

.app-brand-sub {
    display: block;
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 2px;
}

/* ---- Navigation ---- */
.app-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.app-nav-link i {
    width: 1.25rem;
    text-align: center;
    font-size: 1rem;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.app-nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.app-nav-link:hover i {
    color: #5eead4;
}

.app-nav-link.is-active {
    background: var(--primary-color);
    color: #fff;
    font-weight: 700;
}

.app-nav-link.is-active i {
    color: #fff;
}

.app-sidebar-foot {
    margin-top: auto;
    padding-top: 1rem;
    font-size: 0.72rem;
    line-height: 1.7;
    color: #64748b;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---- Header ---- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 1.25rem;
    min-height: var(--header-height);
}

@media (min-width: 640px) {
    .app-header {
        padding-inline: 1.75rem;
    }
}

.app-menu-btn {
    display: inline-grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.05rem;
    transition: all 0.2s ease;
}

.app-menu-btn:hover {
    background: #f8fafc;
}

@media (min-width: 1024px) {
    .app-menu-btn {
        display: none;
    }
}