/* /core/css/base.css */

/* === RESET === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Poppins", system-ui, sans-serif;
}

body {
  background-color: #0b1129;
  color: #fff;
  display: flex;
  min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
  width: 250px;
  background: #0e1538;
  color: #c7c7ff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  transition: width 0.3s ease;
  position: fixed;
  left: 0;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 20;
}

.sidebar.collapsed {
  width: 80px;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  font-weight: 600;
  font-size: 1.2rem;
  color: #fff;
  background: #11194a;
  white-space: nowrap;
}

.sidebar .brand img {
  width: 32px;
  height: 32px;
}

.menu {
  flex-grow: 1;
  padding-top: 10px;
}

.menu .item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: #b8b8ff;
  text-decoration: none;
  transition: 0.2s;
}

.menu .item:hover {
  background: rgba(102, 70, 232, 0.2);
  color: #fff;
}

.menu .item i {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.menu .item.active {
  background: #6646e8;
  color: #fff;
}

.menu .item.active i {
  color: #fff;
}

/* === SUBMENÚ === */
.submenu {
  display: none;
  flex-direction: column;
  background: #0b1027;
  margin-left: 10px;
  border-left: 2px solid #6646e8;
}

.submenu.open {
  display: flex;
}

.submenu .subitem {
  padding: 8px 35px;
  color: #b8b8ff;
  text-decoration: none;
  transition: 0.2s;
  font-size: 0.95rem;
}

.submenu .subitem:hover {
  background: rgba(102, 70, 232, 0.2);
  color: #fff;
}

.menu-toggle {
  justify-content: space-between;
  cursor: pointer;
}

.menu-toggle .caret {
  margin-left: auto;
  transition: transform 0.3s ease;
  color: #b8b8ff;
}

.menu-toggle.open .caret {
  transform: rotate(180deg);
}

/* === TOPBAR === */
.topbar {
  height: 60px;
  background: #11194a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 270px;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  transition: padding 0.3s ease;
  z-index: 10;
}

.sidebar.collapsed ~ .topbar {
  padding-left: 100px;
}

.topbar .menu-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
}

.topbar .title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.topbar .user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c7c7ff;
}

/* === MAIN === */
main {
  margin-left: 250px;
  padding: 100px 30px;
  width: 100%;
  transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ main {
  margin-left: 80px;
}

/* === SCROLL === */
.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: #6646e8;
  border-radius: 4px;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: -100%;
    z-index: 20;
  }

  .sidebar.active {
    left: 0;
  }

  .topbar {
    padding-left: 20px;
  }

  main {
    margin-left: 0;
    padding-top: 80px;
  }
}
