/* Biến CSS */
:root {
  --primary-color: #4361ee;
  --primary-dark: #3a56d4;
  --secondary-color: #3f37c9;
  --accent-color: #4cc9f0;
  --success-color: #4caf50;
  --warning-color: #ff9800;
  --danger-color: #f44336;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --gray-color: #6c757d;
  --sidebar-dark: #343a40;
  --sidebar-darker: #212529;
  --transition-speed: 0.3s;
  --border-radius: 0.5rem;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --card-border-radius: 0.5rem;
}

/* Thiết lập chung */
body {
  font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
  background-color: #f5f7fa;
  color: var(--dark-color);
}

/* Navbar hiện đại */
.navbar {
  backdrop-filter: blur(10px);
  background-color: rgba(33, 37, 41, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 600;
  font-size: 1.2rem;
  background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
}

/* Sidebar cải tiến */
.sidebar {
  background: linear-gradient(180deg, var(--dark-color), #343a40);
  color: white;
  transition: all var(--transition-speed);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-sticky {
  padding: 1rem;
}

.nav-link {
  border-radius: var(--border-radius);
  margin-bottom: 0.5rem;
  transition: all var(--transition-speed);
  color: rgba(255, 255, 255, 0.8);
  padding: 0.75rem 1rem;
}

.nav-link:hover, .nav-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  transform: translateX(5px);
}

.nav-link i {
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

.sidebar-heading {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Card thiết kế */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: transform var(--transition-speed);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card:hover {
  transform: translateY(-5px);
}

.card-header {
  background-color: white;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-weight: 600;
  padding: 1rem 1.25rem;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  background-color: white;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1rem 1.25rem;
}

/* Thẻ thống kê */
.stat-card {
  display: flex;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  margin-bottom: 1.5rem;
  transition: transform var(--transition-speed);
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  font-size: 2rem;
  color: white;
}

.stat-card-content {
  padding: 1.5rem;
  flex: 1;
}

.stat-card-content h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.stat-badges {
  margin-top: 0.5rem;
}

/* Bảng dữ liệu hiện đại */
.table {
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

.table th {
  border: none;
  font-weight: 600;
  color: var(--gray-color);
  text-transform: uppercase;
  font-size: 0.75rem;
  padding: 0.75rem 1rem;
}

.table td {
  border: none;
  background-color: white;
  vertical-align: middle;
  padding: 1rem;
}

.table tr td:first-child {
  border-top-left-radius: var(--border-radius);
  border-bottom-left-radius: var(--border-radius);
}

.table tr td:last-child {
  border-top-right-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
}

.table-hover tbody tr:hover td {
  background-color: rgba(67, 97, 238, 0.05);
}

/* Badge cải tiến */
.badge {
  padding: 0.5rem 0.75rem;
  border-radius: 50rem;
  font-weight: 500;
  font-size: 0.75rem;
}

.badge-pending {
  background-color: var(--warning-color);
  color: white;
}

.badge-processed, .badge-synced {
  background-color: var(--success-color);
  color: white;
}

.badge-failed {
  background-color: var(--danger-color);
  color: white;
}

/* Nút cải tiến */
.btn {
  border-radius: var(--border-radius);
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: all var(--transition-speed);
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Phân trang hiện đại */
.pagination {
  gap: 0.25rem;
}

.page-item .page-link {
  border: none;
  border-radius: var(--border-radius);
  color: var(--primary-color);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
}

.page-item.active .page-link {
  background-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    margin-left: -100%;
    position: fixed;
    top: 56px;
    width: 80%;
    height: calc(100vh - 56px);
    z-index: 1000;
  }
  
  .sidebar.show {
    margin-left: 0;
  }
  
  .content {
    margin-top: 56px;
  }
  
  .stat-card {
    flex-direction: column;
  }
  
  .stat-card-icon {
    width: 100%;
    padding: 1rem;
  }
}

/* Hiệu ứng loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--border-radius);
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Tooltip cải tiến */
.tooltip {
  font-size: 0.8rem;
}

.tooltip .tooltip-inner {
  border-radius: var(--border-radius);
  padding: 0.5rem 0.75rem;
  box-shadow: var(--box-shadow);
}

/* Code viewer */
pre {
  background-color: #2d3748;
  color: #e2e8f0;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  max-height: 400px;
  overflow-y: auto;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

pre::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

pre::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

pre::-webkit-scrollbar-track {
  background-color: rgba(0, 0, 0, 0.1);
}