@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: auto;
  background-color: #C1C1C1;
}

img {
  max-width: 100%;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
}

/* GRID */
.grid {
  display: grid;
  min-height: 100vh;
  transition: all 1s ease;
}

body.overview .grid {
  grid-template-areas: 
      "sidebar header header"
      "sidebar left-content right-content"
      "sidebar footer footer";
  grid-template-columns: var(--sidebar-width) 1fr 1fr;
  grid-template-rows: 78px 1fr 0;
}
/* END GRID */

:root {
  --sidebar-width: 78px;
}

/* SIDEBAR */
.sidebar {
  grid-area: sidebar;
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 78px;
  background: #FFFFFF;
  transition: all 1s ease;
}

.sidebar .logo-content {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 75px;
  position: relative;
}

.sidebar .logo-content .logo {
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.5s ease;
}

.sidebar .logo-content .logo i {
  font-size: 28px;
  margin-right: 5px;
}

.sidebar .logo-content #toggleMenu {
  position: absolute;
  color: #FFFFFF;
  left: 50%;
  top: 6px;
  font-size: 20px;
  height: 70px;
  width: 70px;
  text-align: center;
  line-height: 75px;
  transform: translateX(-50%);
  cursor: pointer;
}

/* Sidebar Default (inactive state) */
.sidebar .nav-links {
  height: 100%;
  padding: 3px 0 150px 0;
  overflow: auto;
}

.sidebar:not(.active) .nav-links {
  overflow: visible;
}

.sidebar .nav-links::-webkit-scrollbar {
  display: none;
}

.sidebar .nav-links li {
  position: relative;
  list-style: none;
  transition: all 0.4s ease;
}

.sidebar .nav-links li:hover {
  background: #1d1b31;
}

.sidebar .nav-links li .iocn-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: auto;
}

.sidebar:not(.active) .nav-links li .iocn-link {
  display: block;
}

.sidebar .nav-links li i {
  height: 50px;
  min-width: 50px;
  text-align: center;
  line-height: 50px;
  color: #1d1b31;
  font-size: 23px;
  margin: 0 13px 0 13px ;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sidebar .nav-links li i.bx-log-out {
  color: #fff;
}

.sidebar .nav-links li:hover i {
  color: #fff;
}

.sidebar .nav-links li.showMenu i.arrow {
  transform: rotate(-180deg);
}

.sidebar:not(.active) .nav-links i.arrow {
  display: none;
}

.sidebar .nav-links li a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.sidebar .nav-links li a .link_name {
  font-size: 18px;
  font-weight: 400;
  color: #1d1b31;
  transition: all 1.5s ease;
}

.sidebar .nav-links li:hover a .link_name {
  color: #fff;
  transition: all 1s ease;
}

.sidebar:not(.active) .nav-links li a .link_name {
  opacity: 0;
  pointer-events: none;
}

.sidebar .nav-links li .sub-menu {
  padding: 6px 6px 14px var(--sidebar-width);
  margin-top: -10px;
  background: #1d1b31;
  display: none;
  max-height: 200px;
  overflow-y: auto;
}

.sidebar .nav-links li .sub-menu::-webkit-scrollbar {
  width: 5px;
}

.sidebar .nav-links li .sub-menu::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 10px;
}

.sidebar .nav-links li.showMenu .sub-menu {
  display: block;
}

.sidebar .nav-links li .sub-menu a {
  color: #fff;
  font-size: 15px;
  padding: 5px 0;
  white-space: nowrap;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.sidebar .nav-links li .sub-menu a:hover {
  opacity: 1;
}

.sidebar:not(.active) .nav-links li .sub-menu {
  position: absolute;
  left: 100%;
  top: -10px;
  margin-top: 0;
  padding: 6.5px 20px;
  border-radius: 0 6px 6px 0;
  opacity: 0;
  display: block;
  pointer-events: none;
  transition: 0s;
}

.sidebar:not(.active) .nav-links li:hover .sub-menu {
  top: 0;
  opacity: 1;
  pointer-events: auto;
  transition: all 0.4s ease;
}

.sidebar .nav-links li .sub-menu .link_name {
  display: none;
}

.sidebar:not(.active) .nav-links li .sub-menu .link_name {
  font-size: 18px;
  opacity: 1;
  display: block;
}

.sidebar.active .nav-links li .link_name {
  opacity: 1;
  pointer-events: auto;
  transition: all 0.5s ease;
}

.sidebar.active .nav-links i.arrow {
  display: inline-block;
  font-size: 18px;
  margin-left: auto;
}

.sidebar.active .nav-links li .iocn-link {
  justify-content: flex-start;
}

.sidebar.active .nav-links li .sub-menu {
  padding-left: 20px;
}

.sidebar.active .nav-links li .sub-menu .link_name {
  display: block;
}

.sidebar.active .nav-links li .sub-menu {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  transition: all 0.4s ease;
}

.sidebar .profile-content {
  position: absolute;
  width: 100%;
  color: #FFFFFF;
  bottom: 0;
  left: 0;
}

.sidebar .profile-content .profile {
  position: relative;
  padding: 10px 6px;
  height: 60px;
  background: none;
  transition: all 0.4s ease;
}

.sidebar .profile-content .profile .profile-details {
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: all 0.7s ease;
}

.sidebar .profile-content .profile .profile-details .profile-image {
  width: 45px;
  height: 45px;
  object-fit: cover;
  border-radius: 12px;
}

.sidebar .profile-content .profile .profile-details .name-job {
  margin-left: 10px;
}

.sidebar .profile-content .profile .profile-details .name-job .name {
  font-size: 15px;
  font-weight: 400;
}

.sidebar .profile-content .profile .profile-details .name-job .job {
  font-size: 12px;
}

.sidebar .profile-content .profile #logout {
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  min-width: 50px;
  line-height: 50px;
  font-size: 20px;
  border-radius: 12px;
  text-align: center;
  background: #1D1B31;
  transition: all 0.4s ease;
  cursor: pointer;
}

.sidebar.active {
  --sidebar-width: 260px;
  width: var(--sidebar-width);
}

.sidebar.active .logo-content .logo {
  opacity: 1;
  pointer-events: auto;
}

.sidebar.active .logo-content .logo .logo-name {
  opacity: 1;
}

.sidebar.active .logo-content #toggleMenu {
  left: 90%;
}

.sidebar.active .profile-content .profile {
  background: #1D1B31;
}

.sidebar.active .profile-content .profile .profile-details {
  opacity: 1;
  pointer-events: auto;
}

.sidebar.active .profile-content .profile #logout {
  left: 88%;
  background: none;
}

.sidebar.active ~ .header,
.sidebar.active ~ .footer {
  width: calc(100% - 260px);
  left: 260px;
}

.sidebar:not(.active) .logo-content .logo-otics {
  display: none;
}

.sidebar:not(.active) .logo-content .logo-eems {
  display: none;
}

.grid.sidebar-active {
  grid-template-columns: 260px 1fr 1fr;
}

.grid.sidebar-inactive {
  grid-template-columns: 78px 1fr 1fr;
}
/* END SIDEBAR */

/* HEADER */
.header {
  grid-area: header;
  position: fixed;
  width: calc(100% - 78px);
  left: 78px;
  /*padding: 12px;*/
  box-sizing: border-box;
  transition: all 1s ease;
  height: 78px;
  background-color: #6a7ff7;
  display: flex;
  align-items: center;
  justify-content: left;
}

.header .text {
  font-size: 24px;
  font-weight: 600;
  color: #000000;
  padding-left: 20px;
}
/* END HEADER */

/* LEFT CONTENT */
body.overview .left-content {
  grid-area: left-content;
  padding: 20px;
  background-color: #f4f4f4;
  margin: 100px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}
/* END LEFT CONTENT */

/* RIGHT CONTENT */
body.overview .right-content {
  grid-area: right-content;
  padding: 20px;
  background-color: #f4f4f4;
  margin: 100px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}
/* END RIGHT CONTENT */

/* FOOTER */
.footer {
  grid-area: footer;
  background-color: #6a7ff7;
  padding: 0px 0;
  text-align: center;
  position: fixed;
  bottom: 0;
  left: 78px;
  right: 0;
  width: calc(100% - 78px);
  transition: all 1s ease;
}
/* END FOOTER */

/* SEARCH WRAPPER */
.sidebar-search {
    width: 100%;
    padding: 10px 20px;
    box-sizing: border-box;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box i {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    font-size: 18px;
    color: #fff;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 8px 12px 8px 38px; 
    border-radius: 10px;
    border: none;
    outline: none;
    background: #1e1e2d;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

/* === SAAT SIDEBAR TERTUTUP === */
.sidebar:not(.active) .search-box input {
    width: 40px;
    text-indent: -9999px;
    padding-left: 38px;
    cursor: pointer;
}

/* Saat hover sidebar kecil; hanya input yang melebar */
.sidebar:not(.active):hover .search-box input {
    width: 100%;
    text-indent: 0;
}
