/* css/dashboard.css */
/* Tab View Management */
.tab-content {
  display: none;
  animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-content.active {
  display: block;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Page Header Title */
.page-header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(157, 78, 221, 0.2);
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

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

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Sidebar Layout & Styles */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: rgba(20, 11, 41, 0.65) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(168, 85, 247, 0.25);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  z-index: 20;
}

.sidebar-logo {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: linear-gradient(to right, var(--accent-pink), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-menu {
  list-style: none;
  padding: 1.5rem 0.75rem;
  flex: 1;
}

.menu-item {
  margin-bottom: 0.5rem;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.menu-link:hover {
  background: rgba(157, 78, 221, 0.1);
  color: var(--text-primary);
  border-color: rgba(157, 78, 221, 0.15);
}

.menu-item.active .menu-link {
  background: linear-gradient(135deg, rgba(157, 78, 221, 0.2), rgba(0, 229, 255, 0.1));
  color: var(--text-primary);
  border-color: rgba(157, 78, 221, 0.3);
  box-shadow: inset 0 0 10px rgba(157, 78, 221, 0.1), 0 0 8px rgba(0, 229, 255, 0.05);
}

.menu-link i {
  font-size: 1.2rem;
  width: 20px;
  text-align: center;
  transition: transform 0.2s ease;
}

.menu-link:hover i {
  transform: scale(1.1);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ═══════════════════════════════════════════
   RESPONSIVE MEDIA QUERIES (MOBILE FIXES)
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Layout adjustments */
  .app-container {
    flex-direction: column;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: -240px; /* Hidden offscreen */
    width: 240px;
    height: 100vh;
    z-index: 1200;
    box-shadow: none;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .sidebar.active {
    left: 0;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.6);
  }
  
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(11, 5, 24, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    z-index: 1199;
    transition: all 0.3s ease;
  }
  
  .sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
  }
  
  .main-content {
    width: 100%;
    margin-left: 0;
    height: 100vh;
  }
  
  .header {
    padding: 0 1rem;
    height: 60px;
  }
  
  .btn-toggle-sidebar {
    display: block !important;
  }
  
  .content-body {
    padding: 1.25rem 0.75rem;
  }
  
  /* Grids and spacings */
  .grid-4, .grid-2, .grid-3, .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  /* Page Titles */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .page-header > div {
    width: 100%;
  }
  
  .page-header .btn {
    width: 100%;
  }
  
  /* Client Detail Drawer on mobile */
  .client-detail-drawer {
    width: 100% !important;
    right: -100% !important;
  }
  
  .client-detail-drawer.open {
    right: 0 !important;
  }
  
  /* Tables header adjustments */
  .table-header-bar {
    padding: 1rem;
    flex-direction: column;
    align-items: stretch;
  }
  
  .table-search {
    min-width: 100%;
  }
  
  .table-filters {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .table-select {
    width: 100%;
  }
}
