

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body{
    min-height: 100vh;
    background:#DEF8DB;
}

.sidebar{
    width: 270px;
    position: fixed;
    background:  #2b5820;
    height: 100vh;
    transition: 0.4s ease;
}

.sidebar.collapsed{
    width: 85px;
}

.sidebar.collapsed ~ .mainbar {
  margin-left: 85px;
}

.sidebar-header{
    position: relative;
    display: flex;
    padding: 25px 20px;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header .header-logo img{
    width: 46px;
    height: 46px;
    display: block;
    object-fit: contain;
    border-radius: 50%;

    filter: drop-shadow(0 0 3px #ffffff)
            drop-shadow(0 0 5px #a8e1a0);
}

.sidebar-header .toggler{
    height: 25px;
    width: 25px;
    border: none;
    color: #2b5820;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    background: #fff;
    transition: 0.4s ease;
}

.sidebar-header .sidebar-toggler{
    position: absolute;
    right: 20px;
}

.sidebar.collapsed .sidebar-header .sidebar-toggler{
    transform: translate(-4px, 65px);
}

.sidebar-header .toggler:hover{
    background: #a8e1a0;
}

.sidebar-header .menu-toggler span{
    font-size: 1.3rem;
}

.sidebar-header .sidebar-toggler span{
    font-size: 1.75rem;
    transition: 0.4s ease;
}

.sidebar.collapsed .sidebar-header .sidebar-toggler span{
    transform: rotate(180deg);
}

.sidebar-nav .nav-list{
    list-style: none;
    display: flex;
    gap: 4px;
    padding: 0 15px;
    flex-direction: column;
    transform: translateY(15px);
    transition: 0.4s ease;
}

.sidebar.collapsed .sidebar-nav .primary-nav{
    transform: translateY(65px);
}

.sidebar-nav .nav-link{
    color: #fff;
    display: flex;
    gap: 10px;
    white-space: nowrap;
    border-radius: 8px;
    align-items: center;
    padding: 10px 12px;
    font-size: 14px;
    text-decoration: none;
    transition: 0.4s ease;
}

.sidebar-nav .nav-link:hover{
    color: #2b5820;
    background: #fff;
}

.sidebar-nav .nav-label {
    font-size: 14px;
    font-weight: 500;
}

.sidebar-nav .nav-icon {
    font-size: 20px;
}

.sidebar-nav .nav-link .nav-label{
    transition: opacity 0.4s ease;
}

.sidebar.collapsed .sidebar-nav .nav-link .nav-label{
    opacity: 0;
    pointer-events: none;
}

.sidebar-nav .nav-item{
    position: relative;
}

.sidebar-nav .nav-tooltip{
    position: absolute;
    top: -10px;
    opacity: 0;
    display: none;
    pointer-events: none;
    left: calc(100% + 25px);
    color: #2b5820;
    padding: 6px 12px;
    border-radius: 8px;
    background: #fff;
    white-space: nowrap;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    transition: 0s;
}

.sidebar.collapsed .sidebar-nav .nav-tooltip{
    display: block;
}

.sidebar-nav .nav-item:hover .nav-tooltip{
    opacity: 1;
    pointer-events: auto;
    transform: translateY(50%);
    transition: 0.4s ease;
}

.sidebar-nav .secondary-nav{
    position: absolute;
    bottom: 30px;
    width: 100%;
}

.sidebar-header .menu-toggler {
  display: none;
}

.sidebar-nav .nav-item{
    position: relative;
}

.secondary-nav .dropdown-container .dropdown-icon{
    margin: 0 -4px 0 auto;
}

.sidebar-nav .dropdown-menu {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: auto;
  background: white;
  border-radius: 8px;
}

.sidebar-nav .dropdown-menu .dropdown-link {
  color: #2b5820;
  display: block;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  transition: auto;
}

.sidebar-nav .dropdown-container.active .dropdown-menu {
  max-height: 300px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sidebar-nav .dropdown-menu .dropdown-link:hover {
  background: #a8e1a0;
  color: #2b5820;
}

.sidebar-nav .dropdown-container.active .dropdown-icon {
  transform: rotate(180deg);
  transition: transform 0.4s ease;
}

.sidebar.collapsed .dropdown-menu{
    position: absolute;
    left: 100%;
    top: -10px;
    background: #2b5820;
    padding: 7px 10px 7px 24px;
    border-radius: 0 10px 10px 0;
}

.sidebar.collapsed .dropdown-container.active .dropdown-menu {
  position: absolute;
  left: 100%;
  top: 0;
  background: white;
  border-radius: 0 10px 10px 0;
  padding: 10px 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.sidebar-nav .dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-nav .dropdown-container .dropdown-icon {
  margin-left: auto;
  transition: transform 0.4s ease;
}

.sidebar-nav .dropdown-container.active .dropdown-icon {
  transform: rotate(180deg);
}

.sidebar.collapsed .dropdown-container .dropdown-icon{
    opacity: 0;
}


.sidebar.collapsed .dropdown-container:hover .dropdown-menu {
  max-height: 300px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sidebar.collapsed .dropdown-container {
  position: relative;
}

.sidebar.collapsed .dropdown-container .dropdown-menu {
  position: absolute;
  top: 0;
  left: 130%;
  width: 180px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: all 0.3s ease;
  z-index: 999;
}

.sidebar.collapsed .dropdown-container:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.sidebar.collapsed .dropdown-menu .dropdown-link {
  display: block;
  padding: 10px 15px;
  color: #2b5820;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 6px;
  transition: 0.3s;
}

.sidebar.collapsed .dropdown-menu .dropdown-link:hover {
  background: #a8e1a0;
  color: #2b5820;
}

@media (max-width: 1024px){
    .sidebar{
        height: 56px;
        overflow-y: hidden;
        scrollbar-width: none;
        margin: 13px;
        width: calc(100% - 28px);
        max-height: calc(100vh - 28px);
    }

    .sidebar.menu-active{
        overflow-y: auto;
    }

    .sidebar-header{
        position: sticky;
        top: 0;
        z-index: 20;
        background: #2b5820;
        padding: 8px 10px;
        border-radius: 16px;
    }

    .sidebar-header .header-logo img{
        width: 40px;
        height: 40px;
    }

    .sidebar-header .sidebar-toggler,
    .sidebar-nav .nav-tooltip{
    display: none;
    }

    .sidebar-header .menu-toggler{
        display: flex;
        height: 30px;
        width: 30px;
    }

    .sidebar-header .nav-list{
        padding: 0 10px;
    }

    .sidebar-header .nav-link{
        gap: 10px;
        padding: 10px;
        font-size: 0.94rem;
    }

    .sidebar-header .nav-link .nav-icon{
        font-size: 1.37rem;
    }

    .sidebar-nav .secondary-nav{
    position: relative;
    bottom: 0;
    margin: 40px 0 30px;
}
}
/* For responsive Sidebar on Mobile */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: auto;
    width: 100%;
    max-height: 56px;
    margin: 0;
    border-radius: 0;
    z-index: 1000;
    transition: max-height 0.4s ease;
  }

  .sidebar.menu-active {
    max-height: 100vh;
  }

  .mainbar {
    margin-left: 0 !important;
    margin-top: 70px; 
    transition: margin 0.4s ease;
  }

  .overlay {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    width: 100%;
    height: calc(100% - 56px);
    background: rgba(0, 0, 0, 0.4);
    z-index: 900;
  }

  .overlay.active {
    display: block;
  }
}

/* For responsive dropdown */
@media (max-width: 1024px) {
  .sidebar-nav .dropdown-container {
    position: relative;
  }

  .sidebar-nav .dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .sidebar-nav .dropdown-icon {
    transition: transform 0.3s ease;
  }

  .sidebar .dropdown-menu {
    background: #fff;
  }

  .sidebar-nav .dropdown-container.active .dropdown-menu {
    max-height: 300px;
    opacity: 1;
    visibility: visible;  
    transform: translateY(0);
    padding: 10px 15px;
  }

  .sidebar-nav .dropdown-menu .dropdown-link {
    display: block;
    color: #2b5820;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    transition: 0.3s;
  }

  .sidebar-nav .dropdown-menu .dropdown-link:hover {
    background: #a8e1a0;
    color: #2b5820;
  }

  .sidebar-nav .dropdown-container.active .dropdown-icon {
    transform: rotate(180deg);
  }

  @media screen and (max-width: 767px) {
  .sidebar {
    max-height: 56px;
  }

  .mainbar-header h1 {
    font-size: 14px;
    text-align: center;
  }

  .mainbar {
    padding: 8px;
  }

  table th, table td {
    font-size: 10px;
    padding: 4px;
  }

  .table-title {
    font-size: 10px;
    margin-top: 5px;
    margin-bottom: 2px; 
  }

  .table-divider {
    margin-bottom: 5px; 
  }
}

@media screen and (max-width: 576px) {

  .sidebar {
    max-height: 56px;
  }

  .mainbar {
    margin-left: 0 !important;
    margin-top: 65px;
    padding: 8px;
  }

  .mainbar-header {
    padding: 5px 10px;
    border-radius: 8px;
  }

  .mainbar-header h1 {
    font-size: 12px;
    text-align: center;
  }

  .table-title {
    font-size: 9px;
    margin-top: 3px;     
    margin-bottom: 2px;  
  }

  .table-divider {
    margin-bottom: 5px;
  }

  table th,
  table td {
    font-size: 9px;
    padding: 4px;
  }

  .monthly-payment-section,
  .fees-section,
  .subject-section {
    padding: 10px;
  }
}

@media screen and (max-width: 400px) {
  .mainbar-header h1 {
    font-size: 10px;
  }

  .table-title {
    font-size: 8px;
    margin-top: 2px;   
    margin-bottom: 2px;
  }

  .table-divider {
    margin-bottom: 3px; 
  }

  table th, table td {
    font-size: 6px;
    padding: 2px;
  }

  .mainbar {
    padding: 5px;
  }
}
}