/* assets/css/styles.css */

/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  background: #f4f8fb;
  color: #333;
}

/* login */

/* --- LOGIN --- */

.login-body {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f4f8fb;
  min-height: 100vh;
}

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.login-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  text-align: center;
}

.login-logo img {
  width: 120px;
  height: auto;
  margin-bottom: 1rem;
}

.login-title {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  color: #172b4d;
}

.login-field {
  margin-bottom: 1rem;
  text-align: left;
}

.login-field label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.login-field input {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

.login-remember {
  display: block;
  text-align: left;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
}

.login-button {
  width: 100%;
  padding: 0.75rem;
  background-color: #172b4d;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.login-button:hover {
  background-color: #0f1e37;
}

.login-error {
  margin-top: 1rem;
  color: red;
  font-size: 0.9rem;
}

/* principal */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background: #172b4d;
  color: white;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  transition: width 0.3s ease;
}

.sidebar.collapsed {
  width: 70px;
  align-items: center;
}

.toggle-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  cursor: pointer;
  align-self: flex-end;
}

.brand {
  text-align: center;
  margin-bottom: 2rem;
}

.sidebar.collapsed .brand img {
  width: 40px;
  height: auto;
}

.menu {
  flex: 1;
  width: 100%;
}

.menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  color: white;
  text-decoration: none;
  transition: background 0.3s;
  white-space: nowrap;
}

.menu a:hover,
.menu a.active {
  background: #1a3c61;
}

.sidebar.collapsed .menu a span {
  display: none;
}

.main {
  flex: 1;
  padding: 2rem;
  background: #ffffff;
}

.header {
  margin-bottom: 2rem;
}

#contenido {
  width: 100%;
  background: #eef3f7;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  min-height: 400px;
}


/*sección de menús */

.menu .submenu-items {
  display: none;
  flex-direction: column;
  padding-left: 20px; /* Sangría visual */
}

.menu .submenu.open > .submenu-items {
  display: flex;
}

.menu .submenu > a::after {
  content: "▸";
  float: right;
  transition: transform 0.2s ease;
}

.menu .submenu.open > a::after {
  transform: rotate(90deg);
}

.sidebar .icono {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
  filter: invert(1); /* Para que el ícono sea blanco si está en fondo oscuro */
}
.sidebar.collapsed .icono {
  margin-right: 0;
}

ul.menu,
ul.submenu {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  color: white;
  text-decoration: none;
  cursor: pointer;
}

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

.sidebar.collapsed .texto {
  display: none;
}
.sidebar.collapsed .menu-item {
  justify-content: center;
}


ul.submenu {
  display: none;
  background: #1e2d45;
  padding-left: 20px;
}

li.open > .submenu {
  display: block;
}


/* menus superior*/

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #fff;
  padding: 0 20px;
  height: 60px;
  border-bottom: 1px solid #ccc;
}

.topbar-left .logo-img {
  height: 35px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.icon-button {
  position: relative;
  cursor: pointer;
}

.icon-button img {
  width: 24px;
  height: 24px;
}

.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background-color: red;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 50%;
}

.user-menu {
  position: relative;
}

.dropdown {
  display: none;
  position: absolute;
  top: 30px;
  right: 0;
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 5px;
  width: 200px;
  z-index: 100;
}

.user-menu:hover .dropdown {
  display: block;
}

.dropdown-header {
  font-weight: bold;
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px;
  cursor: pointer;
}

.dropdown-item:hover {
  background-color: #f5f5f5;
}

.drop-icon {
  width: 20px;
  height: 20px;
  margin-right: 10px;
}


/* loading */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  color: #444;
  padding: 40px;
}
.loading img {
  width: 32px;
  height: 32px;
}
