/* Custom Properties & Base Styles */
:root {
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.2);
  --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 12px 40px rgba(0, 0, 0, 0.12);
  --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.16);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
  box-sizing: border-box;
}

.note-editor {
  background-color: white;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  line-height: 1.6;
  color: #334155;
  overflow-x: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.form-label.required::after {
  content: " *";
  color: #ef4444;
}

/* Glass Morphism Components */
.glass-card {
  background: var(--glass-bg);
  /* backdrop-filter: blur(20px); */
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  padding: 12px;
  transition: var(--transition-smooth);
  position: relative;
  /* overflow: hidden; */
}

.glass-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
}

.loading-card-container {
  margin: 0 !important;
}

.glass-card:hover {
  /* transform: translateY(-2px); */
  box-shadow: var(--shadow-medium);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Navigation */
.nav-link {
  color: #64748b;
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(59, 130, 246, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.nav-link:hover::before {
  left: 100%;
}

.nav-link.active {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.1),
    rgba(147, 51, 234, 0.1)
  );
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.nav-link.active .w-8 {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6) !important;
}

.nav-link.active i {
  color: white !important;
}

/* Enhanced Buttons with Loading States */
.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 40px;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover:not(.loading) {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-primary.loading {
  opacity: 0.8;
  cursor: not-allowed;
}

.btn-primary.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.btn-secondary {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 40px;
}

.btn-secondary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s ease;
}

.btn-secondary:hover::before {
  left: 100%;
}

.btn-secondary:hover:not(.loading) {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-secondary.loading {
  opacity: 0.8;
  cursor: not-allowed;
}

.btn-secondary.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.btn-accent {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 40px;
}

.btn-accent::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s ease;
}

.btn-accent:hover::before {
  left: 100%;
}

.btn-accent:hover:not(.loading) {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.btn-accent.loading {
  opacity: 0.8;
  cursor: not-allowed;
}

.btn-accent.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Stats Container */
.stats-container {
  background: white;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  margin-bottom: 32px;
}

/* Modern Stats Cards */
.modern-stat-card {
  position: relative;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.modern-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.card-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 1;
}

.card-content {
  padding: 24px;
  position: relative;
  z-index: 2;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  position: relative;
  overflow: hidden;
}

.icon-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.3)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modern-stat-card:hover .icon-wrapper::before {
  opacity: 1;
}

.icon-wrapper.blue {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.icon-wrapper.emerald {
  background: linear-gradient(135deg, #10b981, #047857);
}

.icon-wrapper.amber {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.icon-wrapper.red {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Card backgrounds */
.modern-stat-card:nth-child(1) {
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
}

.modern-stat-card:nth-child(2) {
  background: linear-gradient(135deg, #ecfdf5, #f8fafc);
}

.modern-stat-card:nth-child(3) {
  background: linear-gradient(135deg, #fffbeb, #f8fafc);
}

.modern-stat-card:nth-child(4) {
  background: linear-gradient(135deg, #fef2f2, #f8fafc);
}

.main-stat {
  flex: 1;
}

.stat-number {
  display: block;
  font-size: 32px;
  font-weight: 800;
  color: #1f2937;
  line-height: 1;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #1f2937, #4b5563);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-details {
  space-y: 12px;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 12px;
}

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

.detail-item i {
  width: 16px;
  font-size: 12px;
  color: #9ca3af;
}

.detail-item strong {
  color: #374151;
  font-weight: 700;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .modern-stat-card {
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  .card-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    padding: 0;
  }

  .card-header {
    flex: 1;
    margin-bottom: 0;
  }

  .icon-wrapper {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .stat-number {
    font-size: 24px;
  }

  .card-details {
    flex-shrink: 0;
    min-width: 110px;
    text-align: right;
    space-y: 4px;
  }

  .detail-item {
    font-size: 11px;
    margin-bottom: 4px;
    justify-content: flex-end;
  }

  .detail-item i {
    width: 12px;
    font-size: 10px;
    order: 2;
    margin-left: 4px;
    margin-right: 0;
  }
}

/* Hover animations */
.modern-stat-card .icon-wrapper {
  transition: transform 0.3s ease;
}

.modern-stat-card:hover .icon-wrapper {
  transform: scale(1.1) rotate(5deg);
}

.modern-stat-card .stat-number {
  transition: transform 0.3s ease;
}

.modern-stat-card:hover .stat-number {
  transform: scale(1.05);
}

/* Compact Project Tree Styles */
.project-tree-item {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(59, 130, 246, 0.15);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.project-tree-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.project-tree-item:hover::before {
  transform: scaleX(1);
}

.project-tree-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  border-color: rgba(59, 130, 246, 0.3);
}

.project-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.project-expand-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.project-expand-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: scale(1.1);
}

.project-expand-btn.expanded {
  transform: rotate(90deg);
}

.project-info {
  flex: 1;
  min-width: 0;
}

.project-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
  line-height: 1.4;
}

.project-description {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
  line-height: 1.4;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #6b7280;
}

.project-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.project-tasks {
  margin-left: 40px;
  margin-top: 12px;
  border-left: 2px solid rgba(59, 130, 246, 0.2);
  padding-left: 12px;
  display: none;
  transition: all 0.3s ease;
  max-height: 0;
  overflow: hidden;
}

.project-tasks.expanded {
  display: block;
  max-height: 2000px;
}

.task-tree-item {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  transition: var(--transition-smooth);
  position: relative;
}

.task-tree-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.task-tree-item:hover::before {
  transform: scaleX(1);
}

.task-tree-item:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateX(4px);
}

.task-connection {
  position: relative;
}

.task-connection::after {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  width: 8px;
  height: 1px;
  background: rgba(59, 130, 246, 0.4);
  transform: translateY(-50%);
}

/* Compact task info layout */
.task-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.task-details {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 4px;
  line-height: 1.3;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
}

.task-assignee {
  font-size: 12px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 80px;
}

.task-progress-text {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  min-width: 30px;
}

.task-progress-bar {
  width: 40px;
  height: 4px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.task-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  border-radius: 2px;
  transition: width 0.8s ease;
}

/* Project Card */
.project-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-strong);
  border-color: rgba(59, 130, 246, 0.3);
}

/* Task Card */
.task-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 18px;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.task-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.task-card:hover::before {
  transform: scaleX(1);
}

.task-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-medium);
  border-color: rgba(16, 185, 129, 0.3);
}

/* Priority Task Card - Updated for 2-column layout */
.priority-task-card {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.1),
    rgba(245, 158, 11, 0.1)
  );
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  padding: 12px;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  min-height: 155px;
}

.priority-task-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #ef4444, #f59e0b);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.priority-task-card:hover::before {
  transform: scaleX(1);
}

.priority-task-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Priority tasks grid layout */
#priority-tasks {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

#priority-tasks::-webkit-scrollbar {
  width: 4px;
}

#priority-tasks::-webkit-scrollbar-track {
  background: transparent;
}

#priority-tasks::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}

/* Search input styling for project-task section */
#project-task-search {
  font-family: inherit;
}

#project-task-search:focus {
  transform: scale(1.01);
}

/* Staff Card */
.staff-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.staff-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.staff-card:hover::before {
  transform: scaleX(1);
}

.staff-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-medium);
  border-color: rgba(245, 158, 11, 0.3);
}

.staff-avatar {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 20px;
  color: white;
  font-weight: bold;
  transition: var(--transition-bounce);
}

.staff-card:hover .staff-avatar {
  transform: scale(1.1) rotate(5deg);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Status Badges */
.status-badge {
  padding: 1px 4px;
  border-radius: 12px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
}

.status-pending {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
  border: 1px solid rgba(107, 114, 128, 0.2);
}

.status-active {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.status-completed {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-overdue {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Priority Badges */
.priority-low {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.priority-medium {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.priority-high {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Quick Add Menu */
.quick-add-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: #374151;
  text-decoration: none;
  transition: var(--transition-smooth);
  border-radius: 12px;
  margin: 4px;
  white-space: nowrap;
  font-size: 13px;
  /* THÊM dòng này */
}

.quick-add-item:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  transform: translateX(4px);
}

.quick-add-item i {
  width: 20px;
  margin-right: 12px;
}

/* Activity Item */
.activity-item {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 4px;
  transition: var(--transition-smooth);
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateX(4px);
}

/* Loading Card */
.loading-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  color: #6b7280;
  animation: pulse 2s infinite;
  margin-top: 10px;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Enhanced Modal Styles */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 32px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: var(--transition-bounce);
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
}

/* Modal Header and Footer */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(249, 250, 251, 0.8);
  border: 1px solid rgba(229, 231, 235, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  color: #6b7280;
}

.modal-close:hover {
  background: rgba(243, 244, 246, 0.9);
  color: #374151;
}

.modal-body {
  margin-bottom: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(229, 231, 235, 0.5);
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 7px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(209, 213, 219, 0.5);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
  font-size: 14px;
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: rgba(255, 255, 255, 0.95);
}

.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(209, 213, 219, 0.5);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
}

.form-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: rgba(255, 255, 255, 0.95);
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(209, 213, 219, 0.5);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
  font-size: 14px;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: rgba(255, 255, 255, 0.95);
}

select[multiple] option {
  padding: 5px;
}

/* Custom Progress Slider Styles */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(
    to right,
    #ef4444 0%,
    #f97316 25%,
    #eab308 50%,
    #22c55e 75%,
    #22c55e 100%
  );
  outline: none;
  transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #3b82f6;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  border-color: #1d4ed8;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #3b82f6;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.1);
  border-color: #1d4ed8;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Image Upload Slot Styles */
.image-upload-slot {
  transition: all 0.3s ease;
}

.image-upload-slot:hover {
  border-color: #3b82f6 !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.preview-area img {
  transition: all 0.3s ease;
}

.preview-area img:hover {
  transform: scale(1.02);
}

/* Toast Notifications */
.toast {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: var(--shadow-medium);
  transform: translateX(100%);
  opacity: 0;
  transition: var(--transition-smooth);
  max-width: 400px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success {
  border-left: 4px solid #10b981;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

.toast.info {
  border-left: 4px solid #3b82f6;
}

/* Section Visibility */
.section {
  display: none;
  animation: fadeInUp 0.5s ease;
}

.section.active {
  display: block;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Action Buttons */
.action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.action-btn-edit {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.action-btn-edit:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: scale(1.1);
}

.action-btn-delete {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.action-btn-delete:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .glass-card {
    padding: 16px;
    border-radius: 16px;
  }

  .stat-card {
    padding: 16px;
  }

  .project-card,
  .task-card,
  .staff-card {
    padding: 16px;
  }

  .modal-content {
    padding: 24px;
    margin: 16px;
  }

  .project-tree-item {
    padding: 12px;
  }

  .project-header {
    flex-direction: column;
    gap: 8px;
  }

  .project-tasks {
    margin-left: 20px;
    padding-left: 12px;
  }

  .task-info {
    flex-direction: column;
    gap: 8px;
  }

  /* THÊM CÁC RULES MỚI */
  /* Header title responsive */
  #page-title {
    font-size: 18px !important;
    line-height: 1.3;
  }

  /* Button size cho mobile */
  .btn-primary,
  .btn-secondary,
  .btn-accent {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 36px;
  }

  /* Stats card responsive */
  .modern-stat-card {
    margin-bottom: 16px;
  }

  .card-content {
    padding: 16px;
  }

  .stat-number {
    font-size: 24px;
  }

  .icon-wrapper {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  /* Stats container responsive */
  .stats-container {
    padding: 16px;
    margin-bottom: 20px;
  }

  /* Grid stats responsive */
  .stats-container .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Detail items trong stats card */
  .detail-item {
    font-size: 12px;
    margin-bottom: 8px;
    align-items: flex-start;
  }

  .detail-item i {
    width: 14px;
    font-size: 11px;
    margin-top: 1px;
    flex-shrink: 0;
  }

  .detail-item span {
    line-height: 1.3;
  }

  /* Project task section responsive */
  .glass-card h3 {
    font-size: 16px;
    margin-bottom: 16px;
  }

  /* Header buttons trong project task section */
  .glass-card .flex.items-center.justify-between {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .glass-card .flex.items-center.justify-between .flex.items-center.space-x-3 {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .glass-card .flex.space-x-2 {
    display: flex;
    gap: 8px;
    justify-content: center;
  }

  /* Search input trong project task */
  #project-task-search {
    width: 100% !important;
    font-size: 14px;
  }

  /* Grid layout cho mobile */
  .grid.grid-cols-1.lg\\:grid-cols-3 {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .lg\\:col-span-2 {
    grid-column: span 1 !important;
  }
}

/* Sidebar Mobile Animation */
@media (max-width: 767px) {
  #sidebar.open {
    transform: translateX(0);
  }
}

/* Utilities */
.text-gradient {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-blur {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.border-gradient {
  border-image: linear-gradient(135deg, #3b82f6, #8b5cf6) 1;
}

/* Chart Container Enhancements */
.chart-container {
  position: relative;
  height: 100%;
  width: 100%;
}

.chart-container canvas {
  border-radius: 12px;
}

/* Enhanced hover effects for interactive elements */
.clickable {
  cursor: pointer;
  transition: var(--transition-smooth);
}

.clickable:hover {
  transform: translateY(-1px);
}

/* Project progress indicator */
.project-progress {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  height: 6px;
  overflow: hidden;
}

.project-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  border-radius: 8px;
  transition: width 0.8s ease;
}

/* Project Task Tree Height Limit - Responsive */
#project-task-tree {
  max-height: 500px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Larger screens */
@media (min-width: 1024px) {
  #project-task-tree {
    max-height: 600px;
  }
}

/* Extra large screens */
@media (min-width: 1280px) {
  #project-task-tree {
    max-height: 700px;
  }
}

#project-task-tree::-webkit-scrollbar {
  width: 6px;
}

#project-task-tree::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

#project-task-tree::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

#project-task-tree::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Login Modal Enhancements */
#login-modal {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#login-modal.show {
  opacity: 1 !important;
  visibility: visible !important;
}

#login-modal .bg-white\/90 {
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#login-modal.show .bg-white\/90 {
  transform: scale(1) !important;
}

/* User Info Section */
#user-section {
  transition: all 0.3s ease;
}

#user-info {
  animation: slideInUp 0.5s ease-out;
}

#user-avatar {
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

#user-info:hover #user-avatar {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* Login Form Styling */
#login-form input {
  transition: all 0.3s ease;
}

#login-form input:focus {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

#login-error {
  animation: shake 0.5s ease-in-out;
}

#login-loading {
  animation: fadeIn 0.3s ease;
}

/* Enhanced Button States for Authentication */
#logout-btn {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

#logout-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s ease;
}

#logout-btn:hover::before {
  left: 100%;
}

#logout-btn:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

#login-btn {
  position: relative;
  overflow: hidden;
}

#login-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.6s ease;
}

#login-btn:hover::before {
  left: 100%;
}

/* Loading States */
.loading-overlay-auth {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

/* User Role Badge */
.user-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-role-admin {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.user-role-user {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Restricted Access Indicators */
.restricted-content {
  position: relative;
}

.restricted-content::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.05);
  border-radius: inherit;
  pointer-events: none;
}

.access-denied-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.1);
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.access-denied-message {
  background: rgba(239, 68, 68, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Enhanced Navigation for Role-based Access */
.nav-link.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.nav-link.admin-only {
  position: relative;
}

.nav-link.admin-only::after {
  content: "ADMIN";
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 8px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 2px 4px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Responsive Authentication UI */
@media (max-width: 768px) {
  #login-modal .bg-white\/90 {
    margin: 16px;
    padding: 24px;
  }

  #user-info {
    padding: 12px;
  }

  #user-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .user-role-badge {
    font-size: 9px;
    padding: 1px 6px;
  }
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Session Timeout Warning */
.session-warning {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Permission-based Button States */
.btn-restricted {
  opacity: 0.6;
  cursor: not-allowed;
  position: relative;
}

.btn-restricted::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.1);
  border-radius: inherit;
  pointer-events: none;
}

.btn-restricted:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* Enhanced Action Buttons for Role-based Access */
.action-btn.hidden-for-user {
  display: none;
}

.action-btn.restricted {
  opacity: 0.3;
  pointer-events: none;
}

/* User Context Indicator */
.user-context-badge {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 12px;
  color: #6b7280;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-soft);
}

.user-context-badge i {
  color: #3b82f6;
}

/* Login Form Focus States */
#login-form .relative {
  position: relative;
}

#login-form .relative i {
  transition: all 0.3s ease;
}

#login-form input:focus + i {
  color: #3b82f6;
  transform: scale(1.1);
}

/* Enhanced Security Indicator */
.security-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 8px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 6px;
  font-size: 11px;
  color: #10b981;
}

.security-indicator i {
  font-size: 10px;
}

.loading-spin {
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Loading States Specific to Auth */
.auth-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  font-size: 14px;
}

.auth-loading .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Enhanced Modal Backdrop for Login */
#login-modal {
  backdrop-filter: blur(12px);
  background: rgba(0, 0, 0, 0.6);
}

/* Task Assignment Indicator for Current User */
.my-task {
  border-left: 4px solid #10b981;
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.1),
    rgba(16, 185, 129, 0.05)
  );
}

.my-task::before {
  content: "Của tôi";
  position: absolute;
  top: 8px;
  right: 8px;
  background: #10b981;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 500;
}

@media (max-width: 768px) {
  .project-tree-item {
    padding: 16px 12px;
  }

  .project-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .project-info {
    width: 100%;
    margin-bottom: 8px;
  }

  .project-info .flex.items-start.justify-between {
    flex-direction: column;
    gap: 8px;
  }

  .project-info .flex.items-start.justify-between > .flex-1 {
    width: 100%;
  }

  .project-info
    .flex.items-start.justify-between
    > .flex.items-center.space-x-2 {
    align-self: flex-end;
    margin-top: 8px;
  }

  /* Task tree mobile fix */
  .task-tree-item {
    padding: 12px;
  }

  .task-info {
    flex-direction: column;
    gap: 8px;
  }

  .task-details {
    width: 100%;
  }

  .task-info > .flex.items-center.space-x-3 {
    justify-content: space-between;
    width: 100%;
  }

  .task-progress {
    order: 1;
  }

  .flex.space-x-1 {
    order: 2;
    flex-shrink: 0;
  }

  /* Ensure action buttons are visible */
  .action-btn {
    min-width: 32px;
    min-height: 32px;
    flex-shrink: 0;
  }
}

.user-role-manager {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.action-btn-view {
  background: rgba(59, 130, 246, 0.05);
  color: #3b82f6;
}

.action-btn-view:hover {
  background: rgba(59, 130, 246, 0.1);
  transform: scale(1.1);
}

/* Submit Result Button Styles */
.submit-result-btn {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
  transition: all 0.3s ease;
}

.submit-result-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

/* Image Upload Styles */
.image-upload-slot {
  position: relative;
}

.image-upload-slot .form-input {
  padding-right: 2.5rem;
}

.remove-image-btn {
  position: absolute;
  right: 8px;
  top: 30px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.remove-image-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  transform: translateY(-50%) scale(1.1);
}

/* Completion Slider Styles */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  outline: none;
  transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Gantt Chart Styles */
.gantt-view-btn {
  background: white;
  color: #6b7280;
  transition: all 0.2s ease;
}

.gantt-view-btn.active {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
}

.gantt-day.weekend {
  background-color: rgb(237 238 255);
}

.gantt-day.today {
  background-color: #dd4b39;
  color: #ffffff;
}

.gantt-day-number {
  margin-bottom: 4px;
  font-weight: 500;
}

.gantt-day-label {
  font-size: 9px;
  color: #9ca3af;
}

.gantt-item {
  display: flex;
  min-height: 32px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
  position: relative;
}

.gantt-item:hover {
  background-color: rgba(243, 244, 246, 0.5);
}

.gantt-item-label {
  position: relative;
  width: 20rem;
  min-width: 20rem;
  padding: 6px 50px 6px 10px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  background: white;
  border-right: 1px solid rgba(229, 231, 235, 0.8);
  overflow: hidden;
}

.gantt-item-label i {
  margin-right: 8px;
  width: 16px;
  text-align: center;
}

.gantt-item-actions {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  padding: 2px;
  z-index: 10;
}

.gantt-item:hover .gantt-item-actions {
  display: flex;
}

.gantt-bar {
  position: absolute;
  height: 16px;
  top: 8px;
  border-radius: 4px;
  z-index: 5;
  transition: all 0.2s ease;
}

.gantt-bar-project {
  background: linear-gradient(135deg, #3b82f6, #818cf8);
  border: 1px solid #3b82f6;
}

.gantt-bar-task {
  background: linear-gradient(135deg, #10b981, #34d399);
  border: 1px solid #10b981;
}

.gantt-bar-overdue {
  background: linear-gradient(135deg, #ef4444, #f87171);
  border: 1px solid #ef4444;
}

.gantt-bar-label {
  position: absolute;
  font-size: 9px;
  color: white;
  font-weight: 500;
  top: 50%;
  transform: translateY(-50%);
  left: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 16px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Sửa CSS cho Gantt Chart để hiển thị các ngày theo hàng ngang */
#gantt-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.gantt-day {
  min-width: 30px;
  flex: 1 1 30px;
  max-width: 60px;
  font-size: 11px;
  text-align: center;
  border-right: 1px solid rgba(229, 231, 235, 0.5);
  position: relative;
  box-sizing: border-box;
}

.gantt-days {
  display: flex !important;
  flex-direction: row !important;
  flex: 1;
  min-width: 900px;
}

.gantt-item-timeline {
  display: flex;
  flex-direction: row;
  flex: 1;
  position: relative;
  min-width: 900px;
  box-sizing: border-box;
}

.gantt-item[data-type="task"] .gantt-item-label span {
  font-size: 0.7rem;
  /* Giảm kích thước chữ tên nhiệm vụ */
  color: #6b7280;
}

.gantt-item[data-type="task"] .gantt-item-label .text-xs {
  font-size: 0.5rem;
  /* Giảm kích thước chữ thông tin phụ */
  color: #6b7280;
}

/* Gantt task indent và icon nhỏ */
.gantt-item[data-type="task"] .gantt-item-label {
  padding-left: 2rem;
  /* Tạo indent cho nhiệm vụ */
}

.gantt-item[data-type="task"] .gantt-item-label i {
  font-size: 8px;
  /* Giảm kích thước chấm màu */
}

/* Gantt tooltip */
.gantt-bar {
  position: relative;
}

.gantt-bar::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  pointer-events: none;
}

.gantt-bar:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Thêm vào file css.html */
.gantt-link-icon {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 4px;
  color: white;
  font-size: 10px;
  line-height: 1.5;
  text-decoration: none;
  transition: all 0.2s ease;
}

.gantt-link-icon:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

.gantt-link-icon i {
  font-size: 8px;
  margin-right: 2px;
}

/* Thêm vào file css.html */
.gantt-item-label .flex.gap-2 {
  max-width: 200px;
  flex-wrap: wrap;
}

.gantt-item-label .flex.gap-2 a {
  background-color: rgba(59, 130, 246, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
  margin-bottom: 2px;
}

.gantt-item-label .flex.gap-2 a:hover {
  background-color: rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

/* CSS điều chỉnh cho Sơ đồ Gantt trên thiết bị di động - Fixed Version */
@media (max-width: 767px) {
  /* Header và controls */
  #gantt-section .text-2xl {
    font-size: 1.25rem;
  }

  #gantt-section .flex.items-center.justify-between {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }

  #gantt-search {
    width: 100%;
    max-width: 280px;
  }

  /* Container chính với scroll ngang */
  #gantt-container {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    margin-top: 16px;
    width: 100%;
  }

  /* Header layout - QUAN TRỌNG: Tính toán chính xác */
  #gantt-header {
    display: flex;
    width: max-content;
    min-width: 100%;
  }

  /* Label column EXACTLY match */
  #gantt-header > :first-child {
    width: 220px;
    min-width: 220px;
    flex-shrink: 0;
    box-sizing: border-box;
  }

  /* Days container - TÍNH TOÁN: 30 ngày × 32px = 960px */
  .gantt-days {
    display: flex;
    flex-direction: row;
    width: calc(var(--days-count, 30) * 32px);
    /* Sử dụng CSS variable cho linh hoạt */
    min-width: 960px;
    /* Fallback cho 30 ngày */
    flex-shrink: 0;
  }

  /* Mỗi ngày cố định 32px */
  .gantt-day {
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    flex: 0 0 32px;
    font-size: 10px;
    text-align: center;
    padding: 3px 1px;
    border-right: 1px solid rgba(229, 231, 235, 0.4);
    box-sizing: border-box;
  }

  .gantt-day-number {
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 1px;
    line-height: 1;
  }

  .gantt-day-label {
    font-size: 8px;
    color: #6b7280;
    line-height: 1;
  }

  /* Item layout khớp với header */
  .gantt-item {
    display: flex;
    width: max-content;
    min-width: 100%;
    min-height: 36px;
    border-bottom: 1px solid rgba(229, 231, 235, 0.3);
    align-items: center;
  }

  /* Label column khớp với header */
  .gantt-item-label {
    position: relative;
    width: 220px;
    min-width: 220px;
    padding: 6px 8px 6px 10px;
    font-size: 13px;
    font-weight: 500;
    box-sizing: border-box;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    background: white;
    border-right: 1px solid rgba(229, 231, 235, 0.8);
    overflow: hidden;
  }

  /* Timeline container khớp với .gantt-days */
  .gantt-days,
  .gantt-item-timeline {
    width: calc(var(--days-count, 30) * 32px);
    min-width: 960px;
    position: relative;
    height: 36px;
    box-sizing: border-box;
  }

  /* Thanh tiến độ */
  .gantt-bar {
    position: absolute;
    height: 14px;
    top: 11px;
    transform: translateY(-50%);
    border-radius: 4px;
    z-index: 5;
    min-width: 8px;
    /* Đảm bảo visible ngay cả với task ngắn */
  }

  .gantt-bar-label {
    position: absolute;
    font-size: 9px;
    color: white;
    font-weight: 500;
    top: 50%;
    transform: translateY(-50%);
    left: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 8px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    line-height: 1;
  }

  /* Hover effects */
  .gantt-item:hover {
    background-color: rgba(243, 244, 246, 0.5);
  }

  /* Toggle button */
  .gantt-toggle-btn {
    width: 18px;
    height: 18px;
    padding: 0;
    margin-right: 4px;
    flex-shrink: 0;
    font-size: 9px;
  }

  /* Task indentation */
  .gantt-task-item .gantt-item-label {
    padding-left: 24px;
  }

  /* Action buttons */
  .gantt-item-actions {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 2px;
  }

  .gantt-item:hover .gantt-item-actions {
    display: flex;
    gap: 2px;
  }

  .gantt-item-actions .action-btn {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }

  /* Scrollbar styling */
  #gantt-container::-webkit-scrollbar {
    height: 8px;
  }

  #gantt-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
  }

  #gantt-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
  }

  #gantt-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
  }

  /* Special day colors */
  .gantt-day.weekend {
    background-color: rgba(229, 231, 235, 0.4);
  }

  .gantt-day.today {
    background-color: #ef4444;
    color: white;
    font-weight: 700;
  }

  /* Progress bar inside gantt bar */
  .gantt-progress {
    position: absolute;
    height: 4px;
    bottom: 2px;
    left: 2px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
  }

  /* Bar colors */
  .gantt-bar-project {
    background: linear-gradient(135deg, #3b82f6, #818cf8);
    border: 1px solid #3b82f6;
  }

  .gantt-bar-task {
    background: linear-gradient(135deg, #10b981, #34d399);
    border: 1px solid #10b981;
  }

  .gantt-bar-overdue {
    background: linear-gradient(135deg, #ef4444, #f87171);
    border: 1px solid #ef4444;
  }

  /* Project task groups */
  .gantt-project-tasks:not(.hidden) {
    /* Tasks được render với cùng structure, không cần margin */
  }

  /* Text truncation trong label */
  .gantt-item-label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
  }

  /* Links trong task labels */
  .gantt-item-label .flex.gap-2 {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .gantt-item-label .flex.gap-2::-webkit-scrollbar {
    display: none;
  }

  .gantt-item-label a {
    font-size: 9px !important;
    padding: 1px 3px !important;
    white-space: nowrap;
    flex-shrink: 0;
  }
}

.action-btn-copy {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.action-btn-copy:hover {
  background: rgba(16, 185, 129, 0.2);
  transform: scale(1.1);
}

#tasks-section table {
  border-collapse: separate;
  border-spacing: 0;
}

.table-bordered th,
.table-bordered td {
  border: 1px solid rgba(229, 231, 235, 0.8);
}

.table-sticky-header {
  max-height: calc(100vh - 300px);
  overflow: scroll;
}

.table-sticky-header thead {
  position: sticky;
  top: 0;
  z-index: 50;
}

#tasks-section th {
  position: sticky;
  top: 0;
  z-index: 100;
}

#tasks-section tbody tr:hover {
  background-color: rgba(249, 250, 251, 0.8);
}

.form-input:disabled,
.form-textarea:disabled,
.form-select:disabled {
  background-color: #f3f4f6;
  color: #6c0000;
  cursor: not-allowed;
  border-color: #d1d5db;
}

.form-input:disabled:hover,
.form-textarea:disabled:hover,
.form-select:disabled:hover {
  background-color: #f3f4f6;
  border-color: #d1d5db;
  box-shadow: none;
}

/* Import Modal Styles */
.import-drop-zone {
  transition: all 0.3s ease;
  border-radius: 12px;
}

.import-drop-zone.dragover {
  border-color: #3b82f6 !important;
  background-color: rgba(59, 130, 246, 0.05);
  transform: scale(1.02);
}

.import-file-item {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.1) 0%,
    rgba(147, 197, 253, 0.1) 100%
  );
  border: 1px solid rgba(59, 130, 246, 0.2);
}

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

.import-dropdown {
  min-width: 200px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.import-dropdown button {
  transition: all 0.2s ease;
}

.import-dropdown button:hover {
  background-color: rgba(59, 130, 246, 0.05);
  color: #3b82f6;
}

/* Excel file icon styling */
.excel-icon {
  background: linear-gradient(135deg, #1d7c3e 0%, #2e8b57 100%);
  color: white;
}

/* Progress indicator for import */
.import-progress {
  background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
  height: 4px;
  border-radius: 2px;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.5;
  }
}

/* Import Modal Styles */
.import-drop-zone {
  transition: all 0.3s ease;
  border-radius: 12px;
}

.import-drop-zone.dragover {
  border-color: #3b82f6 !important;
  background-color: rgba(59, 130, 246, 0.05);
  transform: scale(1.02);
}

.import-file-item {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.1) 0%,
    rgba(147, 197, 253, 0.1) 100%
  );
  border: 1px solid rgba(59, 130, 246, 0.2);
}

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

.import-dropdown {
  min-width: 200px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.import-dropdown button {
  transition: all 0.2s ease;
}

.import-dropdown button:hover {
  background-color: rgba(59, 130, 246, 0.05);
  color: #3b82f6;
}

/* Excel file icon styling */
.excel-icon {
  background: linear-gradient(135deg, #1d7c3e 0%, #2e8b57 100%);
  color: white;
}

/* Progress indicator for import */
.import-progress {
  background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
  height: 4px;
  border-radius: 2px;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.5;
  }
}


button {
  outline: none;
}