body {
  font-family: 'Noto Sans Thai', system-ui, sans-serif;
}

.nav-btn {
  color: #64748b;
}
.nav-btn.active {
  background-color: #fbe9ea;
  color: #AE1F27;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 0.25rem;
}
.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}
.form-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(174, 31, 39, 0.35);
  border-color: #AE1F27;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.pill {
  display: inline-block;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.pill-work { background: #dcfce7; color: #166534; }
.pill-finish { background: #dbeafe; color: #1e40af; }
.pill-other { background: #f1f5f9; color: #475569; }
.pill-overdue { background: #fee2e2; color: #b91c1c; }
.pill-due-soon { background: #ffedd5; color: #c2410c; }
.pill-upcoming { background: #fef9c3; color: #854d0e; }

.sp-filter-btn {
  cursor: pointer;
  border: 2px solid transparent;
}
.sp-filter-btn.active {
  border-color: currentColor;
}

#toast.show {
  display: block;
  animation: fadein 0.2s ease-out;
}
@keyframes fadein {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dp-popup {
  position: fixed;
  z-index: 1000;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  padding: 0.75rem;
  width: 260px;
  font-size: 0.8125rem;
}
.dp-popup.hidden { display: none; }
.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.dp-title {
  font-weight: 600;
  color: #1e293b;
  flex: 1;
  text-align: center;
}
.dp-nav {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.375rem;
  color: #64748b;
  cursor: pointer;
}
.dp-nav:hover { background: #f1f5f9; color: #AE1F27; }
.dp-weekdays, .dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.dp-weekdays { color: #94a3b8; font-size: 0.6875rem; margin-bottom: 0.25rem; }
.dp-day {
  padding: 0.35rem 0;
  border-radius: 0.375rem;
  cursor: pointer;
  color: #334155;
}
.dp-day:hover { background: #fbe9ea; color: #AE1F27; }
.dp-day-today { border: 1px solid #AE1F27; }
.dp-day-selected { background: #AE1F27; color: white; }
.dp-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f1f5f9;
}
.dp-today-btn, .dp-clear-btn {
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 500;
  background: none;
  border: none;
}
.dp-today-btn { color: #AE1F27; }
.dp-clear-btn { color: #94a3b8; }
