/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f8fafc;
  color: #0f172a;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header Component */
.app-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  background-color: #2563eb;
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

/* Dashboard Layout */
.dashboard-main {
  flex: 1;
  padding: 32px 24px;
}

.dashboard-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Stats Section */
.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.stat-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.icon-total {
  background-color: #eff6ff;
}

.icon-pending {
  background-color: #fffbe6;
}

.icon-completed {
  background-color: #ecfdf5;
}

.icon-priority {
  background-color: #fef2f2;
}

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.stat-number {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
}

/* Progress Bar Section */
.progress-section {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.progress-title {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.progress-percent {
  font-size: 14px;
  font-weight: 700;
  color: #2563eb;
}

.progress-track {
  width: 100%;
  height: 10px;
  background-color: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: #2563eb;
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Toolbar & Filters */
.toolbar-section {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 16px;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background-color: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.filters-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-item label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.filter-item select {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background-color: #ffffff;
  color: #0f172a;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.filter-item select:focus {
  border-color: #2563eb;
}

/* Tasks Section */
.tasks-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.tasks-badge {
  font-size: 13px;
  color: #64748b;
  background-color: #e2e8f0;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 500;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Task Item Card */
.task-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.task-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.task-card.completed {
  background-color: #f8fafc;
  border-color: #f1f5f9;
}

.task-checkbox-wrapper {
  margin-top: 3px;
}

.task-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #2563eb;
  border-radius: 4px;
}

.task-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-title {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}

.task-card.completed .task-title {
  text-decoration: line-through;
  color: #94a3b8;
}

.task-desc {
  font-size: 14px;
  color: #475569;
  line-height: 1.4;
  white-space: pre-wrap;
}

.task-card.completed .task-desc {
  color: #94a3b8;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-top: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
}

/* Category Badges */
.badge-work {
  background-color: #eff6ff;
  color: #2563eb;
}

.badge-personal {
  background-color: #f3e8ff;
  color: #7e22ce;
}

.badge-health {
  background-color: #ecfdf5;
  color: #047857;
}

.badge-finance {
  background-color: #fef3c7;
  color: #b45309;
}

.badge-education {
  background-color: #ede9fe;
  color: #6d28d9;
}

/* Priority Badges */
.priority-high {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.priority-medium {
  background-color: #fffbe6;
  color: #d97706;
  border: 1px solid #fef3c7;
}

.priority-low {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.due-date {
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.due-date.overdue {
  color: #dc2626;
  font-weight: 600;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  background: transparent;
  border: 1px solid #e2e8f0;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: #475569;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-icon:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.btn-icon.delete:hover {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

/* Empty State */
.empty-state {
  background-color: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-state.hidden {
  display: none;
}

.empty-icon {
  font-size: 44px;
  margin-bottom: 12px;
}

.empty-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 14px;
  color: #64748b;
  max-width: 400px;
  margin-bottom: 20px;
}

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: #2563eb;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

.btn-secondary {
  background-color: #0f172a;
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: #1e293b;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid #cbd5e1;
  color: #475569;
}

.btn-outline:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

/* Modal Dialog */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  backdrop-filter: blur(2px);
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background-color: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

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

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-text {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 4px;
}

.modal-close-btn:hover {
  color: #0f172a;
  background-color: #f1f5f9;
}

.task-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.required {
  color: #dc2626;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background-color: #ffffff;
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

/* Footer */
.app-footer {
  background-color: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: 16px 24px;
  text-align: center;
  margin-top: auto;
}

.footer-container p {
  font-size: 13px;
  color: #64748b;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .filters-group {
    grid-template-columns: 1fr 1fr;
  }

  .header-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn {
    width: 100%;
  }
}
