@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Light Theme Colors */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.85);
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --border-color: #e2e8f0;
  --border-color-subtle: #f1f5f9;
  
  --primary: #4f46e5;
  --primary-subtle: rgba(79, 70, 229, 0.08);
  --primary-hover: #4338ca;
  
  --success: #10b981;
  --success-subtle: rgba(16, 185, 129, 0.1);
  
  --warning: #f59e0b;
  --warning-subtle: rgba(245, 158, 11, 0.1);
  
  --danger: #ef4444;
  --danger-subtle: rgba(239, 68, 68, 0.1);
  
  --info: #06b6d4;
  --info-subtle: rgba(6, 182, 212, 0.1);
  
  --card-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.05), 0 4px 12px -2px rgba(15, 23, 42, 0.02);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

[data-bs-theme="dark"] {
  --bg-body: #090d16;
  --bg-surface: #131b2e;
  --bg-surface-subtle: #1e293b;
  --bg-glass: rgba(19, 27, 46, 0.85);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  
  --border-color: #1e293b;
  --border-color-subtle: #172033;
  
  --primary: #6366f1;
  --primary-subtle: rgba(99, 102, 241, 0.15);
  --primary-hover: #818cf8;
  
  --success: #34d399;
  --success-subtle: rgba(52, 211, 153, 0.15);
  
  --warning: #fbbf24;
  --warning-subtle: rgba(251, 191, 36, 0.15);
  
  --danger: #f87171;
  --danger-subtle: rgba(248, 113, 113, 0.15);
  
  --info: #38bdf8;
  --info-subtle: rgba(56, 189, 248, 0.15);
  
  --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Base resets */
body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  padding-bottom: 2rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6, .page-title {
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-title {
  font-size: 1.75rem;
  margin-bottom: 0;
}

.text-muted {
  color: var(--text-muted) !important;
}

/* Navbar */
.navbar-modern {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--glass-shadow);
  padding: 0.85rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1030;
  transition: all 0.3s ease;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-main) !important;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.navbar-brand i {
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: #fff;
  padding: 0.5rem;
  border-radius: 10px;
  font-size: 1.1rem;
}

.nav-link-modern {
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link-modern:hover, .nav-link-modern.active {
  color: var(--primary) !important;
  background-color: var(--primary-subtle);
}

/* Cards & Containers */
.card-modern {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
  overflow: hidden;
}

.card-modern:hover {
  box-shadow: 0 14px 35px -5px rgba(15, 23, 42, 0.08);
}

.card-header-modern {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body-modern {
  padding: 1.5rem;
}

/* Metric / Stat Cards */
.stat-card {
  padding: 1.25rem;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

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

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.stat-icon.primary { background: var(--primary-subtle); color: var(--primary); }
.stat-icon.success { background: var(--success-subtle); color: var(--success); }
.stat-icon.warning { background: var(--warning-subtle); color: var(--warning); }
.stat-icon.info { background: var(--info-subtle); color: var(--info); }

.stat-value {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Status Badges */
.badge-status {
  padding: 0.4em 0.8em;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.badge-status-pending, .badge-status-open {
  background-color: var(--warning-subtle);
  color: var(--warning);
}

.badge-status-done, .badge-status-completed {
  background-color: var(--success-subtle);
  color: var(--success);
}

.badge-status-inprogress {
  background-color: var(--primary-subtle);
  color: var(--primary);
}

.badge-status-cancelled {
  background-color: var(--danger-subtle);
  color: var(--danger);
}

/* Tables */
.table-modern-wrapper {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.table-modern {
  width: 100% !important;
  margin-bottom: 0 !important;
  color: var(--text-main) !important;
  border-color: var(--border-color) !important;
}

.table-modern th {
  background-color: var(--bg-surface-subtle) !important;
  color: var(--text-muted) !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 0.85rem 1rem !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.table-modern td {
  padding: 1rem !important;
  vertical-align: middle !important;
  font-size: 0.875rem !important;
  border-bottom: 1px solid var(--border-color-subtle) !important;
}

.table-modern tbody tr {
  transition: background-color 0.15s ease;
}

.table-modern tbody tr:hover {
  background-color: var(--primary-subtle) !important;
}

/* DataTables modern tweaks */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  color: var(--text-muted) !important;
  padding: 0.75rem 1rem !important;
  font-size: 0.875rem;
}

.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-main);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  outline: none;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 6px !important;
  border: none !important;
  color: var(--text-main) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary) !important;
  color: #fff !important;
}

/* Forms */
.form-label-modern {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-control-modern, .form-select-modern {
  background-color: var(--bg-surface) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
  border-radius: 10px !important;
  padding: 0.65rem 0.9rem !important;
  font-size: 0.9rem !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.form-control-modern:focus, .form-select-modern:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px var(--primary-subtle) !important;
  outline: none !important;
}

/* Buttons */
.btn-modern-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff !important;
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1.3rem;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-modern-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.btn-modern-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-modern-outline:hover {
  background-color: var(--bg-surface-subtle);
  border-color: var(--text-muted);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: var(--primary-subtle);
  color: var(--primary);
}

/* Login Layout */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top right, var(--primary-subtle), transparent 40%),
              radial-gradient(circle at bottom left, var(--info-subtle), transparent 40%),
              var(--bg-body);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
  padding: 2.5rem;
}

/* Timeline component for task history */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin-top: 1rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-badge {
  position: absolute;
  left: -2rem;
  top: 0.25rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--primary);
  z-index: 1;
}

.timeline-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--card-shadow);
}