/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  line-height: 1.6;
}

/* Dashboard Container */
.dashboard-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
  width: 260px;
  height: 100vh;
  background-color: #f8fafc;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  overflow-y: auto;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(to right, #ffffff, #f8fafc);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  width: 2rem;
  height: 2rem;
  background: linear-gradient(135deg, #06b6d4, #14b8a6);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 0.875rem;
}

.logo-text h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.125rem;
}

.logo-text p {
  font-size: 0.75rem;
  color: #64748b;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  overflow-y: auto; /* Permitir scroll si hay muchos elementos */
}

.nav-menu {
  list-style: none;
  padding: 0 0.5rem;
}

.nav-item {
  margin-bottom: 0.25rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}

.nav-link, .submenu a {
  color: #475569;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  transition: background-color 0.3s ease, color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link:hover, .submenu a:hover {
  background-color: #e2e8f0;
  color: #1e3a8a;
}

.nav-item.active > .nav-link {
  background-color: #e0f2fe;
  color: #0369a1;
  font-weight: bold;
}

.nav-link i {
  width: 1.25rem;
  font-size: 1.125rem;
  transition: transform 0.2s ease;
}

/* Efecto de hover con línea */
.nav-link::after {
  content: '';
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.5rem;
  height: 2px;
  background-color: #0891b2;
  transform: scaleX(0);
  transition: transform 0.2s ease;
  border-radius: 1px;
}

.nav-link:hover::after {
  transform: scaleX(0.3);
}

/* Efecto Ripple */
.nav-link, .submenu a {
  position: relative;
  overflow: hidden;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(8, 145, 178, 0.1);
  transform: scale(0);
  animation: ripple-effect 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-effect {
  to {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* Efecto de hover mejorado */
.nav-link.hover-active::before, 
.submenu a.hover-active::before {
  content: '';
  position: absolute;
  top: var(--y-position);
  left: var(--x-position);
  width: 100px;
  height: 100px;
  background: radial-gradient(circle closest-side, rgba(8, 145, 178, 0.08), transparent);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  transition: width 0.2s ease, height 0.2s ease;
}

/* Indicador de elemento activo */
.active-indicator {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleX(0);
  height: 60%;
  width: 3px;
  background: linear-gradient(to bottom, #06b6d4, #0891b2);
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.active-indicator.visible {
  transform: translateY(-50%) scaleX(1);
  opacity: 1;
}

/* Mejora visual para el caret */
.submenu-caret.hover {
  color: #0891b2;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background-color: #f8fafc;
  border-radius: 0.5rem;
}

.user-avatar {
  width: 2rem;
  height: 2rem;
  background: linear-gradient(135deg, #06b6d4, #14b8a6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e293b;
}

.user-role {
  font-size: 0.75rem;
  color: #64748b;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  height: 4rem;
  background-color: white;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.sidebar-toggle:hover {
  background-color: #f1f5f9;
  color: #0891b2;
  transform: rotate(180deg);
}

.header-title h1 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.125rem;
}

.header-title p {
  font-size: 0.875rem;
  color: #64748b;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-container {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.875rem;
}

.search-input {
  padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  width: 16rem;
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: #14b8a6;
}

.icon-button {
  background: none;
  border: 1px solid #e2e8f0;
  padding: 0.5rem;
  border-radius: 0.375rem;
  color: #64748b;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.icon-button:hover {
  background-color: #f8fafc;
}

.primary-button {
  background: linear-gradient(135deg, #06b6d4, #14b8a6);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s ease;
}

.primary-button:hover {
  opacity: 0.9;
}

/* Dashboard Content */
.dashboard-content {
  flex: 1;
  padding: 1.5rem;
  background-color: rgba(248, 250, 252, 0.5);
  padding-top:64px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: box-shadow 0.2s ease;
}

.stat-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.stat-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
}

.stat-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.projects-icon {
  background: linear-gradient(135deg, #06b6d4, #14b8a6);
}

.developers-icon {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.team-icon {
  background: linear-gradient(135deg, #14b8a6, #10b981);
}

.messages-icon {
  background: linear-gradient(135deg, #64748b, #475569);
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.stat-change {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
}

.stat-change.positive {
  color: #059669;
}

.stat-change.negative {
  color: #dc2626;
}

.stat-period {
  color: #64748b;
  margin-left: 0.25rem;
}

/* Main Grid */
.main-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Card Styles */
.card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  overflow: hidden;
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
}

.title-accent {
  width: 0.125rem;
  height: 1.5rem;
  background: linear-gradient(180deg, #06b6d4, #14b8a6);
  border-radius: 0.125rem;
}

.card-content {
  padding: 1.5rem;
}

/* Project Items */

/* === Form Styles === */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: #fff;
    font-size: 1rem;
    color: #1f2937;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

/* === Alert Styles === */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.alert-danger {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdfa;
    color: #059669;
    border: 1px solid #a7f3d0;
}

/* === Table Styles === */
.data-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e2e8f0;
}

.data-table th, .data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table thead th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 0.875rem;
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.data-table td .icon-button {
    margin-right: 0.5rem;
}

.icon-button.danger {
    color: #dc2626;
}

.icon-button.danger:hover {
    background-color: #fef2f2;
}

/* === Secondary Button === */
.secondary-button {
    background-color: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.secondary-button:hover {
    background-color: #f8fafc;
    color: #1e293b;
}
.project-item {
  padding: 1rem;
  border: 1px solid #f1f5f9;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s ease;
}

.project-item:hover {
  border-color: #e2e8f0;
}

.project-item:last-child {
  margin-bottom: 0;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.project-info h4 {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.project-info p {
  font-size: 0.875rem;
  color: #64748b;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-progress {
  background-color: #ecfeff;
  color: #0891b2;
}

.badge-development {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.badge-testing {
  background-color: #dcfce7;
  color: #166534;
}

.progress-section {
  margin-bottom: 0.75rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.progress-header span:first-child {
  color: #64748b;
}

.progress-header span:last-child {
  font-weight: 500;
  color: #1e293b;
}

.progress-bar {
  width: 100%;
  height: 0.5rem;
  background-color: #f1f5f9;
  border-radius: 0.25rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #14b8a6);
  transition: width 0.3s ease;
}

.project-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: #64748b;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.tech-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tech-tag {
  padding: 0.125rem 0.5rem;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  color: #475569;
}

/* Activity Feed */
.activity-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  transition: background-color 0.2s ease;
}

.activity-item:hover {
  background-color: #f8fafc;
}

.activity-item:last-child {
  margin-bottom: 0;
}

.activity-avatar {
  width: 2rem;
  height: 2rem;
  background: linear-gradient(135deg, #06b6d4, #14b8a6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.activity-icon {
  color: #94a3b8;
  font-size: 0.875rem;
}

.activity-text {
  font-size: 0.875rem;
  color: #64748b;
}

.activity-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.activity-badge {
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.activity-badge.commit {
  background-color: #dcfce7;
  color: #166534;
}

.activity-badge.task {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.activity-badge.comment {
  background-color: #faf5ff;
  color: #7c3aed;
}

.activity-badge.document {
  background-color: #fed7aa;
  color: #c2410c;
}

.activity-badge.project {
  background-color: #f1f5f9;
  color: #475569;
}

.activity-time {
  font-size: 0.75rem;
  color: #64748b;
}

/* Technology Stack */
.tech-stack-section {
  margin-bottom: 1.5rem;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.tech-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  border: 1px solid #f1f5f9;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  transition: all 0.2s ease;
}

.tech-item:hover {
  border-color: #cbd5e1;
  background-color: rgba(240, 253, 250, 0.5);
}

/* Submenu Styles */
.nav-item.has-submenu {
  position: relative;
}

.submenu-caret {
  margin-left: auto;
  transition: transform 0.3s ease, color 0.2s ease;
  opacity: 0.7;
  font-size: 0.85rem;
}

.nav-item.has-submenu .nav-link:hover .submenu-caret {
  opacity: 1;
}

.nav-item.has-submenu.active .submenu-caret {
  transform: rotate(180deg);
  opacity: 1;
}

.submenu {
  list-style: none;
  padding-left: 1rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  margin-left: 1.5rem;
  /* Eliminamos el borde vertical y usamos un indicador más sutil */
  position: relative;
}

.nav-item.has-submenu.active .submenu {
  max-height: 300px; /* Ajustar según el tamaño de tu submenú */
  opacity: 1;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.submenu li {
  margin: 0.25rem 0;
  position: relative;
}

.submenu::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, rgba(8, 145, 178, 0.1), rgba(8, 145, 178, 0.1), transparent);
  border-radius: 1px;
  opacity: 0.5;
}

.submenu li::before {
  content: '';
  position: absolute;
  left: -0.75rem;
  top: 0.75rem;
  width: 0.4rem;
  height: 1px;
  background-color: rgba(100, 116, 139, 0.3);
  transition: width 0.2s ease, background-color 0.2s ease;
}

.submenu li:hover::before {
  width: 0.75rem;
  background-color: rgba(8, 145, 178, 0.5);
}

.submenu li.active::before {
  width: 0.75rem;
  background-color: #0891b2;
}

.submenu a {
  color: #475569;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.submenu a:hover {
  color: #0891b2;
  background-color: rgba(241, 245, 249, 0.7);
}

.submenu li.active a {
  color: #0891b2;
  font-weight: 500;
  background-color: rgba(236, 254, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
  }

  .main-content {
    margin-left: 0;
  }

  .header-right {
    gap: 0.5rem;
  }

  .search-input {
    width: 12rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .tech-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }

  .dashboard-content {
    padding: 1rem;
  }
}

@media (max-width: 640px) {
  .search-container {
    display: none;
  }

  .primary-button span {
    display: none;
  }

  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .project-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
}
