<!-- Left Sidebar -->
<div class="col-lg-3">
    <div class="card">
        <div class="card-header">
            <h6 class="card-header d-flex align-items-center">
                <i class="fa fa-cogs font-30 mr-10"></i>
                <?php echo $this->lang->line('menu'); ?>
            </h6>
        </div>
        <div class="card-body p-0">
            <ul class="nav flex-column nav-pills">
                <?php 
                $segment_3 = $this->uri->segment(3);
                $is_index_active = ($segment_3 == '' || $segment_3 == 'index' || $segment_3 == 'add' || $segment_3 == 'edit') && $segment_3 != 'option' && $segment_3 != 'unit';
                $is_option_active = ($segment_3 == 'option' || $segment_3 == 'option_add' || $segment_3 == 'option_edit');
                $is_unit_active = ($segment_3 == 'unit' || $segment_3 == 'unit_add' || $segment_3 == 'unit_edit');
                ?>
                
                <?php if (has_permission(VIEW, 'diagnostic', 'template')) { ?>
                    <li class="nav-item">
                        <a class="nav-link <?php echo $is_index_active ? 'active bg-gradient-primary text-white' : ''; ?>" href="<?php echo site_url('diagnostic/template'); ?>">
                            <i class="fa fa-flask mr-5"></i>
                            <?php echo $this->lang->line('template'); ?>
                        </a>
                    </li>
                <?php } ?>
                
                <?php if (has_permission(VIEW, 'diagnostic', 'template')) { ?>
                    <li class="nav-item">
                        <a class="nav-link <?php echo $is_option_active ? 'active bg-gradient-primary text-white' : ''; ?>" href="<?php echo site_url('diagnostic/template/option'); ?>">
                            <i class="fa fa-list mr-5"></i>
                            <?php echo $this->lang->line('test_option'); ?>
                        </a>
                    </li>
                <?php } ?>
                
                <?php if (has_permission(VIEW, 'diagnostic', 'template')) { ?>
                    <li class="nav-item">
                        <a class="nav-link <?php echo $is_unit_active ? 'active bg-gradient-primary text-white' : ''; ?>" href="<?php echo site_url('diagnostic/template/unit'); ?>">
                            <i class="fa fa-balance-scale mr-5"></i>
                            <?php echo $this->lang->line('unit'); ?>
                        </a>
                    </li>
                <?php } ?>
            </ul>
        </div>
    </div>
</div>
<!-- /Left Sidebar -->

<style>
.nav-pills .nav-link {
    border-radius: 0;
    padding: 12px 20px;
    color: #333;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-pills .nav-link:hover {
    background-color: #f8f9fa;
    border-left-color: #007bff;
}

.nav-pills .nav-link.active {
    border-left-color: #0056b3;
}

.nav-pills .nav-link i {
    width: 20px;
    text-align: center;
}
</style>