body {
  margin: 0;
  font-family: Arial, sans-serif;
}

body {
  background-color: #f8f9fa;
  background-image: linear-gradient(to bottom, #e8e8e8 1px, transparent 1px);
  background-size: 100% 30px;
}



.container {
  display: flex;
  height: 100vh;
}


.logo {
  font-weight: bold;
  margin-bottom: 20px;
}

.user-info {
  margin-bottom: 20px;
  text-align: center;
}

.user-info img.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  background: #1c1c2e;
  color: white;
  border-radius: 20px;
  margin: 10px;
}

.topbar .actions button,
.topbar .actions a {
  margin-left: 10px;
  background: white;
  color: black;
  padding: 5px 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

#content {
  padding: 20px;
  background: #fff;
  flex: 1;
  overflow-y: auto;
}

.app-wrapper {
  display: flex;
  width: calc(100% - 260px); /* 240px ancho del sidebar + 10px margen izq + 10px margen der */
  margin-left: 260px;
  height: 100vh;
  padding: 10px;
  box-sizing: border-box;
  transition: width 0.3s ease, margin-left 0.3s ease;
}

.sidebar.collapsed + .app-wrapper {
  width: calc(100% - 80px); /* 70px ancho colapsado + 10px margen */
  margin-left: 80px;
}


.sidebar {
  position: fixed;
  top: 10px;
  left: 10px;
  height: calc(100vh - 20px); /* reduce 10px arriba y abajo */
  background-color: #1c1c2e;
  color: white;
  width: 240px;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
  overflow: hidden;
  border-radius: 20px;
  z-index: 1000;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); /* sombra opcional */
}


.sidebar.collapsed {
  width: 70px;
}

.top-section {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
}

.top-section .logo {
  font-size: 18px;
  font-weight: bold;
}

#toggleSidebar {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.user-info {
  text-align: center;
  padding: 15px 10px;
}

.user-info .avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  margin-bottom: 5px;
}

.username {
  font-size: 14px;
  display: block;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
}

.menu-btn {
  background: none;
  border: none;
  color: white;
  padding: 10px 20px;
  text-align: left;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}


.menu-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.menu-btn.active {
  background-color: white;
  color: #1c1c2e;
  font-weight: bold;
}

.menu-label {
  flex-grow: 1;
}

.arrow {
  font-size: 12px;
}

.has-sub .submenu {
  display: none;
  flex-direction: column;
  padding-left: 40px;
}

.has-sub.open .submenu {
  display: flex;
}

.sidebar.collapsed .menu-label,
.sidebar.collapsed .username,
.sidebar.collapsed .logo,
.sidebar.collapsed .submenu {
  display: none;
}


.menu-item {
  display: flex;
  flex-direction: column;
}

.menu-item.has-sub .submenu {
  display: none;
}

.menu-item.has-sub.open .submenu {
  display: flex;
}


.menu-btn.active,
.submenu button.active {
  background-color: white;
  color: #1c1c2e;
  font-weight: bold;
  border-radius: 12px;
}

.submenu button {
  background: none;
  border: none;
  color: white;
  padding: 8px 30px;
  text-align: left;
  font-size: 14px;
  width: 100%;
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 10px;
}

.submenu button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.submenu button.active {
  background-color: white;
  color: #1c1c2e;
  font-weight: bold;
}


.tooltip {
  position: absolute;
  left: 80px;
  top: 50%;
  transform: translateY(-50%);
  background-color: white;
  color: #1c1c2e;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: 0 0 10px rgba(0,0,0,0.15);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}


.bottom-menu {
  margin-top: auto;
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1); /* línea divisoria */
}


.bottom-menu .menu-btn {
  background: none;
  border: none;
  color: white;
  padding: 10px 20px;
  text-align: left;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  width: 100%;
  border-radius: 12px;
  transition: background 0.2s;
}

.bottom-menu .menu-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.bottom-menu .menu-btn.active {
  background-color: white;
  color: #1c1c2e;
  font-weight: bold;
}

/* Colores personalizados para botones primarios */
.btn-primary {
  background-color: #1c1c2e;
  border-color: #1c1c2e;
}

.btn-primary {
  background-color: #1c1c2e;
  border-color: #1c1c2e;
  color: white;
  transition: all 0.2s ease-in-out;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: white;
  color: #1c1c2e;
  border-color: #1c1c2e;
}


/* Opcional: botones secundarios para consistencia */
.btn-secondary {
  background-color: #6c757d; /* o el color que prefieras */
  border-color: #6c757d;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: #5a6268;
  border-color: #545b62;
}

.btn-primary:active,
.btn-primary:active:focus,
.btn-primary:active:hover,
.show > .btn-primary.dropdown-toggle {
  background-color: #1c1c2e;
  border-color: #1c1c2e;
  color: white;
  box-shadow: none;
}

#content {
  padding: 20px;
  background: #ffffff;
  flex: 1;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.divider:after,
.divider:before {
content: "";
flex: 1;
height: 1px;
background: #eee;
}
.h-custom {
height: calc(100% - 73px);
}
@media (max-width: 450px) {
.h-custom {
height: 100%;
}
}