@import url('./variables.css');

/* 🔄 Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 🧍 Body */
body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  background-color: var(--color-gray-light);
  color: var(--color-black);
  min-height: 100vh;
}

/* 🔗 Links */
a {
  text-decoration: none;
  color: inherit;
}

/* 🧱 Layout base */
.app {
  display: flex;
  min-height: 100vh;
}

/* 📚 Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(
    180deg,
    var(--color-primary),
    var(--color-primary-dark)
  );
  color: var(--color-white);
  padding: 20px;
}

/* Header sidebar */
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.logo {
  font-size: 20px;
  font-weight: bold;
}

/* Menú */
.menu a {
  display: block;
  padding: 12px 15px;
  border-radius: var(--border-radius);
  margin-bottom: 8px;
  font-weight: 500;
  transition: var(--transition-fast);
}

.menu a:hover {
  background-color: rgba(255,255,255,0.15);
}

.menu a.active {
  background-color: var(--color-white);
  color: var(--color-primary);
}

/* --- Estilos mejorados para el menú (iconos + etiquetas) --- */
.menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: rgba(255,255,255,0.95);
  background: transparent;
}

.menu a:hover {
  background: rgba(255,255,255,0.08);
  transform: translateX(4px);
}

.menu a .icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.menu a .label {
  white-space: nowrap;
  font-size: 15px;
}

.menu a.active {
  background-color: var(--color-white);
  color: var(--color-primary);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* cuando sidebar está cerrado en mobile solo mostrar iconos */
@media (max-width: 768px) {
  .sidebar {
    width: 250px;
  }

  .menu a .label {
    display: inline-block;
  }

  .sidebar:not(.open) .menu a .label {
    display: none;
  }

  .sidebar {
    transition: left 0.22s ease;
  }
}

@media (min-width: 769px) {
  .sidebar {
    position: relative;
  }
}

/* Botón cerrar */
.close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-white);
  cursor: pointer;
  display: none;
}

/* Mobile */
@media (max-width: 768px) {
  .close-btn {
    display: block;
  }
}

/* 📄 Contenido principal */
.main {
  flex: 1;
  padding: 20px;
}

/* 🧭 Header */
.header {
  height: var(--header-height);
  background-color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
}

/* 🪟 Cards */
.card {
  background-color: var(--color-white);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 🎛️ Botones */
.btn {
  padding: 10px 16px;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  font-weight: 500;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
}

/* 📱 Responsive básico */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    height: 100%;
    z-index: 1000;
  }

  .sidebar.open {
    left: 0;
  }
}
