/* Dashboard Styles */
:root {
  --primary-color: #1e293b;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --info-color: #06b6d4;
  --purple-color: #8b5cf6;
  --pink-color: #ec4899;
  --indigo-color: #6366f1;
  --teal-color: #14b8a6;

  /* Premium Gold Theme Variables */
  --gold-accent: #fbbf24;
  --gold-gradient: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  --gold-glow: 0 0 20px rgba(251, 191, 36, 0.4);
  --gold-text: #92400e;
  --gold-surface: #fffbeb;

  /* Layout */
  --sidebar-width: 280px;
  --header-height: 80px;

  /* Effects */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.18);

  --border-radius: 16px;
  --border-radius-sm: 10px;

  /* Mobile Responsive Offsets */
  --mobile-gap: 12px;
  --mobile-padding: 16px;
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 100%;
    --header-height: 70px;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* Mobile Header */
.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--gold-accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 1000;
}

.mobile-logo-img {
  height: 28px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.menu-toggle {
  background: white;
  border: 1px solid #e2e8f0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.menu-toggle:hover {
  border-color: var(--gold-accent);
  color: var(--gold-text);
}

.header-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
}

.header-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--secondary-color);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.header-btn:hover {
  border-color: var(--gold-accent);
  color: var(--gold-text);
  background: white;
}

.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--gold-accent);
  color: var(--gold-text);
  border: 2px solid white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: -100%;
  width: var(--sidebar-width);
  height: 100vh;
  background: #1e293b;
  color: #f8fafc;
  z-index: 1100;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 3px solid var(--gold-accent);
}

.sidebar.active {
  left: 0;
  box-shadow: 20px 0 50px rgba(0, 0, 0, 0.3);
}

.sidebar-header {
  padding: 2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.sidebar-logo-img {
  height: 28px;
  width: auto;
  filter: drop-shadow(0 0 5px var(--gold-accent));
}

.sidebar-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.5px;
}

.close-sidebar {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.sidebar-nav {
  padding: 1.5rem 1rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  color: #94a3b8;
  text-decoration: none;
  border-radius: 12px;
  margin-bottom: 0.5rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.nav-item i {
  width: 20px;
  font-size: 1.1rem;
  transition: 0.2s;
}

.nav-item:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(5px);
}

.nav-item.active {
  background: var(--gold-gradient);
  color: var(--gold-text);
  box-shadow: var(--gold-glow);
}

.nav-item.active i {
  color: var(--gold-text);
}

.sidebar-footer {
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.user-info i {
  font-size: 2.25rem;
  color: var(--gold-accent);
}

.user-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
}

.user-role {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.logout-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  color: #ef4444;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 10px;
  transition: 0.2s;
}

.logout-link:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Main Content */
.main-content {
  padding: calc(var(--header-height) + 1rem) 1rem 1rem;
}

/* Welcome Section */
.welcome-section {
  margin-bottom: 2rem;
}

.welcome-section h1 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.welcome-section p {
  color: var(--secondary-color);
}

/* KPI Section */
.kpi-section {
  margin-bottom: 3rem;
}

.kpi-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.kpi-card {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(226, 232, 240, 0.8);
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-premium);
  border-color: var(--gold-accent);
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle at top right, rgba(251, 191, 36, 0.05), transparent);
  pointer-events: none;
}

.kpi-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  color: white;
}

.kpi-content {
  display: flex;
  flex-direction: column;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* KPI Colors - Premium Palette */
.kpi-icon.blue {
  background: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.kpi-icon.yellow {
  background: #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.kpi-icon.orange {
  background: #f97316;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.kpi-icon.green {
  background: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.kpi-icon.red {
  background: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.kpi-icon.gray {
  background: #64748b;
  box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.kpi-icon.purple {
  background: #8b5cf6;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.kpi-icon.teal {
  background: #14b8a6;
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.kpi-icon.indigo {
  background: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.kpi-icon.pink {
  background: #ec4899;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

/* Alerts Section */
.alerts-section {
  margin-bottom: 2rem;
}

.alert {
  background: white;
  border-radius: var(--border-radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.alert-warning {
  border-left-color: var(--warning-color);
}

.alert-danger {
  border-left-color: var(--danger-color);
}

.alert-info {
  border-left-color: var(--info-color);
}

.alert i {
  font-size: 1.5rem;
}

.alert-warning i {
  color: var(--warning-color);
}

.alert-danger i {
  color: var(--danger-color);
}

.alert-info i {
  color: var(--info-color);
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.alert-message {
  font-size: 0.875rem;
  color: var(--secondary-color);
}

/* Charts Section */
.charts-section {
  margin-bottom: 3rem;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.chart-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: all 0.3s ease;
}

.chart-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gold-accent);
}

.chart-card.wide {
  grid-column: 1 / -1;
}

.chart-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chart-card h3::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--gold-gradient);
  border-radius: 2px;
}

.chart-card canvas {
  max-height: 300px;
  width: 100% !important;
}

/* Planning Section */
.planning-section {
  margin-bottom: 3rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.planning-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.planning-day {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.day-header {
  background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.day-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.day-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.875rem;
}

.day-tasks {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.day-tasks.collapsed {
  display: none;
}

.intelligent-task-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border-left: 5px solid var(--gold-accent);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.intelligent-task-card:hover {
  transform: translateX(8px);
  box-shadow: var(--shadow-lg);
  border-left-width: 8px;
}

.intelligent-task-card.priority-high {
  border-left-color: var(--danger-color);
}

.intelligent-task-card.priority-medium {
  border-left-color: var(--warning-color);
}

.intelligent-task-card.priority-low {
  border-left-color: var(--success-color);
}

.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.task-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
}

.task-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.task-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-delayed {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fee2e2;
}

.badge-at-risk {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fef3c7;
}

.badge-active {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #d1fae5;
}

.badge-priority-high {
  background: #fff1f2;
  color: #e11d48;
}

.task-description {
  font-size: 0.9rem;
  color: var(--secondary-color);
  margin-bottom: 1.25rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: var(--border-radius-sm);
}

.task-detail-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}

.task-detail-item i {
  color: var(--gold-accent);
  width: 16px;
  text-align: center;
}

.task-detail-item.overdue {
  color: var(--danger-color);
}

.task-detail-item.unassigned {
  color: var(--warning-color);
  font-weight: 700;
}

.task-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.detail-item i {
  color: var(--secondary-color);
}

.progress-bar-container {
  margin-bottom: 1rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), #60a5fa);
  transition: width 0.3s ease;
}

.task-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.materials-summary {
  font-size: 0.875rem;
  color: var(--secondary-color);
}

.task-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  background: none;
  border: 1px solid #e2e8f0;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-sm);
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
}

.btn-primary {
  background: var(--gold-gradient);
  color: var(--gold-text);
  box-shadow: 0 4px 10px rgba(251, 191, 36, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--gold-glow);
}

.btn-secondary {
  background: white;
  color: var(--primary-color);
  border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: var(--gold-accent);
}

/* FAB */
.fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: none;
  font-size: 1.5rem;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: transform 0.2s;
  z-index: 999;
}

.fab:hover {
  transform: scale(1.1);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  padding: 1rem;
  overflow-y: auto;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--secondary-color);
}

.modal-body {
  padding: 1.5rem;
}

.modal-body h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--secondary-color);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.form-control {
  width: 100%;
  padding: 0.625rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
}

.button-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

/* Desktop Styles */
@media (min-width: 768px) {
  .mobile-header {
    display: none;
  }

  .sidebar {
    left: 0;
  }

  .close-sidebar {
    display: none;
  }

  .main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
  }

  .kpi-container {
    overflow-x: visible;
  }

  .chart-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .fab {
    bottom: 2rem;
    right: 2rem;
  }
}

@media (min-width: 1024px) {
  .kpi-container {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Print Styles */
@media print {

  .mobile-header,
  .sidebar,
  .fab,
  .section-header button,
  .task-actions,
  .btn {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
    padding: 0;
  }

  .task-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #e2e8f0;
  }

  .planning-day {
    page-break-inside: avoid;
  }
}

/* ============================================
   INTELLIGENT PLANNING SYSTEM STYLES
   ============================================ */

/* Analytics Header */
.planning-analytics-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
  padding: 20px;
  background: var(--gold-gradient);
  border-radius: var(--border-radius);
  box-shadow: var(--gold-glow);
}

.analytics-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.analytics-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.analytics-card.warning {
  background: #fff3cd;
  border-left: 4px solid #f59e0b;
}

.analytics-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 24px;
  color: white;
}

.analytics-icon.today {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.analytics-icon.progress {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.analytics-icon.delayed {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.analytics-icon.completion {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.analytics-content {
  flex: 1;
}

.analytics-value {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1;
  margin-bottom: 5px;
}

.analytics-label {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Planning Sections */
.planning-section {
  margin-bottom: 25px;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.section-delayed {
  border: 2px solid #ef4444;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
}

.section-today {
  border-left: 4px solid #3b82f6;
}

.section-tomorrow {
  border-left: 4px solid #f59e0b;
}

.section-thisWeek {
  border-left: 4px solid #8b5cf6;
}

.section-nextWeek {
  border-left: 4px solid #06b6d4;
}

.section-later {
  border-left: 4px solid #64748b;
}

.section-header {
  padding: 18px 24px;
  background: linear-gradient(to right, #f8fafc, #ffffff);
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.section-header:hover {
  background: linear-gradient(to right, #f1f5f9, #f8fafc);
}

.section-delayed .section-header {
  background: linear-gradient(to right, #fee2e2, #fef2f2);
}

.section-delayed .section-header:hover {
  background: linear-gradient(to right, #fecaca, #fee2e2);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-icon {
  font-size: 14px;
  color: #64748b;
  transition: transform 0.3s ease;
}

.section-count {
  margin-left: auto;
  background: #3b82f6;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.section-delayed .section-count {
  background: #ef4444;
}

.section-tasks {
  transition: all 0.3s ease;
  overflow: hidden;
}

.section-tasks.expanded {
  max-height: none;
  padding: 20px;
}

.section-tasks.collapsed {
  max-height: 0;
  padding: 0 20px;
}

.empty-section {
  text-align: center;
  padding: 40px;
  color: #10b981;
  font-size: 16px;
  font-weight: 500;
}

/* Intelligent Task Cards */
.intelligent-task-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.intelligent-task-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #94a3b8;
  transition: all 0.3s ease;
}

.intelligent-task-card.priority-high::before {
  background: #ef4444;
}

.intelligent-task-card.priority-medium::before {
  background: #f59e0b;
}

.intelligent-task-card.priority-low::before {
  background: #10b981;
}

.intelligent-task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  border-color: #cbd5e1;
}

.intelligent-task-card.delayed-card {
  background: #fef2f2;
  border-color: #fecaca;
}

.intelligent-task-card.at-risk-card {
  background: #fffbeb;
  border-color: #fed7aa;
}

.task-card-header {
  margin-bottom: 15px;
}

.task-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.task-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.task-badge.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.task-badge.status-in-progress {
  background: #dbeafe;
  color: #1e40af;
}

.task-badge.status-completed {
  background: #d1fae5;
  color: #065f46;
}

.task-badge.badge-delayed {
  background: #fee2e2;
  color: #991b1b;
  animation: pulse 2s ease-in-out infinite;
}

.task-badge.badge-at-risk {
  background: #fef3c7;
  color: #92400e;
}

.task-badge.badge-active {
  background: #dbeafe;
  color: #1e40af;
  animation: pulse-blue 2s ease-in-out infinite;
}

.task-badge.badge-priority-high {
  background: #fee2e2;
  color: #991b1b;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

@keyframes pulse-blue {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.8;
  }
}

.task-description {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 15px;
  line-height: 1.6;
  padding: 10px;
  background: #f8fafc;
  border-radius: 6px;
}

.task-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 15px;
}

.task-detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
  padding: 8px;
  background: #f8fafc;
  border-radius: 6px;
}

.task-detail-item i {
  color: var(--gold-accent);
  width: 16px;
  text-align: center;
}

.task-detail-item.unassigned {
  color: #ef4444;
  background: #fef2f2;
}

.task-detail-item.unassigned i {
  color: #ef4444;
}

.task-detail-item.overdue {
  color: #dc2626;
  background: #fee2e2;
  font-weight: 600;
}

.task-detail-item.overdue i {
  color: #dc2626;
}

.task-progress-section {
  margin-bottom: 15px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-value {
  font-size: 16px;
  font-weight: 700;
}

.progress-bar-container {
  height: 10px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.5s ease, background-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.task-card-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
}

.task-actions {
  display: flex;
  gap: 8px;
}

.task-action-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.task-action-btn:hover {
  background: #f8fafc;
  border-color: #3b82f6;
  color: #3b82f6;
  transform: translateY(-1px);
}

.task-action-btn:active {
  transform: translateY(0);
}

/* Loading State */
.loading {
  text-align: center;
  padding: 60px 20px;
  font-size: 18px;
  color: #64748b;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  .planning-analytics-header {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 15px;
  }

  .analytics-card {
    padding: 15px;
  }

  .analytics-value {
    font-size: 24px;
  }

  .section-header {
    padding: 15px 18px;
  }

  .section-title {
    font-size: 14px;
  }

  .section-tasks.expanded {
    padding: 15px;
  }

  .intelligent-task-card {
    padding: 15px;
  }

  .task-title {
    font-size: 16px;
  }

  .task-details-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .task-badge {
    font-size: 11px;
    padding: 3px 8px;
  }

  /* Touch Feedback Enhancements */
  .nav-item:active,
  .kpi-card:active,
  .btn:active,
  .btn-premium:active,
  .header-btn:active {
    transform: scale(0.97);
    transition: transform 0.1s;
  }

  /* Form Optimization */
  input,
  select,
  textarea {
    font-size: 16px !important;
    /* Prevents auto-zoom on iOS */
  }

  /* Padding adjustments */
  .main-content {
    padding: calc(var(--header-height) + 10px) var(--mobile-padding) var(--mobile-padding);
  }

  .kpi-container {
    grid-template-columns: 1fr 1fr;
    gap: var(--mobile-gap);
  }

  .kpi-card {
    padding: 1rem;
    gap: 0.75rem;
  }

  .kpi-icon {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }

  .kpi-value {
    font-size: 1.35rem;
  }

  .kpi-label {
    font-size: 0.7rem;
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }

  .chart-card {
    padding: 1.25rem;
  }

  .section-header h2 {
    font-size: 1.35rem;
  }

  .welcome-section h1 {
    font-size: 1.5rem;
  }
}

/* Print Styles */
@media print {
  .planning-analytics-header {
    display: none;
  }

  .section-header {
    background: white !important;
    border-bottom: 2px solid #000;
  }

  .section-tasks {
    display: block !important;
    max-height: none !important;
    padding: 10px !important;
  }

  .intelligent-task-card {
    page-break-inside: avoid;
    border: 1px solid #000;
    margin-bottom: 10px;
  }

  .task-actions {
    display: none !important;
  }

  .task-badge {
    border: 1px solid #000;
  }
}
/* 
==========================================
COLLAPSIBLE FILTER BAR & SEARCH (GLOBAL)
==========================================
*/

.filter-bar-container {
  margin-bottom: 2rem;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(226, 232, 240, 0.8);
  overflow: hidden;
  transition: all 0.3s ease;
}

.filter-bar-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  min-height: 80px;
}

.filter-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-title-icon {
    width: 48px;
    height: 48px;
    background: rgba(251, 191, 36, 0.1);
    color: var(--gold-dark);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.filter-title h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin: 0;
}

.filter-title p {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin: 0;
    margin-top: 2px;
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-filter-toggle:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-filter-toggle.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-collapsible-area {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), padding 0.4s;
    opacity: 0;
}

.filter-collapsible-area.show {
    padding: 1.5rem;
    max-height: 500px; /* Arbitrary large height */
    opacity: 1;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #1e293b;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.filter-input:focus {
    outline: none;
    border-color: var(--gold-accent);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

.btn-reset {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 1px solid #e2e8f0;
    color: var(--danger-color);
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-end;
}

.btn-reset:hover {
    background: #fef2f2;
    border-color: #fee2e2;
}

@media (max-width: 768px) {
    .filter-bar-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }
    
    .filter-actions {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
    }
    
    .btn-filter-toggle {
        white-space: nowrap;
    }
    
    .filter-title p {
        display: none;
    }
    
    .filter-title {
        flex: 1;
    }
    
    .filter-title-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .filter-collapsible-area.show {
        padding: 1rem;
    }
}

