body {
  background-color: #f3f4f6;
}
/* --- Form Layout & Styling --- */
.page-title {
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1f2937;
  margin-top: 40px;
  font-weight: 800;
  font-size: 32px;
}

.form-card {
  background: white;
  padding: 30px 40px;
  width: 95%;          
  max-width: 1100px;   
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  margin: 0 auto 40px auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}

.form-section-title {
  margin-top: 0;
  margin-bottom: 24px;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.form-row {
  margin-bottom: 20px;
}

.form-row-2col {
  display: flex;
  gap: 24px;
  flex-wrap: wrap; /* In case of small screens */
}

.form-row-2col .form-group {
  flex: 1;
  min-width: 200px;
}

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

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

.required-star {
  color: #ef4444;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  outline: none;
  color: #111827;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  background-color: #fff;
}

.form-control:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  padding-right: 40px;
}

.radio-group {
  display: flex;
  gap: 24px;
  align-items: center;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
}

.radio-label input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: #6366f1;
  margin: 0;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.error-msg {
  color: #ef4444;
  font-size: 12px;
  margin-top: 4px;
}

.d-none {
  display: none !important;
}

#add-btn.btn-primary, #add-subtask-btn.btn-primary {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  background-color: #312e81; /* Dark purple */
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
}

#add-btn.btn-primary:hover, #add-subtask-btn.btn-primary:hover {
  background-color: #1e1b4b;
}

#clear-btn.btn-secondary, #clear-subtask-btn.btn-secondary {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  background-color: #6b7280; /* Gray */
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
}

#clear-btn.btn-secondary:hover, #clear-subtask-btn.btn-secondary:hover {
  background-color: #4b5563;
}

.P-container {
  background: white;
  padding: 30px 40px;
  width: 95%;          
  max-width: 1100px;   
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  margin: 40px auto;
}

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

.tasks-header h2 {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 24px;
  color: #1a1a1a;
}

#search-task {
  padding: 10px 20px;
  border-radius: 20px;
  border: 1px solid #ddd;
  width: 250px;
  outline: none;
  background: #f9f9f9;
}

.table-container {
  overflow-x: auto;
}

.task-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
}
.task-table thead tr {
  background-color: #f9fafb !important;
  border-top: 1px solid #f3f4f6 !important;
  border-bottom: 1px solid #e5e7eb !important;
}
.task-table th {
  padding: 16px !important;
  font-size: 11px !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280 !important;
  font-weight: 700;
  border-bottom: 1px solid #e5e7eb !important;
  background-color: #f9fafb !important;
}
.task-table td {
  padding: 16px !important;
  border-bottom: 1px solid #f3f4f6 !important;
  vertical-align: middle !important;
  background-color: white !important;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.priority-low { background-color: #10b981; color: #ffffff; }
.priority-medium { background-color: #fbbf24; color: #000000; }
.priority-high { background-color: #ef4444; color: #ffffff; }

.status-completed { background-color: #3b82f6; color: #ffffff; }
.status-pending { background-color: #6b7280; color: #ffffff; }

.action-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}
.action-buttons button {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: white;
  transition: all 0.2s;
}
.btn-complete {
  background-color: #6baf8f !important;
  color: white !important;
  border: 1px solid #6baf8f !important;
}
.btn-complete:hover {
  opacity: 0.9;
}
.btn-subtask {
  color: #3b82f6 !important;
  border: 1px solid #3b82f6 !important;
}
.btn-subtask:hover {
  background-color: #eff6ff !important;
}
.btn-delete {
  color: #ef4444 !important;
  border: 1px solid #fca5a5 !important;
}
.btn-delete:hover {
  background-color: #fef2f2 !important;
}

/* --- Subtask Modal --- */
.subtask-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.subtask-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.subtask-modal-content {
  background: white;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}

.subtask-modal-overlay.active .subtask-modal-content {
  transform: translateY(0);
}